Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
2a90e7b
move DefaultLayout to layout.py
edwardchalstrey1 Nov 20, 2025
9005aea
rename function that converts efg to ef with default layout
edwardchalstrey1 Nov 20, 2025
1692a02
add players
edwardchalstrey1 Nov 21, 2025
068392f
get one line for each node
edwardchalstrey1 Nov 21, 2025
61495ea
separate node counter for each level of the tree
edwardchalstrey1 Nov 21, 2025
fe3801e
dont use sublevel for now
edwardchalstrey1 Nov 21, 2025
c23e155
label chance node as player 0
edwardchalstrey1 Nov 21, 2025
b3cdbbe
add initial verison of xshift vals
edwardchalstrey1 Nov 21, 2025
cd46e31
remove xshift for root node
edwardchalstrey1 Nov 21, 2025
fbbcf03
get parent nodes
edwardchalstrey1 Nov 21, 2025
9a030d0
add moves
edwardchalstrey1 Nov 21, 2025
5266e08
add chance probabilities
edwardchalstrey1 Nov 21, 2025
1739130
add payoffs
edwardchalstrey1 Nov 21, 2025
500e0f2
add infosets
edwardchalstrey1 Nov 21, 2025
c58c1fc
ignore sublevel for levels <= 1
edwardchalstrey1 Nov 21, 2025
12bab12
ignore sublevel when node is not sharing an information set
edwardchalstrey1 Nov 21, 2025
fa734cc
import pygambit properly
edwardchalstrey1 Nov 24, 2025
34cead5
finish prev commit
edwardchalstrey1 Nov 24, 2025
47a10c8
add comments to gambit_layout_to_ef function
edwardchalstrey1 Nov 24, 2025
b2e15e8
Add gambit_layout_to_ef into generate_tikz
edwardchalstrey1 Nov 24, 2025
bec4029
allow an output path to be passed for saving ef files
edwardchalstrey1 Nov 24, 2025
ba033e7
add comparisons for gambit layout
edwardchalstrey1 Nov 24, 2025
5d93d6d
compute child levels
edwardchalstrey1 Nov 24, 2025
dafe5c6
remove try except and use if node.infoset in infoset_groups to check …
edwardchalstrey1 Nov 24, 2025
76ee366
tidy sublevel logic and comment
edwardchalstrey1 Nov 24, 2025
907942a
ensure child nodes have levels greater than their parents
edwardchalstrey1 Nov 24, 2025
40a305a
set LEVEL_MULTIPLIER
edwardchalstrey1 Nov 24, 2025
765b546
further improve node level logic
edwardchalstrey1 Nov 24, 2025
bc5309b
handle player names with spaces by replacing spaces with tildes (~)
edwardchalstrey1 Nov 24, 2025
fcedf05
handle cases where no outcomes are defined
edwardchalstrey1 Nov 24, 2025
464cc6b
even holdout efg looks alright
edwardchalstrey1 Nov 24, 2025
6e22e77
don't add player to node if in infoset with multiple nodes
edwardchalstrey1 Nov 24, 2025
171970b
add XSHIFT_MULTIPLIER
edwardchalstrey1 Nov 24, 2025
127d728
increase defealut level multiplier
edwardchalstrey1 Nov 24, 2025
9266477
add SUBLEVEL_MULTIPLIER
edwardchalstrey1 Nov 24, 2025
b6493af
refactor: update gambit_layout_to_ef to use multipliers as parameters
edwardchalstrey1 Nov 24, 2025
c15b19d
add spacing args to draw_tree and generate_tikz functions
edwardchalstrey1 Nov 24, 2025
00da681
mess around with sizing args
edwardchalstrey1 Nov 24, 2025
1f3a3c9
fix: explicitly specify parameters in generate_tikz call
edwardchalstrey1 Dec 2, 2025
77ef273
fix: explicitly specify parameters in generate_tikz call
edwardchalstrey1 Dec 2, 2025
11ea4ba
separate test notebooks
edwardchalstrey1 Dec 2, 2025
45cff27
just load the generated ef file from draw_tree when running generate_…
edwardchalstrey1 Dec 3, 2025
b29a64b
fix: add .ef files to .gitignore for tutorial dir
edwardchalstrey1 Dec 3, 2025
e98bddf
switch output_path for save_to so that it can be a file path
edwardchalstrey1 Dec 3, 2025
0dcdd49
update draw_tree function docstring and rename arg from ef_file to game
edwardchalstrey1 Dec 3, 2025
57ec92a
add pygambit to test workflow
edwardchalstrey1 Dec 3, 2025
efef8db
add test that runs notebooks
edwardchalstrey1 Dec 3, 2025
4268c0b
update developer requirements and GitHub Actions test workflow to inc…
edwardchalstrey1 Dec 3, 2025
5d6c1a8
update test workflow to install the latest pygambit from GitHub
edwardchalstrey1 Dec 3, 2025
fd538e5
remove pygambit from optional dependencies for now
edwardchalstrey1 Dec 3, 2025
9ac7970
update comment
edwardchalstrey1 Dec 3, 2025
9be50a5
add LaTeX installation step to test workflow
edwardchalstrey1 Dec 3, 2025
536cb80
remove print statement
edwardchalstrey1 Dec 3, 2025
ae0dc0d
update scale_factor default in draw_tree and related functions to 0.8
edwardchalstrey1 Dec 3, 2025
2a45456
replace spaces with tildes in prior action labels for .ef string form…
edwardchalstrey1 Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install LaTeX
run: |
sudo apt-get update
sudo apt-get install -y texlive-full

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
pip install git+https://github.com/gambitproject/gambit.git # TODO: add pygambit to dev dependencies after 16.5 release.

- name: Test with pytest
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,5 @@ temp*
.temp*

# .ef files generated from .efg files (the test suite)
games/efg/*.ef
games/efg/*.ef
tutorial/*.ef
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ keywords = ["game theory", "tikz", "visualization", "trees", "economics"]
dependencies = ["jupyter-tikz", "ipykernel"]

[project.optional-dependencies]
dev = ["pytest>=7.0.0", "pytest-cov"]
dev = ["pytest>=7.0.0", "pytest-cov", "nbformat", "nbclient", "ipykernel"]

[project.scripts]
draw_tree = "draw_tree.cli:main"
Expand Down
7 changes: 5 additions & 2 deletions src/draw_tree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
generate_png,
ef_to_tex,
latex_wrapper,
efg_to_ef
efg_dl_ef
)

from .gambit_layout import gambit_layout_to_ef

__all__ = [
"draw_tree",
"generate_tikz",
Expand All @@ -26,5 +28,6 @@
"generate_png",
"ef_to_tex",
"latex_wrapper",
"efg_to_ef"
"efg_dl_ef",
"gambit_layout_to_ef"
]
Loading