From 8762977a16ef571f7a82615cc7b0d7667e58e554 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Wed, 3 Dec 2025 14:26:26 +0000 Subject: [PATCH 01/35] Add texlive-full to apt_packages in Read the Docs configuration --- .readthedocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index af921b438..8fbb940b9 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -12,6 +12,7 @@ build: apt_packages: - libgmp-dev - pandoc + - texlive-full python: install: From 8e9fc7b0655ae3a0a58f9bf9095e6cddfbf0011a Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Wed, 3 Dec 2025 14:28:03 +0000 Subject: [PATCH 02/35] Add draw-tree dependency to requirements for tutorials --- doc/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/requirements.txt b/doc/requirements.txt index 606f56fbd..b45969a63 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -10,3 +10,4 @@ matplotlib pickleshare jupyter open_spiel +draw-tree @ git+https://github.com/gambitproject/draw_tree.git@main From 51cb3637fbbc6569b4dbcc0fd17df3973017a1ee Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Wed, 3 Dec 2025 14:57:44 +0000 Subject: [PATCH 03/35] Add Jupyter notebook checkpoints to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5e3055af4..2808a45e7 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ doc/tutorials/games/*.nfg doc/tutorials/games/*.efg *.dmg Gambit.app/* +*.ipynb_checkpoints From 910a4b23cf7568ef3dc407560b6a3180055d6161 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Wed, 3 Dec 2025 14:58:35 +0000 Subject: [PATCH 04/35] ignore .ef files generated by draw_tree in tutorials --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2808a45e7..4c7b62040 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ doc/tutorials/games/*.efg *.dmg Gambit.app/* *.ipynb_checkpoints +*.ef From 49ca9f727ab8f8fbd8bb69ba1cfcea635c8f0009 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Wed, 3 Dec 2025 15:01:31 +0000 Subject: [PATCH 05/35] add draw_tree to extensive form tutorial --- doc/tutorials/02_extensive_form.ipynb | 964 ++++++++++++++++++++++++-- 1 file changed, 924 insertions(+), 40 deletions(-) diff --git a/doc/tutorials/02_extensive_form.ipynb b/doc/tutorials/02_extensive_form.ipynb index 4fa2094bc..e5189e60f 100644 --- a/doc/tutorials/02_extensive_form.ipynb +++ b/doc/tutorials/02_extensive_form.ipynb @@ -24,22 +24,34 @@ "- If the Seller chooses **Honor**, both players receive payoffs of `1`;\n", "- If the Seller chooses **Abuse**, the Buyer receives a payoff of `-1` and the Seller receives a payoff of `2`.\n", "\n", - "We create a game with an extensive representation using `Game.new_tree`:" + "In addition to `pygambit`, this tutorial introduces the `draw_tree` package, which can be used to draw extensive form games in Python.\n", + "If you're running this tutorial on your local machine, you'll need to install the requirements for [draw_tree](https://github.com/gambitproject/draw_tree), which include LaTeX, in order to run the `draw_tree` cells.\n", + "Another option for visualising extensive form games is to install the Gambit GUI and use it to load the EFG file generated at the end of this tutorial." ] }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "5946289b", "metadata": {}, "outputs": [], "source": [ + "from draw_tree import draw_tree\n", + "\n", "import pygambit as gbt" ] }, + { + "cell_type": "markdown", + "id": "407eb819-9481-42e4-9886-3e87e7fec8af", + "metadata": {}, + "source": [ + "We create a game with an extensive representation using `Game.new_tree`:" + ] + }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 10, "id": "91ed4dfb", "metadata": {}, "outputs": [], @@ -60,23 +72,48 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 11, "id": "3cd94917", "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" + ] + }, { "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], "text/plain": [ - "0" + "" ] }, - "execution_count": 3, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "len(g.root.children)" + "draw_tree(g)" ] }, { @@ -91,28 +128,152 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 12, "id": "5d27a07a", "metadata": {}, + "outputs": [], + "source": [ + "g.append_move(\n", + " g.root, # This is the node to append the move to\n", + " player=\"Buyer\",\n", + " actions=[\"Trust\", \"Not trust\"]\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "45638fda-7e25-4c8e-b709-24b05780581b", + "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" + ] + }, { "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], "text/plain": [ - "2" + "" ] }, - "execution_count": 4, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "g.append_move(\n", - " g.root, # This is the node to append the move to\n", - " player=\"Buyer\",\n", - " actions=[\"Trust\", \"Not trust\"]\n", - ")\n", - "len(g.root.children)" + "draw_tree(g)" ] }, { @@ -125,7 +286,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 14, "id": "47c4a31b", "metadata": {}, "outputs": [], @@ -137,6 +298,193 @@ ")" ] }, + { + "cell_type": "code", + "execution_count": 15, + "id": "ce41e9fe-cca4-46fb-8e9d-b2c27342e5ef", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "draw_tree(g)" + ] + }, { "cell_type": "markdown", "id": "382ba37d", @@ -151,7 +499,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 16, "id": "716e9b9a", "metadata": {}, "outputs": [], @@ -165,6 +513,179 @@ ")" ] }, + { + "cell_type": "code", + "execution_count": 17, + "id": "b3408c55-714e-4a6f-b598-e338839442e4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "draw_tree(g)" + ] + }, { "cell_type": "markdown", "id": "df082b10", @@ -175,7 +696,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 18, "id": "695b1aad", "metadata": {}, "outputs": [], @@ -189,6 +710,193 @@ ")" ] }, + { + "cell_type": "code", + "execution_count": 19, + "id": "09bedb3a-aac7-46e6-ae93-c47932c746d4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "draw_tree(g)" + ] + }, { "cell_type": "markdown", "id": "48335eb8", @@ -199,7 +907,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 20, "id": "0704ef86", "metadata": {}, "outputs": [], @@ -213,6 +921,189 @@ ")" ] }, + { + "cell_type": "code", + "execution_count": 21, + "id": "cba0e562-2989-4dae-a0f0-b121635ba032", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "draw_tree(g)" + ] + }, { "cell_type": "markdown", "id": "09ef5e2e", @@ -239,7 +1130,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 22, "id": "37c51152", "metadata": {}, "outputs": [], @@ -257,7 +1148,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 23, "id": "0d86a750", "metadata": {}, "outputs": [], @@ -265,6 +1156,14 @@ "# gbt.read_efg(\"trust_game.efg\")" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "1bab777f-8a0b-4f1e-9c0c-270690288243", + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "id": "be034836", @@ -278,25 +1177,10 @@ { "cell_type": "code", "execution_count": null, - "id": "1c1d7a22", + "id": "ddf390ee-5d99-41a9-bfd9-7df86e372d5b", "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "Game(title='One-shot trust game, after Kreps (1990)')" - ], - "text/plain": [ - "Game(title='One-shot trust game, after Kreps (1990)')" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "g" - ] + "outputs": [], + "source": [] } ], "metadata": { From e6579f5489fbd3ab7d6ce4dcab55bf469d638952 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Wed, 3 Dec 2025 15:23:12 +0000 Subject: [PATCH 06/35] update extensive form notebook to save tree image to file with draw_tree --- .gitignore | 1 + doc/tutorials/02_extensive_form.ipynb | 125 +++++++++++--------------- 2 files changed, 51 insertions(+), 75 deletions(-) diff --git a/.gitignore b/.gitignore index 4c7b62040..d2f3fe579 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ Gambit.app/* *.so doc/tutorials/games/*.nfg doc/tutorials/games/*.efg +doc/tutorials/*.png *.dmg Gambit.app/* *.ipynb_checkpoints diff --git a/doc/tutorials/02_extensive_form.ipynb b/doc/tutorials/02_extensive_form.ipynb index e5189e60f..06b4bafba 100644 --- a/doc/tutorials/02_extensive_form.ipynb +++ b/doc/tutorials/02_extensive_form.ipynb @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "5946289b", "metadata": {}, "outputs": [], @@ -51,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 2, "id": "91ed4dfb", "metadata": {}, "outputs": [], @@ -72,17 +72,10 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 3, "id": "3cd94917", "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" - ] - }, { "data": { "image/svg+xml": [ @@ -107,7 +100,7 @@ "" ] }, - "execution_count": 11, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -128,7 +121,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 4, "id": "5d27a07a", "metadata": {}, "outputs": [], @@ -142,17 +135,10 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 5, "id": "45638fda-7e25-4c8e-b709-24b05780581b", "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" - ] - }, { "data": { "image/svg+xml": [ @@ -267,7 +253,7 @@ "" ] }, - "execution_count": 13, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -286,7 +272,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 6, "id": "47c4a31b", "metadata": {}, "outputs": [], @@ -300,17 +286,10 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 7, "id": "ce41e9fe-cca4-46fb-8e9d-b2c27342e5ef", "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" - ] - }, { "data": { "image/svg+xml": [ @@ -476,7 +455,7 @@ "" ] }, - "execution_count": 15, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -499,7 +478,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 8, "id": "716e9b9a", "metadata": {}, "outputs": [], @@ -515,17 +494,10 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 9, "id": "b3408c55-714e-4a6f-b598-e338839442e4", "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" - ] - }, { "data": { "image/svg+xml": [ @@ -677,7 +649,7 @@ "" ] }, - "execution_count": 17, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -696,7 +668,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 10, "id": "695b1aad", "metadata": {}, "outputs": [], @@ -712,17 +684,10 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 11, "id": "09bedb3a-aac7-46e6-ae93-c47932c746d4", "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" - ] - }, { "data": { "image/svg+xml": [ @@ -888,7 +853,7 @@ "" ] }, - "execution_count": 19, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -907,7 +872,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 12, "id": "0704ef86", "metadata": {}, "outputs": [], @@ -923,17 +888,10 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 13, "id": "cba0e562-2989-4dae-a0f0-b121635ba032", "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing .ef file to: One-shot trust game, after Kreps (1990).ef\n" - ] - }, { "data": { "image/svg+xml": [ @@ -1095,7 +1053,7 @@ "" ] }, - "execution_count": 21, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -1125,12 +1083,13 @@ "You can use Gambit to save games to, and read from files.\n", "The specific format depends on whether the game is normal or extensive-form.\n", "\n", - "Here we'll save the Trust game (extensive-form) to the `.efg` format." + "Here we'll save the Trust game (extensive-form) to the `.efg` format.\n", + "Uncomment these lines of code if you're running the tutorial locally:" ] }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 14, "id": "37c51152", "metadata": {}, "outputs": [], @@ -1148,7 +1107,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 15, "id": "0d86a750", "metadata": {}, "outputs": [], @@ -1156,13 +1115,37 @@ "# gbt.read_efg(\"trust_game.efg\")" ] }, + { + "cell_type": "markdown", + "id": "182f2424-274e-4044-84ff-3323cd70ec68", + "metadata": {}, + "source": [ + "You can also use the `draw_tree` package to save the game in the `.ef` format which encodes layout information.\n", + "This can in turn be used to render the image for use in publications, for example as a `.png` (there are also `.pdf` and `.tex` options, see [draw_tree](https://github.com/gambitproject/draw_tree)):" + ] + }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "id": "1bab777f-8a0b-4f1e-9c0c-270690288243", "metadata": {}, "outputs": [], - "source": [] + "source": [ + "# from draw_tree import generate_png\n", + "# draw_tree(g, save_to=\"trust_game.ef\")\n", + "# trust_game_png = generate_png(\"trust_game.ef\")" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "2b715221-e427-4092-ad2f-9f4f2b548fa4", + "metadata": {}, + "outputs": [], + "source": [ + "# from IPython.display import Image\n", + "# Image(trust_game_png)" + ] }, { "cell_type": "markdown", @@ -1173,19 +1156,11 @@ "\n", "Kreps, D. (1990) \"Corporate Culture and Economic Theory.\" In J. Alt and K. Shepsle, eds., *Perspectives on Positive Political Economy*, Cambridge University Press." ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ddf390ee-5d99-41a9-bfd9-7df86e372d5b", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { "kernelspec": { - "display_name": "gambitvenv313", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, From 38f8f479fe04d6e42a9f93ae5190c32bebeecff1 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Wed, 3 Dec 2025 15:28:57 +0000 Subject: [PATCH 07/35] add draw_tree to stripped down poker tutorial --- doc/tutorials/03_stripped_down_poker.ipynb | 1197 +++++++++++++++++++- 1 file changed, 1187 insertions(+), 10 deletions(-) diff --git a/doc/tutorials/03_stripped_down_poker.ipynb b/doc/tutorials/03_stripped_down_poker.ipynb index 647f4bf35..ec6105319 100644 --- a/doc/tutorials/03_stripped_down_poker.ipynb +++ b/doc/tutorials/03_stripped_down_poker.ipynb @@ -30,16 +30,22 @@ " - If he chooses to Call, he adds another $1 to the pot.\n", "- There is then a showdown, in which Alice reveals her card.\n", " - If she has a King, then she wins the pot.\n", - " - If she has a Queen, then Bob wins the pot." + " - If she has a Queen, then Bob wins the pot.\n", + "\n", + "In addition to `pygambit`, this tutorial uses the `draw_tree` package, which can be used to draw extensive form games in Python.\n", + "If you're running this tutorial on your local machine, you'll need to install the requirements for [draw_tree](https://github.com/gambitproject/draw_tree), which include LaTeX, in order to run the `draw_tree` cells.\n", + "Another option for visualising extensive form games is to install the Gambit GUI and use it to load a saved EFG file." ] }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "id": "69cbfe81", "metadata": {}, "outputs": [], "source": [ + "from draw_tree import draw_tree\n", + "\n", "import pygambit as gbt" ] }, @@ -53,7 +59,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "id": "ad6a1119", "metadata": {}, "outputs": [], @@ -74,7 +80,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 5, "id": "841f9f74", "metadata": {}, "outputs": [ @@ -110,7 +116,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 6, "id": "fe80c64c", "metadata": {}, "outputs": [], @@ -122,6 +128,173 @@ ")" ] }, + { + "cell_type": "code", + "execution_count": 7, + "id": "867cb1d8-7a5d-45d1-9349-9bbc2a4e2344", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "draw_tree(g)" + ] + }, { "cell_type": "markdown", "id": "5cf73f0a", @@ -138,7 +311,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 8, "id": "0e3bb5ef", "metadata": {}, "outputs": [], @@ -151,6 +324,282 @@ " )" ] }, + { + "cell_type": "code", + "execution_count": 9, + "id": "0c522c2d-992e-48b6-a1f8-0696d33cdbe0", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "draw_tree(g)" + ] + }, { "cell_type": "markdown", "id": "4c8d0343", @@ -171,7 +620,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 10, "id": "dbfa7035", "metadata": {}, "outputs": [], @@ -183,6 +632,371 @@ ")" ] }, + { + "cell_type": "code", + "execution_count": 11, + "id": "e85b3346-2fea-4a73-aa72-9efb436c68c1", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "draw_tree(g)" + ] + }, { "cell_type": "markdown", "id": "c4eeb65f", @@ -198,7 +1012,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 12, "id": "87c988be", "metadata": {}, "outputs": [], @@ -219,7 +1033,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 14, "id": "29aa60a0", "metadata": {}, "outputs": [], @@ -239,6 +1053,369 @@ "g.set_outcome(g.root.children[\"Queen\"].children[\"Bet\"].children[\"Fold\"], win)" ] }, + { + "cell_type": "code", + "execution_count": 15, + "id": "fdee7b53-7820-44df-9d17-d15d0b9667aa", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "draw_tree(g)" + ] + }, { "cell_type": "markdown", "id": "17eb6af5", @@ -1594,7 +2771,7 @@ ], "metadata": { "kernelspec": { - "display_name": "gambitvenv313", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, From d85abdca0437da031d534d385eec564b98d6bfb3 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Wed, 3 Dec 2025 15:38:40 +0000 Subject: [PATCH 08/35] rerun notebooks after reducing draw_tree scale factor --- doc/tutorials/02_extensive_form.ipynb | 590 +++++------ doc/tutorials/03_stripped_down_poker.ipynb | 1047 ++++++++++---------- 2 files changed, 813 insertions(+), 824 deletions(-) diff --git a/doc/tutorials/02_extensive_form.ipynb b/doc/tutorials/02_extensive_form.ipynb index 06b4bafba..a15fd7e42 100644 --- a/doc/tutorials/02_extensive_form.ipynb +++ b/doc/tutorials/02_extensive_form.ipynb @@ -142,110 +142,110 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "" ], @@ -293,7 +293,7 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", @@ -355,100 +355,98 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", "\n", - "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "" ], "text/plain": [ @@ -501,148 +499,146 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "" ], "text/plain": [ @@ -691,162 +687,160 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "" ], "text/plain": [ @@ -895,158 +889,168 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "" ], "text/plain": [ @@ -1126,7 +1130,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 16, "id": "1bab777f-8a0b-4f1e-9c0c-270690288243", "metadata": {}, "outputs": [], @@ -1138,7 +1142,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 17, "id": "2b715221-e427-4092-ad2f-9f4f2b548fa4", "metadata": {}, "outputs": [], diff --git a/doc/tutorials/03_stripped_down_poker.ipynb b/doc/tutorials/03_stripped_down_poker.ipynb index ec6105319..0adbc3f16 100644 --- a/doc/tutorials/03_stripped_down_poker.ipynb +++ b/doc/tutorials/03_stripped_down_poker.ipynb @@ -39,7 +39,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "id": "69cbfe81", "metadata": {}, "outputs": [], @@ -59,7 +59,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "id": "ad6a1119", "metadata": {}, "outputs": [], @@ -80,7 +80,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "id": "841f9f74", "metadata": {}, "outputs": [ @@ -116,7 +116,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "id": "fe80c64c", "metadata": {}, "outputs": [], @@ -130,155 +130,143 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "id": "867cb1d8-7a5d-45d1-9349-9bbc2a4e2344", "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", "" ], @@ -286,7 +274,7 @@ "" ] }, - "execution_count": 7, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -311,7 +299,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "id": "0e3bb5ef", "metadata": {}, "outputs": [], @@ -326,264 +314,274 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 7, "id": "0c522c2d-992e-48b6-a1f8-0696d33cdbe0", "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", "\n", - "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], @@ -591,7 +589,7 @@ "" ] }, - "execution_count": 9, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -620,7 +618,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 8, "id": "dbfa7035", "metadata": {}, "outputs": [], @@ -634,361 +632,361 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "id": "e85b3346-2fea-4a73-aa72-9efb436c68c1", "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "" ], "text/plain": [ "" ] }, - "execution_count": 11, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -1012,7 +1010,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 10, "id": "87c988be", "metadata": {}, "outputs": [], @@ -1033,7 +1031,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 11, "id": "29aa60a0", "metadata": {}, "outputs": [], @@ -1055,30 +1053,30 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 12, "id": "fdee7b53-7820-44df-9d17-d15d0b9667aa", "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1171,243 +1169,230 @@ "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", + "\n", "\n", + "\n", "\n", - "\n", - "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "" ], "text/plain": [ "" ] }, - "execution_count": 15, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -1429,7 +1414,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 13, "id": "4d92c8d9", "metadata": {}, "outputs": [ @@ -1439,7 +1424,7 @@ "NashComputationResult(method='lcp', rational=True, use_strategic=False, equilibria=[[[[Rational(1, 1), Rational(0, 1)], [Rational(1, 3), Rational(2, 3)]], [[Rational(2, 3), Rational(1, 3)]]]], parameters={'stop_after': 0, 'max_depth': 0})" ] }, - "execution_count": 9, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -1463,7 +1448,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 14, "id": "9967d6f7", "metadata": {}, "outputs": [ @@ -1490,7 +1475,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "id": "3293e818", "metadata": {}, "outputs": [ @@ -1500,7 +1485,7 @@ "pygambit.gambit.MixedBehaviorProfileRational" ] }, - "execution_count": 11, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -1521,7 +1506,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 16, "id": "4cf38264", "metadata": {}, "outputs": [ @@ -1531,7 +1516,7 @@ "pygambit.gambit.MixedBehavior" ] }, - "execution_count": 12, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -1542,7 +1527,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 17, "id": "85e7fdda", "metadata": {}, "outputs": [ @@ -1555,7 +1540,7 @@ "[[Rational(1, 1), Rational(0, 1)], [Rational(1, 3), Rational(2, 3)]]" ] }, - "execution_count": 13, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -1580,7 +1565,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 18, "id": "f45a82b6", "metadata": {}, "outputs": [ @@ -1612,7 +1597,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 19, "id": "83bbd3e5", "metadata": {}, "outputs": [ @@ -1645,7 +1630,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 20, "id": "6bf51b38", "metadata": {}, "outputs": [ @@ -1658,7 +1643,7 @@ "[[Rational(2, 3), Rational(1, 3)]]" ] }, - "execution_count": 16, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -1681,7 +1666,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 21, "id": "2966e700", "metadata": {}, "outputs": [ @@ -1694,7 +1679,7 @@ "Rational(2, 3)" ] }, - "execution_count": 17, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -1713,7 +1698,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 22, "id": "f5a7f110", "metadata": {}, "outputs": [ @@ -1726,7 +1711,7 @@ "Rational(2, 3)" ] }, - "execution_count": 18, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -1747,7 +1732,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 23, "id": "a7d3816d", "metadata": {}, "outputs": [ @@ -1782,7 +1767,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 24, "id": "4a54b20c", "metadata": {}, "outputs": [ @@ -1815,7 +1800,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 25, "id": "b250c1cd", "metadata": {}, "outputs": [ @@ -1828,7 +1813,7 @@ "Rational(2, 3)" ] }, - "execution_count": 21, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -1847,7 +1832,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 26, "id": "6f01846b", "metadata": {}, "outputs": [ @@ -1879,7 +1864,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 27, "id": "5079d231", "metadata": {}, "outputs": [ @@ -1892,7 +1877,7 @@ "Rational(1, 3)" ] }, - "execution_count": 23, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } @@ -1903,7 +1888,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 28, "id": "c55f2c7a", "metadata": {}, "outputs": [ @@ -1916,7 +1901,7 @@ "Rational(-1, 3)" ] }, - "execution_count": 24, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } @@ -1943,7 +1928,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 29, "id": "d4ecff88", "metadata": {}, "outputs": [ @@ -1953,7 +1938,7 @@ "['11', '12', '21', '22']" ] }, - "execution_count": 25, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -1977,7 +1962,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 30, "id": "24e4b6e8", "metadata": {}, "outputs": [ @@ -1987,7 +1972,7 @@ "NashComputationResult(method='gnm', rational=False, use_strategic=True, equilibria=[[[0.33333333333866677, 0.6666666666613335, 0.0, 0.0], [0.6666666666559997, 0.3333333333440004]]], parameters={'perturbation': [[1.0, 0.0, 0.0, 0.0], [1.0, 0.0]], 'end_lambda': -10.0, 'steps': 100, 'local_newton_interval': 3, 'local_newton_maxits': 10})" ] }, - "execution_count": 26, + "execution_count": 30, "metadata": {}, "output_type": "execute_result" } @@ -2009,7 +1994,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 31, "id": "d9ffb4b8", "metadata": {}, "outputs": [ @@ -2019,7 +2004,7 @@ "pygambit.gambit.MixedStrategyProfileDouble" ] }, - "execution_count": 27, + "execution_count": 31, "metadata": {}, "output_type": "execute_result" } @@ -2041,7 +2026,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 32, "id": "56e2f847", "metadata": {}, "outputs": [ @@ -2094,7 +2079,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 33, "id": "d18a91f0", "metadata": {}, "outputs": [ @@ -2160,7 +2145,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 34, "id": "0c55f745", "metadata": {}, "outputs": [ @@ -2170,7 +2155,7 @@ "(Rational(2, 1), Rational(-2, 1))" ] }, - "execution_count": 30, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -2192,7 +2177,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 35, "id": "101598c6", "metadata": {}, "outputs": [ @@ -2202,7 +2187,7 @@ "1" ] }, - "execution_count": 31, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -2214,7 +2199,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 36, "id": "9b142728", "metadata": {}, "outputs": [ @@ -2224,7 +2209,7 @@ "3.987411578698641e-08" ] }, - "execution_count": 32, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -2245,7 +2230,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 37, "id": "ff405409", "metadata": {}, "outputs": [ @@ -2255,7 +2240,7 @@ "9.968528946746602e-09" ] }, - "execution_count": 33, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -2276,7 +2261,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 38, "id": "31b0143c", "metadata": {}, "outputs": [ @@ -2286,7 +2271,7 @@ "9.395259956013202e-05" ] }, - "execution_count": 34, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -2305,7 +2290,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 39, "id": "7cfba34a", "metadata": {}, "outputs": [ @@ -2313,8 +2298,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 9.9 ms, sys: 230 μs, total: 10.1 ms\n", - "Wall time: 10.1 ms\n" + "CPU times: user 9.25 ms, sys: 159 μs, total: 9.41 ms\n", + "Wall time: 9.44 ms\n" ] }, { @@ -2323,7 +2308,7 @@ "NashComputationResult(method='logit', rational=False, use_strategic=False, equilibria=[[[[1.0, 0.0], [0.3338351656285655, 0.666164834417892]], [[0.6670407651644307, 0.3329592348608147]]]], parameters={'first_step': 0.03, 'max_accel': 1.1})" ] }, - "execution_count": 35, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -2335,7 +2320,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 40, "id": "6f1809a7", "metadata": {}, "outputs": [ @@ -2343,8 +2328,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 18.4 ms, sys: 210 μs, total: 18.6 ms\n", - "Wall time: 18.6 ms\n" + "CPU times: user 17.1 ms, sys: 169 μs, total: 17.3 ms\n", + "Wall time: 17.3 ms\n" ] }, { @@ -2353,7 +2338,7 @@ "NashComputationResult(method='logit', rational=False, use_strategic=False, equilibria=[[[[1.0, 0.0], [0.33333338649882943, 0.6666666135011706]], [[0.6666667065407631, 0.3333332934592369]]]], parameters={'first_step': 0.03, 'max_accel': 1.1})" ] }, - "execution_count": 36, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -2375,7 +2360,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 41, "id": "414b6f65", "metadata": {}, "outputs": [ @@ -2385,7 +2370,7 @@ "5.509533871672634e-05" ] }, - "execution_count": 37, + "execution_count": 41, "metadata": {}, "output_type": "execute_result" } @@ -2407,7 +2392,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 42, "id": "a892dc2b", "metadata": {}, "outputs": [ @@ -2417,7 +2402,7 @@ "5.509533871672634e-05" ] }, - "execution_count": 38, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" } @@ -2448,7 +2433,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 43, "id": "2f79695a", "metadata": {}, "outputs": [ @@ -2458,7 +2443,7 @@ "[Rational(1, 3), Rational(1, 3), Rational(1, 3)]" ] }, - "execution_count": 39, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } @@ -2482,7 +2467,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 44, "id": "5de6acb2", "metadata": {}, "outputs": [ @@ -2492,7 +2477,7 @@ "[Rational(1, 4), Rational(1, 2), Rational(1, 4)]" ] }, - "execution_count": 40, + "execution_count": 44, "metadata": {}, "output_type": "execute_result" } @@ -2515,7 +2500,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 45, "id": "c47d2ab6", "metadata": {}, "outputs": [ @@ -2525,7 +2510,7 @@ "[Decimal('0.25'), Decimal('0.50'), Decimal('0.25')]" ] }, - "execution_count": 41, + "execution_count": 45, "metadata": {}, "output_type": "execute_result" } @@ -2552,7 +2537,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 46, "id": "04329084", "metadata": {}, "outputs": [ @@ -2562,7 +2547,7 @@ "[Rational(1, 4), Rational(1, 2), Rational(1, 4)]" ] }, - "execution_count": 42, + "execution_count": 46, "metadata": {}, "output_type": "execute_result" } @@ -2574,7 +2559,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 47, "id": "9015e129", "metadata": {}, "outputs": [ @@ -2584,7 +2569,7 @@ "[Decimal('0.25'), Decimal('0.50'), Decimal('0.25')]" ] }, - "execution_count": 43, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -2609,7 +2594,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 48, "id": "0a019aa5", "metadata": {}, "outputs": [ @@ -2619,7 +2604,7 @@ "[Decimal('0.25'), Decimal('0.5'), Decimal('0.25')]" ] }, - "execution_count": 44, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } @@ -2639,7 +2624,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 49, "id": "1991d288", "metadata": {}, "outputs": [ @@ -2669,7 +2654,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 50, "id": "b1dc37fd", "metadata": {}, "outputs": [ @@ -2679,7 +2664,7 @@ "1.0" ] }, - "execution_count": 46, + "execution_count": 50, "metadata": {}, "output_type": "execute_result" } @@ -2698,7 +2683,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 51, "id": "dc1edea2", "metadata": {}, "outputs": [ @@ -2708,7 +2693,7 @@ "Decimal('0.3333333333333333')" ] }, - "execution_count": 47, + "execution_count": 51, "metadata": {}, "output_type": "execute_result" } @@ -2727,7 +2712,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 52, "id": "1edd90d6", "metadata": {}, "outputs": [ @@ -2737,7 +2722,7 @@ "Decimal('0.9999999999999999')" ] }, - "execution_count": 48, + "execution_count": 52, "metadata": {}, "output_type": "execute_result" } From e3c58d63471f4db2b8679e6ed44644de13beaed0 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 11:09:52 +0000 Subject: [PATCH 09/35] skip tests tutorial tests if draw_tree is not installed --- tests/test_tutorials.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_tutorials.py b/tests/test_tutorials.py index 4d7ed8417..d2bc3e2f5 100644 --- a/tests/test_tutorials.py +++ b/tests/test_tutorials.py @@ -13,6 +13,13 @@ from nbclient import NotebookClient # noqa: E402 from nbclient.exceptions import CellExecutionError # noqa: E402 +# Check if draw_tree is available +try: + import draw_tree # noqa: F401 + DRAW_TREE_AVAILABLE = True +except ImportError: + DRAW_TREE_AVAILABLE = False + def _find_tutorial_notebooks(): """Return a sorted list of notebook Paths under doc/tutorials. @@ -55,6 +62,10 @@ def test_execute_notebook(nb_path): if sys.platform == "win32" and "openspiel" in nb_path.name.lower(): pytest.skip("OpenSpiel notebook requires OpenSpiel, which is not available on Windows") + # Skip all notebook tests if draw_tree is not installed + if not DRAW_TREE_AVAILABLE: + pytest.skip("Notebook execution tests require draw_tree package") + nb = nbformat.read(str(nb_path), as_version=4) # Prefer the notebook's kernelspec if provided, otherwise let nbclient pick the default. From ed078b442d14bee2254e62d51fc5867053f74491 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 11:16:52 +0000 Subject: [PATCH 10/35] windows action installs everything except open_spiel --- .github/workflows/python.yml | 2 +- doc/requirements.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 794340dde..2549c9bf4 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -102,7 +102,7 @@ jobs: python -m pip install --upgrade pip pip install setuptools build cython wheel pip install -r tests/requirements.txt - pip install nbformat nbclient ipykernel jupyter matplotlib + pip install -r doc/requirements.txt - name: Build extension run: | python -m pip install -v . diff --git a/doc/requirements.txt b/doc/requirements.txt index b45969a63..4292df0fb 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -9,5 +9,5 @@ ipython matplotlib pickleshare jupyter -open_spiel -draw-tree @ git+https://github.com/gambitproject/draw_tree.git@main +open_spiel; sys_platform != 'win32' +draw-tree @ git+https://github.com/gambitproject/draw_tree.git@main; From ff93d0f452d3f63e30c59ca57387bf9b8da9d31c Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 11:18:10 +0000 Subject: [PATCH 11/35] replace linux action python versions from 3.9 to 3.10 --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 2549c9bf4..e3c006320 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -10,7 +10,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.9', '3.13'] + python-version: ['3.10', '3.13'] steps: - uses: actions/checkout@v5 From 2497bf291f912af5d6409a2b73ae18b0d406ebc5 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 11:24:46 +0000 Subject: [PATCH 12/35] Revert "skip tests tutorial tests if draw_tree is not installed" This reverts commit e3c58d63471f4db2b8679e6ed44644de13beaed0. --- tests/test_tutorials.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/test_tutorials.py b/tests/test_tutorials.py index d2bc3e2f5..4d7ed8417 100644 --- a/tests/test_tutorials.py +++ b/tests/test_tutorials.py @@ -13,13 +13,6 @@ from nbclient import NotebookClient # noqa: E402 from nbclient.exceptions import CellExecutionError # noqa: E402 -# Check if draw_tree is available -try: - import draw_tree # noqa: F401 - DRAW_TREE_AVAILABLE = True -except ImportError: - DRAW_TREE_AVAILABLE = False - def _find_tutorial_notebooks(): """Return a sorted list of notebook Paths under doc/tutorials. @@ -62,10 +55,6 @@ def test_execute_notebook(nb_path): if sys.platform == "win32" and "openspiel" in nb_path.name.lower(): pytest.skip("OpenSpiel notebook requires OpenSpiel, which is not available on Windows") - # Skip all notebook tests if draw_tree is not installed - if not DRAW_TREE_AVAILABLE: - pytest.skip("Notebook execution tests require draw_tree package") - nb = nbformat.read(str(nb_path), as_version=4) # Prefer the notebook's kernelspec if provided, otherwise let nbclient pick the default. From ae9cab1396978f4af59f8a0cc7cad1b4c12ee705 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 11:32:12 +0000 Subject: [PATCH 13/35] add flag for running tutorials with pytest --- tests/conftest.py | 27 +++++++++++++++++++++++++++ tests/test_tutorials.py | 1 + 2 files changed, 28 insertions(+) create mode 100644 tests/conftest.py diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 000000000..4e2b72fbd --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,27 @@ +import pytest + + +def pytest_addoption(parser): + parser.addoption( + "--run-tutorials", + action="store_true", + default=False, + help="Run tutorial notebook tests", + ) + + +def pytest_configure(config): + config.addinivalue_line( + "markers", "tutorials: mark test as a tutorial notebook test" + ) + + +def pytest_collection_modifyitems(config, items): + if config.getoption("--run-tutorials"): + # --run-tutorials given in cli: do not skip tutorial tests + return + + skip_tutorials = pytest.mark.skip(reason="need --run-tutorials option to run") + for item in items: + if "tutorials" in item.keywords: + item.add_marker(skip_tutorials) diff --git a/tests/test_tutorials.py b/tests/test_tutorials.py index 4d7ed8417..85f6decb0 100644 --- a/tests/test_tutorials.py +++ b/tests/test_tutorials.py @@ -39,6 +39,7 @@ def _find_tutorial_notebooks(): _NOTEBOOKS = _find_tutorial_notebooks() +@pytest.mark.tutorials @pytest.mark.parametrize("nb_path", _NOTEBOOKS, ids=[p.name for p in _NOTEBOOKS]) def test_execute_notebook(nb_path): """Execute a single Jupyter notebook and fail if any cell errors occur. From 2f8227bbdd936710bc31fb4aa155ed2c0172edd4 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 11:35:58 +0000 Subject: [PATCH 14/35] add flag to run tutorials with pytest in CI workflows --- .github/workflows/python.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index e3c006320..cac1634b3 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -32,7 +32,7 @@ jobs: cd dist pip install -v pygambit*.tar.gz - name: Run tests - run: pytest + run: pytest --run-tutorials macos-13: runs-on: macos-13 @@ -57,7 +57,7 @@ jobs: run: | python -m pip install -v . - name: Run tests - run: pytest + run: pytest --run-tutorials macos-14: runs-on: macos-14 @@ -82,7 +82,7 @@ jobs: run: | python -m pip install -v . - name: Run tests - run: pytest + run: pytest --run-tutorials windows: runs-on: windows-latest @@ -107,4 +107,4 @@ jobs: run: | python -m pip install -v . - name: Run tests - run: pytest + run: pytest --run-tutorials From 760af77bb31e82b5407f6b022d2a7937c87d1939 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:08:18 +0000 Subject: [PATCH 15/35] update python.yml from #661 --- .github/workflows/python.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 794340dde..cac1634b3 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -10,7 +10,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.9', '3.13'] + python-version: ['3.10', '3.13'] steps: - uses: actions/checkout@v5 @@ -32,7 +32,7 @@ jobs: cd dist pip install -v pygambit*.tar.gz - name: Run tests - run: pytest + run: pytest --run-tutorials macos-13: runs-on: macos-13 @@ -57,7 +57,7 @@ jobs: run: | python -m pip install -v . - name: Run tests - run: pytest + run: pytest --run-tutorials macos-14: runs-on: macos-14 @@ -82,7 +82,7 @@ jobs: run: | python -m pip install -v . - name: Run tests - run: pytest + run: pytest --run-tutorials windows: runs-on: windows-latest @@ -102,9 +102,9 @@ jobs: python -m pip install --upgrade pip pip install setuptools build cython wheel pip install -r tests/requirements.txt - pip install nbformat nbclient ipykernel jupyter matplotlib + pip install -r doc/requirements.txt - name: Build extension run: | python -m pip install -v . - name: Run tests - run: pytest + run: pytest --run-tutorials From 8975f5bbc87987888f0d371ba0886d3a671eca26 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:09:37 +0000 Subject: [PATCH 16/35] ingore open_spiel on windows --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 606f56fbd..1bb9e99fa 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -9,4 +9,4 @@ ipython matplotlib pickleshare jupyter -open_spiel +open_spiel; sys_platform != 'win32' From 30946af3a405d297e1a126611906aa5028cc3772 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:10:24 +0000 Subject: [PATCH 17/35] add conftest.py from #661 --- tests/conftest.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/conftest.py diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 000000000..4e2b72fbd --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,27 @@ +import pytest + + +def pytest_addoption(parser): + parser.addoption( + "--run-tutorials", + action="store_true", + default=False, + help="Run tutorial notebook tests", + ) + + +def pytest_configure(config): + config.addinivalue_line( + "markers", "tutorials: mark test as a tutorial notebook test" + ) + + +def pytest_collection_modifyitems(config, items): + if config.getoption("--run-tutorials"): + # --run-tutorials given in cli: do not skip tutorial tests + return + + skip_tutorials = pytest.mark.skip(reason="need --run-tutorials option to run") + for item in items: + if "tutorials" in item.keywords: + item.add_marker(skip_tutorials) From cb62b40042d8ac58ac76250b882ec4062f3489fd Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:12:17 +0000 Subject: [PATCH 18/35] Add pytest marker for tutorial notebooks in test_execute_notebook --- tests/test_tutorials.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_tutorials.py b/tests/test_tutorials.py index 4d7ed8417..85f6decb0 100644 --- a/tests/test_tutorials.py +++ b/tests/test_tutorials.py @@ -39,6 +39,7 @@ def _find_tutorial_notebooks(): _NOTEBOOKS = _find_tutorial_notebooks() +@pytest.mark.tutorials @pytest.mark.parametrize("nb_path", _NOTEBOOKS, ids=[p.name for p in _NOTEBOOKS]) def test_execute_notebook(nb_path): """Execute a single Jupyter notebook and fail if any cell errors occur. From 867444199f21a434108d6b58d2c683b527109d4c Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:16:44 +0000 Subject: [PATCH 19/35] Update Python version in CI workflow from. 3.13 to 3.14 --- .github/workflows/python.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index cac1634b3..70d37664b 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -10,7 +10,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.10', '3.13'] + python-version: ['3.10', '3.14'] steps: - uses: actions/checkout@v5 @@ -39,7 +39,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.13'] + python-version: ['3.14'] steps: - uses: actions/checkout@v4 @@ -64,7 +64,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.13'] + python-version: ['3.14'] steps: - uses: actions/checkout@v4 @@ -89,7 +89,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.13'] + python-version: ['3.14'] steps: - uses: actions/checkout@v5 From 28f38608b920589485ee1cd520fec64ddba7e9a0 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:26:36 +0000 Subject: [PATCH 20/35] Don't skip tutorial tests if that file is explicitly run --- tests/conftest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 4e2b72fbd..ecb80f01e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -21,6 +21,12 @@ def pytest_collection_modifyitems(config, items): # --run-tutorials given in cli: do not skip tutorial tests return + # Check if test_tutorials.py was explicitly specified + args = config.invocation_params.args + if any("test_tutorials.py" in str(arg) for arg in args): + # test_tutorials.py explicitly run: do not skip + return + skip_tutorials = pytest.mark.skip(reason="need --run-tutorials option to run") for item in items: if "tutorials" in item.keywords: From ae9d5a092899917fff9ea648e7121043d7d0da4d Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:30:20 +0000 Subject: [PATCH 21/35] exclude tutorials from pytest for specifically macos13 with python 3.14 since open_spiel does not build correctly --- .github/workflows/python.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 70d37664b..199dce7ca 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -52,12 +52,11 @@ jobs: python -m pip install --upgrade pip pip install setuptools build cython wheel pip install -r tests/requirements.txt - pip install -r doc/requirements.txt - name: Build extension run: | python -m pip install -v . - name: Run tests - run: pytest --run-tutorials + run: pytest macos-14: runs-on: macos-14 From 0cee463cb552a9d36f9ac3a1a7a92a9941da1b4b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:46:32 +0000 Subject: [PATCH 22/35] Add instructions for running tutorial notebook tests with pytest --- doc/developer.contributing.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/developer.contributing.rst b/doc/developer.contributing.rst index 43d4a4826..ce4f809c0 100644 --- a/doc/developer.contributing.rst +++ b/doc/developer.contributing.rst @@ -99,6 +99,11 @@ You can also run the tests locally before submitting your pull request, using `p pytest +3. [Optional] If you wish to run the tutorial notebook tests, you will need to add the ``--run-tutorials`` flag, which require the `doc` dependencies: :: + + pip install -r doc/requirements.txt + pytest --run-tutorials + Adding to the test suite ^^^^^^^^^^^^^^^^^^^^^^^^ From d7c402f270f0494c6eacc336f6af2bf12ae91aeb Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:49:42 +0000 Subject: [PATCH 23/35] Update Python version requirement from >=3.9 to >=3.10 in pyproject.toml --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fb4f80b43..914ba77c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "pygambit" version = "16.4.0" description = "The package for computation in game theory" readme = "src/README.rst" -requires-python = ">=3.9" +requires-python = ">=3.10" license = "GPL-2.0-or-later" authors = [ {name = "Theodore Turocy", email = "ted.turocy@gmail.com"}, @@ -17,7 +17,6 @@ keywords = ["game theory", "Nash equilibrium"] classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", From 3504b7711e6c35d03f5f6ea4c9ef41fa2c9e1df0 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:51:20 +0000 Subject: [PATCH 24/35] Add Python 3.14 to the list of supported programming languages in classifiers --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 914ba77c7..a58c8ba72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ classifiers=[ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering :: Mathematics" ] From 146b99d6db500e3536d3a4fcfd11066986641e77 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 16:26:00 +0000 Subject: [PATCH 25/35] fix merge mistake --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index ce93caf8e..199dce7ca 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -56,7 +56,7 @@ jobs: run: | python -m pip install -v . - name: Run tests - run: pytest --run-tutorials + run: pytest macos-14: runs-on: macos-14 From 8828fa0eda31c05f0d26ebe46c11fd3fcfe4a3a0 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 16:41:11 +0000 Subject: [PATCH 26/35] force readthedocs to reinstall draw-tree from latest main branch since this is in active development --- .readthedocs.yml | 10 +++++----- doc/requirements.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 8fbb940b9..7b6db4a5d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -13,9 +13,9 @@ build: - libgmp-dev - pandoc - texlive-full + commands: + - pip install --upgrade --force-reinstall "draw-tree @ git+https://github.com/gambitproject/draw_tree.git@main#egg=draw-tree" + - pip install -r doc/requirements.txt + - pip install . -python: - install: - - requirements: doc/requirements.txt - - method: setuptools - path: "." +python: {} diff --git a/doc/requirements.txt b/doc/requirements.txt index 4292df0fb..1ee17027a 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -10,4 +10,4 @@ matplotlib pickleshare jupyter open_spiel; sys_platform != 'win32' -draw-tree @ git+https://github.com/gambitproject/draw_tree.git@main; +draw-tree @ git+https://github.com/gambitproject/draw_tree.git@main#egg=draw-tree From 444a30e4fa0ab7d7e7b76014b37d0a9226c447af Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 16:41:25 +0000 Subject: [PATCH 27/35] Update Python version in ReadTheDocs configuration to 3.14 --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 7b6db4a5d..d3938a173 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -8,7 +8,7 @@ formats: all build: os: ubuntu-22.04 tools: - python: "3.13" + python: "3.14" apt_packages: - libgmp-dev - pandoc From 743d0d1bb268c41f9599cb48079c4d45cdb4782b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 16:52:24 +0000 Subject: [PATCH 28/35] try again with force reinstall of draw_tree --- .readthedocs.yml | 14 +++++++++----- doc/requirements.txt | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index d3938a173..fcadc4f98 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -13,9 +13,13 @@ build: - libgmp-dev - pandoc - texlive-full - commands: - - pip install --upgrade --force-reinstall "draw-tree @ git+https://github.com/gambitproject/draw_tree.git@main#egg=draw-tree" - - pip install -r doc/requirements.txt - - pip install . + jobs: + pre_install: + - pip install --upgrade --force-reinstall "draw_tree @ git+https://github.com/gambitproject/draw_tree.git@main#egg=draw_tree" -python: {} +python: + install: + - requirements: doc/requirements.txt + - method: pip + path: "." + system_packages: true diff --git a/doc/requirements.txt b/doc/requirements.txt index 1ee17027a..7a104298f 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -10,4 +10,4 @@ matplotlib pickleshare jupyter open_spiel; sys_platform != 'win32' -draw-tree @ git+https://github.com/gambitproject/draw_tree.git@main#egg=draw-tree +draw_tree @ git+https://github.com/gambitproject/draw_tree.git@main#egg=draw_tree From 98d8800a0204496676ad62c860639c2ef1dde8a9 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 16:54:05 +0000 Subject: [PATCH 29/35] revert superfluous changes --- .readthedocs.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index fcadc4f98..c425f87df 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -20,6 +20,5 @@ build: python: install: - requirements: doc/requirements.txt - - method: pip + - method: setuptools path: "." - system_packages: true From a57fdc75d200b010913f240eddd37ca5df57907c Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 17:09:38 +0000 Subject: [PATCH 30/35] remobe draw_tree force install which didn't work as expected --- .readthedocs.yml | 3 --- doc/requirements.txt | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index c425f87df..73522dfdf 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -13,9 +13,6 @@ build: - libgmp-dev - pandoc - texlive-full - jobs: - pre_install: - - pip install --upgrade --force-reinstall "draw_tree @ git+https://github.com/gambitproject/draw_tree.git@main#egg=draw_tree" python: install: diff --git a/doc/requirements.txt b/doc/requirements.txt index 7a104298f..4292df0fb 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -10,4 +10,4 @@ matplotlib pickleshare jupyter open_spiel; sys_platform != 'win32' -draw_tree @ git+https://github.com/gambitproject/draw_tree.git@main#egg=draw_tree +draw-tree @ git+https://github.com/gambitproject/draw_tree.git@main; From 9b71aa720e43ffe719fac21b7b7e97768d95ba4f Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 17:18:33 +0000 Subject: [PATCH 31/35] try specifying draw_tree version --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 4292df0fb..6a607eff8 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -10,4 +10,4 @@ matplotlib pickleshare jupyter open_spiel; sys_platform != 'win32' -draw-tree @ git+https://github.com/gambitproject/draw_tree.git@main; +draw-tree @ git+https://github.com/gambitproject/draw_tree.git@v0.1.1 From 8b9307fa4cde0c5135c66059279824af421a545f Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 17:19:17 +0000 Subject: [PATCH 32/35] fix: correct draw_tree naming in requirements.txt and specify version --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 6a607eff8..2fce79ab1 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -10,4 +10,4 @@ matplotlib pickleshare jupyter open_spiel; sys_platform != 'win32' -draw-tree @ git+https://github.com/gambitproject/draw_tree.git@v0.1.1 +draw_tree @ git+https://github.com/gambitproject/draw_tree.git@v0.1.1 From ba672e8d3437f7fc049d62b147282b335a685fb1 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 17:21:36 +0000 Subject: [PATCH 33/35] Revert "fix: correct draw_tree naming in requirements.txt and specify version" This reverts commit 8b9307fa4cde0c5135c66059279824af421a545f. --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 2fce79ab1..6a607eff8 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -10,4 +10,4 @@ matplotlib pickleshare jupyter open_spiel; sys_platform != 'win32' -draw_tree @ git+https://github.com/gambitproject/draw_tree.git@v0.1.1 +draw-tree @ git+https://github.com/gambitproject/draw_tree.git@v0.1.1 From d7b5abefaad09035945c609ae60fb4a097a854a9 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 8 Dec 2025 09:52:45 +0000 Subject: [PATCH 34/35] set draw_tree version to 0.2.0 which is an actual release --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 6a607eff8..2daeedc58 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -10,4 +10,4 @@ matplotlib pickleshare jupyter open_spiel; sys_platform != 'win32' -draw-tree @ git+https://github.com/gambitproject/draw_tree.git@v0.1.1 +draw-tree @ git+https://github.com/gambitproject/draw_tree.git@v0.2.0 From 08ffd7d30856db98b1f8ad5d531f01bd7cbe2aa7 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 8 Dec 2025 10:47:04 +0000 Subject: [PATCH 35/35] resave notebook outputs --- doc/tutorials/02_extensive_form.ipynb | 639 +++++++++-------- doc/tutorials/03_stripped_down_poker.ipynb | 764 ++++++++++----------- 2 files changed, 733 insertions(+), 670 deletions(-) diff --git a/doc/tutorials/02_extensive_form.ipynb b/doc/tutorials/02_extensive_form.ipynb index a15fd7e42..528970c61 100644 --- a/doc/tutorials/02_extensive_form.ipynb +++ b/doc/tutorials/02_extensive_form.ipynb @@ -89,10 +89,10 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "" ], @@ -142,110 +142,119 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "" ], @@ -293,7 +302,7 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", @@ -355,98 +364,119 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "" ], "text/plain": [ @@ -499,146 +529,157 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "" ], "text/plain": [ @@ -687,160 +728,171 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "" ], "text/plain": [ @@ -889,168 +941,179 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "" ], "text/plain": [ diff --git a/doc/tutorials/03_stripped_down_poker.ipynb b/doc/tutorials/03_stripped_down_poker.ipynb index 0adbc3f16..16507d6ec 100644 --- a/doc/tutorials/03_stripped_down_poker.ipynb +++ b/doc/tutorials/03_stripped_down_poker.ipynb @@ -137,136 +137,146 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], @@ -321,23 +331,23 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -407,181 +417,191 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "" ], @@ -639,7 +659,7 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", @@ -740,246 +760,226 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", + "\n", "\n", - "\n", + "\n", "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "" ], "text/plain": [ @@ -1060,23 +1060,23 @@ { "data": { "image/svg+xml": [ - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1170,222 +1170,222 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "" ], "text/plain": [ @@ -2298,8 +2298,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 9.25 ms, sys: 159 μs, total: 9.41 ms\n", - "Wall time: 9.44 ms\n" + "CPU times: user 8.72 ms, sys: 143 μs, total: 8.86 ms\n", + "Wall time: 8.85 ms\n" ] }, { @@ -2328,8 +2328,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 17.1 ms, sys: 169 μs, total: 17.3 ms\n", - "Wall time: 17.3 ms\n" + "CPU times: user 16.7 ms, sys: 234 μs, total: 17 ms\n", + "Wall time: 17 ms\n" ] }, {