Commit
·
e07f25a
1
Parent(s):
33f6af9
fixes.
Browse files- minimal_circuit.ipynb +8 -187
minimal_circuit.ipynb
CHANGED
|
@@ -2,160 +2,10 @@
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
-
"execution_count":
|
| 6 |
-
"id": "77475e0f-0b3d-42cf-a40b-6b125953d530",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [
|
| 9 |
-
{
|
| 10 |
-
"name": "stdout",
|
| 11 |
-
"output_type": "stream",
|
| 12 |
-
"text": [
|
| 13 |
-
"Collecting pygraphviz\n",
|
| 14 |
-
" Downloading pygraphviz-1.14.tar.gz (106 kB)\n",
|
| 15 |
-
" Installing build dependencies ... \u001b[?25ldone\n",
|
| 16 |
-
"\u001b[?25h Getting requirements to build wheel ... \u001b[?25ldone\n",
|
| 17 |
-
"\u001b[?25h Preparing metadata (pyproject.toml) ... \u001b[?25ldone\n",
|
| 18 |
-
"\u001b[?25hBuilding wheels for collected packages: pygraphviz\n",
|
| 19 |
-
" Building wheel for pygraphviz (pyproject.toml) ... \u001b[?25lerror\n",
|
| 20 |
-
" \u001b[1;31merror\u001b[0m: \u001b[1msubprocess-exited-with-error\u001b[0m\n",
|
| 21 |
-
" \n",
|
| 22 |
-
" \u001b[31m×\u001b[0m \u001b[32mBuilding wheel for pygraphviz \u001b[0m\u001b[1;32m(\u001b[0m\u001b[32mpyproject.toml\u001b[0m\u001b[1;32m)\u001b[0m did not run successfully.\n",
|
| 23 |
-
" \u001b[31m│\u001b[0m exit code: \u001b[1;36m1\u001b[0m\n",
|
| 24 |
-
" \u001b[31m╰─>\u001b[0m \u001b[31m[100 lines of output]\u001b[0m\n",
|
| 25 |
-
" \u001b[31m \u001b[0m /private/var/folders/kp/c2tk72bs6r35ywcw4_t7cghm0000gn/T/pip-build-env-kibi2t3p/overlay/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated\n",
|
| 26 |
-
" \u001b[31m \u001b[0m !!\n",
|
| 27 |
-
" \u001b[31m \u001b[0m \n",
|
| 28 |
-
" \u001b[31m \u001b[0m ********************************************************************************\n",
|
| 29 |
-
" \u001b[31m \u001b[0m Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).\n",
|
| 30 |
-
" \u001b[31m \u001b[0m \n",
|
| 31 |
-
" \u001b[31m \u001b[0m By 2026-Feb-18, you need to update your project and remove deprecated calls\n",
|
| 32 |
-
" \u001b[31m \u001b[0m or your builds will no longer be supported.\n",
|
| 33 |
-
" \u001b[31m \u001b[0m \n",
|
| 34 |
-
" \u001b[31m \u001b[0m See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.\n",
|
| 35 |
-
" \u001b[31m \u001b[0m ********************************************************************************\n",
|
| 36 |
-
" \u001b[31m \u001b[0m \n",
|
| 37 |
-
" \u001b[31m \u001b[0m !!\n",
|
| 38 |
-
" \u001b[31m \u001b[0m corresp(dist, value, root_dir)\n",
|
| 39 |
-
" \u001b[31m \u001b[0m /private/var/folders/kp/c2tk72bs6r35ywcw4_t7cghm0000gn/T/pip-build-env-kibi2t3p/overlay/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated.\n",
|
| 40 |
-
" \u001b[31m \u001b[0m !!\n",
|
| 41 |
-
" \u001b[31m \u001b[0m \n",
|
| 42 |
-
" \u001b[31m \u001b[0m ********************************************************************************\n",
|
| 43 |
-
" \u001b[31m \u001b[0m Please consider removing the following classifiers in favor of a SPDX license expression:\n",
|
| 44 |
-
" \u001b[31m \u001b[0m \n",
|
| 45 |
-
" \u001b[31m \u001b[0m License :: OSI Approved :: BSD License\n",
|
| 46 |
-
" \u001b[31m \u001b[0m \n",
|
| 47 |
-
" \u001b[31m \u001b[0m See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.\n",
|
| 48 |
-
" \u001b[31m \u001b[0m ********************************************************************************\n",
|
| 49 |
-
" \u001b[31m \u001b[0m \n",
|
| 50 |
-
" \u001b[31m \u001b[0m !!\n",
|
| 51 |
-
" \u001b[31m \u001b[0m dist._finalize_license_expression()\n",
|
| 52 |
-
" \u001b[31m \u001b[0m /private/var/folders/kp/c2tk72bs6r35ywcw4_t7cghm0000gn/T/pip-build-env-kibi2t3p/overlay/lib/python3.11/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.\n",
|
| 53 |
-
" \u001b[31m \u001b[0m !!\n",
|
| 54 |
-
" \u001b[31m \u001b[0m \n",
|
| 55 |
-
" \u001b[31m \u001b[0m ********************************************************************************\n",
|
| 56 |
-
" \u001b[31m \u001b[0m Please consider removing the following classifiers in favor of a SPDX license expression:\n",
|
| 57 |
-
" \u001b[31m \u001b[0m \n",
|
| 58 |
-
" \u001b[31m \u001b[0m License :: OSI Approved :: BSD License\n",
|
| 59 |
-
" \u001b[31m \u001b[0m \n",
|
| 60 |
-
" \u001b[31m \u001b[0m See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.\n",
|
| 61 |
-
" \u001b[31m \u001b[0m ********************************************************************************\n",
|
| 62 |
-
" \u001b[31m \u001b[0m \n",
|
| 63 |
-
" \u001b[31m \u001b[0m !!\n",
|
| 64 |
-
" \u001b[31m \u001b[0m self._finalize_license_expression()\n",
|
| 65 |
-
" \u001b[31m \u001b[0m running bdist_wheel\n",
|
| 66 |
-
" \u001b[31m \u001b[0m running build\n",
|
| 67 |
-
" \u001b[31m \u001b[0m running build_py\n",
|
| 68 |
-
" \u001b[31m \u001b[0m creating build/lib.macosx-15.7-arm64-cpython-311/pygraphviz\n",
|
| 69 |
-
" \u001b[31m \u001b[0m copying pygraphviz/scraper.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz\n",
|
| 70 |
-
" \u001b[31m \u001b[0m copying pygraphviz/graphviz.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz\n",
|
| 71 |
-
" \u001b[31m \u001b[0m copying pygraphviz/__init__.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz\n",
|
| 72 |
-
" \u001b[31m \u001b[0m copying pygraphviz/agraph.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz\n",
|
| 73 |
-
" \u001b[31m \u001b[0m copying pygraphviz/testing.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz\n",
|
| 74 |
-
" \u001b[31m \u001b[0m creating build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 75 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_unicode.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 76 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_scraper.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 77 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_readwrite.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 78 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_string.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 79 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/__init__.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 80 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_html.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 81 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_node_attributes.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 82 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_drawing.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 83 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_repr_mimebundle.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 84 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_subgraph.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 85 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_close.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 86 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_edge_attributes.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 87 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_clear.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 88 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_layout.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 89 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_attribute_defaults.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 90 |
-
" \u001b[31m \u001b[0m copying pygraphviz/tests/test_graph.py -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz/tests\n",
|
| 91 |
-
" \u001b[31m \u001b[0m running egg_info\n",
|
| 92 |
-
" \u001b[31m \u001b[0m writing pygraphviz.egg-info/PKG-INFO\n",
|
| 93 |
-
" \u001b[31m \u001b[0m writing dependency_links to pygraphviz.egg-info/dependency_links.txt\n",
|
| 94 |
-
" \u001b[31m \u001b[0m writing top-level names to pygraphviz.egg-info/top_level.txt\n",
|
| 95 |
-
" \u001b[31m \u001b[0m reading manifest file 'pygraphviz.egg-info/SOURCES.txt'\n",
|
| 96 |
-
" \u001b[31m \u001b[0m reading manifest template 'MANIFEST.in'\n",
|
| 97 |
-
" \u001b[31m \u001b[0m warning: no files found matching '*.swg'\n",
|
| 98 |
-
" \u001b[31m \u001b[0m warning: no files found matching '*.png' under directory 'doc'\n",
|
| 99 |
-
" \u001b[31m \u001b[0m warning: no files found matching '*.html' under directory 'doc'\n",
|
| 100 |
-
" \u001b[31m \u001b[0m warning: no files found matching '*.txt' under directory 'doc'\n",
|
| 101 |
-
" \u001b[31m \u001b[0m warning: no files found matching '*.css' under directory 'doc'\n",
|
| 102 |
-
" \u001b[31m \u001b[0m warning: no previously-included files matching '*~' found anywhere in distribution\n",
|
| 103 |
-
" \u001b[31m \u001b[0m warning: no previously-included files matching '*.pyc' found anywhere in distribution\n",
|
| 104 |
-
" \u001b[31m \u001b[0m warning: no previously-included files matching '.svn' found anywhere in distribution\n",
|
| 105 |
-
" \u001b[31m \u001b[0m no previously-included directories found matching 'doc/build'\n",
|
| 106 |
-
" \u001b[31m \u001b[0m adding license file 'LICENSE'\n",
|
| 107 |
-
" \u001b[31m \u001b[0m writing manifest file 'pygraphviz.egg-info/SOURCES.txt'\n",
|
| 108 |
-
" \u001b[31m \u001b[0m copying pygraphviz/graphviz.i -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz\n",
|
| 109 |
-
" \u001b[31m \u001b[0m copying pygraphviz/graphviz_wrap.c -> build/lib.macosx-15.7-arm64-cpython-311/pygraphviz\n",
|
| 110 |
-
" \u001b[31m \u001b[0m running build_ext\n",
|
| 111 |
-
" \u001b[31m \u001b[0m building 'pygraphviz._graphviz' extension\n",
|
| 112 |
-
" \u001b[31m \u001b[0m creating build/temp.macosx-15.7-arm64-cpython-311/pygraphviz\n",
|
| 113 |
-
" \u001b[31m \u001b[0m clang -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -DSWIG_PYTHON_STRICT_BYTE_CHAR -I/Users/amirabdullah/work/venvs/pypsl/include -I/Users/amirabdullah/.pyenv/versions/3.11.9/include/python3.11 -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-15.7-arm64-cpython-311/pygraphviz/graphviz_wrap.o\n",
|
| 114 |
-
" \u001b[31m \u001b[0m pygraphviz/graphviz_wrap.c:9:9: warning: 'SWIG_PYTHON_STRICT_BYTE_CHAR' macro redefined [-Wmacro-redefined]\n",
|
| 115 |
-
" \u001b[31m \u001b[0m 9 | #define SWIG_PYTHON_STRICT_BYTE_CHAR\n",
|
| 116 |
-
" \u001b[31m \u001b[0m | ^\n",
|
| 117 |
-
" \u001b[31m \u001b[0m <command line>:2:9: note: previous definition is here\n",
|
| 118 |
-
" \u001b[31m \u001b[0m 2 | #define SWIG_PYTHON_STRICT_BYTE_CHAR 1\n",
|
| 119 |
-
" \u001b[31m \u001b[0m | ^\n",
|
| 120 |
-
" \u001b[31m \u001b[0m pygraphviz/graphviz_wrap.c:3023:10: fatal error: 'graphviz/cgraph.h' file not found\n",
|
| 121 |
-
" \u001b[31m \u001b[0m 3023 | #include \"graphviz/cgraph.h\"\n",
|
| 122 |
-
" \u001b[31m \u001b[0m | ^~~~~~~~~~~~~~~~~~~\n",
|
| 123 |
-
" \u001b[31m \u001b[0m 1 warning and 1 error generated.\n",
|
| 124 |
-
" \u001b[31m \u001b[0m error: command '/usr/bin/clang' failed with exit code 1\n",
|
| 125 |
-
" \u001b[31m \u001b[0m \u001b[31m[end of output]\u001b[0m\n",
|
| 126 |
-
" \n",
|
| 127 |
-
" \u001b[1;35mnote\u001b[0m: This error originates from a subprocess, and is likely not a problem with pip.\n",
|
| 128 |
-
"\u001b[31m ERROR: Failed building wheel for pygraphviz\u001b[0m\u001b[31m\n",
|
| 129 |
-
"\u001b[0m\u001b[?25hFailed to build pygraphviz\n",
|
| 130 |
-
"\u001b[1;31merror\u001b[0m: \u001b[1mfailed-wheel-build-for-install\u001b[0m\n",
|
| 131 |
-
"\n",
|
| 132 |
-
"\u001b[31m×\u001b[0m Failed to build installable wheels for some pyproject.toml based projects\n",
|
| 133 |
-
"\u001b[31m╰─>\u001b[0m pygraphviz\n"
|
| 134 |
-
]
|
| 135 |
-
}
|
| 136 |
-
],
|
| 137 |
-
"source": [
|
| 138 |
-
"! pip install pygraphviz"
|
| 139 |
-
]
|
| 140 |
-
},
|
| 141 |
-
{
|
| 142 |
-
"cell_type": "code",
|
| 143 |
-
"execution_count": 9,
|
| 144 |
"id": "db010876-5707-438e-95db-0e74f1d7846a",
|
| 145 |
"metadata": {},
|
| 146 |
-
"outputs": [
|
| 147 |
-
{
|
| 148 |
-
"ename": "ModuleNotFoundError",
|
| 149 |
-
"evalue": "No module named 'pygraphviz'",
|
| 150 |
-
"output_type": "error",
|
| 151 |
-
"traceback": [
|
| 152 |
-
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
|
| 153 |
-
"\u001b[31mModuleNotFoundError\u001b[39m Traceback (most recent call last)",
|
| 154 |
-
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[9]\u001b[39m\u001b[32m, line 4\u001b[39m\n\u001b[32m 2\u001b[39m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mpandas\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mas\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mpd\u001b[39;00m\n\u001b[32m 3\u001b[39m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mpslpython\u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m4\u001b[39m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mpygraphviz\u001b[39;00m\n",
|
| 155 |
-
"\u001b[31mModuleNotFoundError\u001b[39m: No module named 'pygraphviz'"
|
| 156 |
-
]
|
| 157 |
-
}
|
| 158 |
-
],
|
| 159 |
"source": [
|
| 160 |
"import os\n",
|
| 161 |
"import pandas as pd\n",
|
|
@@ -173,7 +23,7 @@
|
|
| 173 |
},
|
| 174 |
{
|
| 175 |
"cell_type": "code",
|
| 176 |
-
"execution_count":
|
| 177 |
"id": "2d7fa249-3f00-45ea-97c8-a38d783fded8",
|
| 178 |
"metadata": {},
|
| 179 |
"outputs": [],
|
|
@@ -412,56 +262,27 @@
|
|
| 412 |
},
|
| 413 |
{
|
| 414 |
"cell_type": "code",
|
| 415 |
-
"execution_count":
|
| 416 |
"id": "15b37880-683f-4548-ba61-a0c82cb767b6",
|
| 417 |
"metadata": {},
|
| 418 |
-
"outputs": [
|
| 419 |
-
{
|
| 420 |
-
"name": "stdout",
|
| 421 |
-
"output_type": "stream",
|
| 422 |
-
"text": [
|
| 423 |
-
"13773 [main] INFO org.linqs.psl.runtime.Runtime - PSL Runtime Version 2.4.0-aad67da\n",
|
| 424 |
-
"13791 [main] INFO org.linqs.psl.application.inference.InferenceApplication - Grounding out model.\n",
|
| 425 |
-
"13793 [main] INFO org.linqs.psl.application.inference.InferenceApplication - Grounding complete.\n",
|
| 426 |
-
"13794 [main] INFO org.linqs.psl.application.inference.InferenceApplication - Loading deep predicates.\n",
|
| 427 |
-
"13794 [main] INFO org.linqs.psl.application.inference.InferenceApplication - Beginning inference.\n",
|
| 428 |
-
"13850 [main] INFO org.linqs.psl.reasoner.Reasoner - Final Objective: 0.0, Violated Constraints: 0, Total Optimization Time: 56, Total Number of Iterations: 25001\n",
|
| 429 |
-
"13850 [main] INFO org.linqs.psl.application.inference.InferenceApplication - Inference complete.\n",
|
| 430 |
-
"13850 [main] INFO org.linqs.psl.application.inference.InferenceApplication - Writing results to Database.\n",
|
| 431 |
-
"13850 [main] INFO org.linqs.psl.application.inference.InferenceApplication - Results committed to database.\n"
|
| 432 |
-
]
|
| 433 |
-
}
|
| 434 |
-
],
|
| 435 |
"source": [
|
| 436 |
"model = build_model()"
|
| 437 |
]
|
| 438 |
},
|
| 439 |
{
|
| 440 |
"cell_type": "code",
|
| 441 |
-
"execution_count":
|
| 442 |
"id": "aa4b8816-cfa9-4a3e-afbd-b1fc12771e02",
|
| 443 |
"metadata": {},
|
| 444 |
-
"outputs": [
|
| 445 |
-
{
|
| 446 |
-
"ename": "ModuleNotFoundError",
|
| 447 |
-
"evalue": "No module named 'pygraphviz'",
|
| 448 |
-
"output_type": "error",
|
| 449 |
-
"traceback": [
|
| 450 |
-
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
|
| 451 |
-
"\u001b[31mModuleNotFoundError\u001b[39m Traceback (most recent call last)",
|
| 452 |
-
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[8]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[43mrules_to_graph\u001b[49m\u001b[43m(\u001b[49m\u001b[43mRULES\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[43m=\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mcircuit_min_rules.png\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
|
| 453 |
-
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[6]\u001b[39m\u001b[32m, line 187\u001b[39m, in \u001b[36mrules_to_graph\u001b[39m\u001b[34m(rules, path)\u001b[39m\n\u001b[32m 178\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mrules_to_graph\u001b[39m(rules=RULES, path: \u001b[38;5;28mstr\u001b[39m = \u001b[33m\"\u001b[39m\u001b[33mrules_graph.png\u001b[39m\u001b[33m\"\u001b[39m):\n\u001b[32m 179\u001b[39m \u001b[38;5;250m \u001b[39m\u001b[33;03m\"\"\"\u001b[39;00m\n\u001b[32m 180\u001b[39m \u001b[33;03m Build a pygraphviz AGraph from RULES.\u001b[39;00m\n\u001b[32m 181\u001b[39m \u001b[33;03m Edge coloring encodes head polarity:\u001b[39;00m\n\u001b[32m (...)\u001b[39m\u001b[32m 185\u001b[39m \u001b[33;03m Edge label shows the rule name and weight.\u001b[39;00m\n\u001b[32m 186\u001b[39m \u001b[33;03m \"\"\"\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m187\u001b[39m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mpygraphviz\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mas\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mpgv\u001b[39;00m\n\u001b[32m 188\u001b[39m G = pgv.AGraph(strict=\u001b[38;5;28;01mFalse\u001b[39;00m, directed=\u001b[38;5;28;01mTrue\u001b[39;00m, rankdir=\u001b[33m\"\u001b[39m\u001b[33mLR\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m 189\u001b[39m G.node_attr.update(shape=\u001b[33m\"\u001b[39m\u001b[33mbox\u001b[39m\u001b[33m\"\u001b[39m, style=\u001b[33m\"\u001b[39m\u001b[33mrounded,filled\u001b[39m\u001b[33m\"\u001b[39m, fillcolor=\u001b[33m\"\u001b[39m\u001b[33m#f8f8f8\u001b[39m\u001b[33m\"\u001b[39m, fontname=\u001b[33m\"\u001b[39m\u001b[33mHelvetica\u001b[39m\u001b[33m\"\u001b[39m)\n",
|
| 454 |
-
"\u001b[31mModuleNotFoundError\u001b[39m: No module named 'pygraphviz'"
|
| 455 |
-
]
|
| 456 |
-
}
|
| 457 |
-
],
|
| 458 |
"source": [
|
| 459 |
"rules_to_graph(RULES, path=\"circuit_min_rules.png\")"
|
| 460 |
]
|
| 461 |
},
|
| 462 |
{
|
| 463 |
"cell_type": "code",
|
| 464 |
-
"execution_count":
|
| 465 |
"id": "83be8df7-93c5-4634-b3b4-d27dd6feed6d",
|
| 466 |
"metadata": {},
|
| 467 |
"outputs": [],
|
|
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
+
"execution_count": null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
"id": "db010876-5707-438e-95db-0e74f1d7846a",
|
| 7 |
"metadata": {},
|
| 8 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
"source": [
|
| 10 |
"import os\n",
|
| 11 |
"import pandas as pd\n",
|
|
|
|
| 23 |
},
|
| 24 |
{
|
| 25 |
"cell_type": "code",
|
| 26 |
+
"execution_count": null,
|
| 27 |
"id": "2d7fa249-3f00-45ea-97c8-a38d783fded8",
|
| 28 |
"metadata": {},
|
| 29 |
"outputs": [],
|
|
|
|
| 262 |
},
|
| 263 |
{
|
| 264 |
"cell_type": "code",
|
| 265 |
+
"execution_count": null,
|
| 266 |
"id": "15b37880-683f-4548-ba61-a0c82cb767b6",
|
| 267 |
"metadata": {},
|
| 268 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
"source": [
|
| 270 |
"model = build_model()"
|
| 271 |
]
|
| 272 |
},
|
| 273 |
{
|
| 274 |
"cell_type": "code",
|
| 275 |
+
"execution_count": null,
|
| 276 |
"id": "aa4b8816-cfa9-4a3e-afbd-b1fc12771e02",
|
| 277 |
"metadata": {},
|
| 278 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 279 |
"source": [
|
| 280 |
"rules_to_graph(RULES, path=\"circuit_min_rules.png\")"
|
| 281 |
]
|
| 282 |
},
|
| 283 |
{
|
| 284 |
"cell_type": "code",
|
| 285 |
+
"execution_count": null,
|
| 286 |
"id": "83be8df7-93c5-4634-b3b4-d27dd6feed6d",
|
| 287 |
"metadata": {},
|
| 288 |
"outputs": [],
|