diff --git a/dist/cadCAD-0.1-py3-none-any.whl b/dist/cadCAD-0.1-py3-none-any.whl index dce3979..ce14615 100644 Binary files a/dist/cadCAD-0.1-py3-none-any.whl and b/dist/cadCAD-0.1-py3-none-any.whl differ diff --git a/simulations/example_run.ipynb b/simulations/example_run.ipynb index 56490a8..5ee5c2b 100644 --- a/simulations/example_run.ipynb +++ b/simulations/example_run.ipynb @@ -28,32 +28,46 @@ "text": [ "\n", "config[0]\n", - "single_proc: []\n", + "single_proc: []\n", " run s1 s2 s3 s4 substep timestep\n", "0 1 0 0 1 1 0 0\n", - "1 1 1 4 5 1.178862847343031816649272514 1 1\n", - "2 1 ab 6 5 1.178862847343031816649272514 2 1\n", - "3 1 [c, d] [30, 300] 5 1.178862847343031816649272514 3 1\n", - "4 1 1 4 5 1.230321371869816411424320371 1 2\n", + "1 1 1 4 5 10 1 1\n", + "2 1 ab 6 5 10 2 1\n", + "3 1 [c, d] [30, 300] 5 10 3 1\n", + "4 1 1 4 5 10.43650985051199020503531756 1 2\n", "\n", "config[1]\n", - "single_proc: []\n", - " run s1 s2 s3 \\\n", - "0 1 0 0 1 \n", - "1 1 1 0 0.9583242152594528828757347583 \n", - "2 1 a 0 0.9583242152594528828757347583 \n", - "3 1 [c, d] [30, 300] 0.9583242152594528828757347583 \n", - "4 1 1 [30, 300] 0.9529320289547716885340867310 \n", + "single_proc: []\n", + " run s1 s2 s3 \\\n", + "0 1 0 0 1 \n", + "1 1 1 0 10 \n", + "2 1 a 0 10 \n", + "3 1 [c, d] [30, 300] 10 \n", + "4 1 1 [30, 300] 9.943733172773669970467835810 \n", "\n", " s4 substep timestep \n", "0 1 0 0 \n", - "1 1.178862847343031816649272514 1 1 \n", - "2 1.178862847343031816649272514 2 1 \n", - "3 1.178862847343031816649272514 3 1 \n", - "4 1.230321371869816411424320371 1 2 \n", - "\n", + "1 10 1 1 \n", + "2 10 2 1 \n", + "3 10 3 1 \n", + "4 10.43650985051199020503531756 1 2 \n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", + " FutureWarning)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "config[2]\n", - "single_proc: []\n", + "single_proc: []\n", " run s1 s2 s3 s4 substep timestamp timestep\n", "0 1 0 0 1 1 0 2018-10-01 15:16:24 0\n", "1 1 [1] 0 1 1 1 2018-10-01 15:16:24 1\n", @@ -62,7 +76,7 @@ "4 1 [1] 0 1 1 1 2018-10-01 15:16:24 4\n", "\n", "config[3]\n", - "single_proc: []\n", + "single_proc: []\n", " run s1 s2 s3 s4 substep timestamp timestep\n", "0 1 0 0 1 1 0 2018-10-01 15:16:24 0\n", "1 1 0 0 1 1 1 2018-10-01 15:16:24 1\n", @@ -70,14 +84,6 @@ "3 1 0 0 1 1 1 2018-10-01 15:16:24 3\n", "4 1 0 0 1 1 1 2018-10-01 15:16:24 4\n" ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/markusbkoch/Documents/GitHub/DiffyQ-SimCAD/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", - " FutureWarning)\n" - ] } ], "source": [ @@ -101,14 +107,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "multi_proc: [, , , , , ]\n" + "multi_proc: [, , , , , ]\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "/Users/markusbkoch/Documents/GitHub/DiffyQ-SimCAD/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", + "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", " FutureWarning)\n" ] }, @@ -116,36 +122,116 @@ "name": "stdout", "output_type": "stream", "text": [ + "[([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 1}, {'s1': 1, 's2': 4, 's3': 5, 's4': 10, 'substep': 1, 'timestep': 1, 'run': 1}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': 10, 'substep': 2, 'timestep': 1, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': 10, 'substep': 3, 'timestep': 1, 'run': 1}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('10.88462238049958452634768946'), 'substep': 1, 'timestep': 2, 'run': 1}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('10.88462238049958452634768946'), 'substep': 2, 'timestep': 2, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('10.88462238049958452634768946'), 'substep': 3, 'timestep': 2, 'run': 1}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('11.84390378915460105928594240'), 'substep': 1, 'timestep': 3, 'run': 1}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('11.84390378915460105928594240'), 'substep': 2, 'timestep': 3, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('11.84390378915460105928594240'), 'substep': 3, 'timestep': 3, 'run': 1}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('13.86870567779818175660086782'), 'substep': 1, 'timestep': 4, 'run': 1}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('13.86870567779818175660086782'), 'substep': 2, 'timestep': 4, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('13.86870567779818175660086782'), 'substep': 3, 'timestep': 4, 'run': 1}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('13.93809586353209725047922068'), 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('13.93809586353209725047922068'), 'substep': 2, 'timestep': 5, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('13.93809586353209725047922068'), 'substep': 3, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 2}, {'s1': 1, 's2': 4, 's3': 5, 's4': 10, 'substep': 1, 'timestep': 1, 'run': 2}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': 10, 'substep': 2, 'timestep': 1, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': 10, 'substep': 3, 'timestep': 1, 'run': 2}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('9.454640052380469672499430089'), 'substep': 1, 'timestep': 2, 'run': 2}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('9.454640052380469672499430089'), 'substep': 2, 'timestep': 2, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('9.454640052380469672499430089'), 'substep': 3, 'timestep': 2, 'run': 2}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('7.992501415579613525253197635'), 'substep': 1, 'timestep': 3, 'run': 2}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('7.992501415579613525253197635'), 'substep': 2, 'timestep': 3, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('7.992501415579613525253197635'), 'substep': 3, 'timestep': 3, 'run': 2}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('8.777658726472379268470333983'), 'substep': 1, 'timestep': 4, 'run': 2}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('8.777658726472379268470333983'), 'substep': 2, 'timestep': 4, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('8.777658726472379268470333983'), 'substep': 3, 'timestep': 4, 'run': 2}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('7.811179137283953044810612028'), 'substep': 1, 'timestep': 5, 'run': 2}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('7.811179137283953044810612028'), 'substep': 2, 'timestep': 5, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('7.811179137283953044810612028'), 'substep': 3, 'timestep': 5, 'run': 2}], b1 b2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " s1 s2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " es1 \\\n", + "0 ._curried at 0x11204... \n", + "1 ._curried at 0x11204... \n", + "2 ._curried at 0x11204... \n", + "\n", + " es2 m \n", + "0 ._curried at 0x11204... 1 \n", + "1 ._curried at 0x11204... 2 \n", + "2 ._curried at 0x11204... 3 ), ([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 1}, {'s1': 1, 's2': Decimal('0'), 's3': 10, 's4': 10, 'substep': 1, 'timestep': 1, 'run': 1}, {'s1': 'a', 's2': Decimal('0'), 's3': 10, 's4': 10, 'substep': 2, 'timestep': 1, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 10, 's4': 10, 'substep': 3, 'timestep': 1, 'run': 1}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('12.29220801281495800694187892'), 's4': Decimal('10.88462238049958452634768946'), 'substep': 1, 'timestep': 2, 'run': 1}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('12.29220801281495800694187892'), 's4': Decimal('10.88462238049958452634768946'), 'substep': 2, 'timestep': 2, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('12.29220801281495800694187892'), 's4': Decimal('10.88462238049958452634768946'), 'substep': 3, 'timestep': 2, 'run': 1}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('12.34326909876120344349913442'), 's4': Decimal('11.84390378915460105928594240'), 'substep': 1, 'timestep': 3, 'run': 1}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('12.34326909876120344349913442'), 's4': Decimal('11.84390378915460105928594240'), 'substep': 2, 'timestep': 3, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('12.34326909876120344349913442'), 's4': Decimal('11.84390378915460105928594240'), 'substep': 3, 'timestep': 3, 'run': 1}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('10.96338363862234990976085712'), 's4': Decimal('13.86870567779818175660086782'), 'substep': 1, 'timestep': 4, 'run': 1}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('10.96338363862234990976085712'), 's4': Decimal('13.86870567779818175660086782'), 'substep': 2, 'timestep': 4, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('10.96338363862234990976085712'), 's4': Decimal('13.86870567779818175660086782'), 'substep': 3, 'timestep': 4, 'run': 1}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('11.55437395583421707706326497'), 's4': Decimal('13.93809586353209725047922068'), 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('11.55437395583421707706326497'), 's4': Decimal('13.93809586353209725047922068'), 'substep': 2, 'timestep': 5, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('11.55437395583421707706326497'), 's4': Decimal('13.93809586353209725047922068'), 'substep': 3, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 2}, {'s1': 1, 's2': Decimal('0'), 's3': 10, 's4': 10, 'substep': 1, 'timestep': 1, 'run': 2}, {'s1': 'a', 's2': Decimal('0'), 's3': 10, 's4': 10, 'substep': 2, 'timestep': 1, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 10, 's4': 10, 'substep': 3, 'timestep': 1, 'run': 2}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('9.980869503478848603350570556'), 's4': Decimal('9.454640052380469672499430089'), 'substep': 1, 'timestep': 2, 'run': 2}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('9.980869503478848603350570556'), 's4': Decimal('9.454640052380469672499430089'), 'substep': 2, 'timestep': 2, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('9.980869503478848603350570556'), 's4': Decimal('9.454640052380469672499430089'), 'substep': 3, 'timestep': 2, 'run': 2}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('11.15362288730493994485387979'), 's4': Decimal('7.992501415579613525253197635'), 'substep': 1, 'timestep': 3, 'run': 2}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('11.15362288730493994485387979'), 's4': Decimal('7.992501415579613525253197635'), 'substep': 2, 'timestep': 3, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('11.15362288730493994485387979'), 's4': Decimal('7.992501415579613525253197635'), 'substep': 3, 'timestep': 3, 'run': 2}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('10.31947583362548981535476519'), 's4': Decimal('8.777658726472379268470333983'), 'substep': 1, 'timestep': 4, 'run': 2}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('10.31947583362548981535476519'), 's4': Decimal('8.777658726472379268470333983'), 'substep': 2, 'timestep': 4, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('10.31947583362548981535476519'), 's4': Decimal('8.777658726472379268470333983'), 'substep': 3, 'timestep': 4, 'run': 2}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('10.32878941955665265801415268'), 's4': Decimal('7.811179137283953044810612028'), 'substep': 1, 'timestep': 5, 'run': 2}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('10.32878941955665265801415268'), 's4': Decimal('7.811179137283953044810612028'), 'substep': 2, 'timestep': 5, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('10.32878941955665265801415268'), 's4': Decimal('7.811179137283953044810612028'), 'substep': 3, 'timestep': 5, 'run': 2}], b1 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " b2 \\\n", + "0 \n", + "\n", + " s1 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " s2 \\\n", + "0 .. \n", + "\n", + " es1 \\\n", + "0 ._curried at 0x11205... \n", + "1 ._curried at 0x11205... \n", + "2 ._curried at 0x11205... \n", + "\n", + " es2 m \n", + "0 ._curried at 0x11205... 1 \n", + "1 ._curried at 0x11205... 2 \n", + "2 ._curried at 0x11205... 3 ), ([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 0, 'timestep': 0, 'run': 1}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 1, 'run': 1}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 2, 'run': 1}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 3, 'run': 1}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 4, 'run': 1}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 0, 'timestep': 0, 'run': 2}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 1, 'run': 2}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 2, 'run': 2}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 3, 'run': 2}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 4, 'run': 2}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 5, 'run': 2}], empty s1 m\n", + "0 NaN 1), ([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 0, 'timestep': 0, 'run': 1}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 1, 'run': 1}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 2, 'run': 1}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 3, 'run': 1}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 4, 'run': 1}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 0, 'timestep': 0, 'run': 2}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 1, 'run': 2}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 2, 'run': 2}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 3, 'run': 2}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 4, 'run': 2}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 5, 'run': 2}], Empty DataFrame\n", + "Columns: [empty, empty, m]\n", + "Index: []), ([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 1}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 1, 'run': 1}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 1, 'run': 1}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 1, 'run': 1}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 2, 'run': 1}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 2, 'run': 1}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 2, 'run': 1}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 3, 'run': 1}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 3, 'run': 1}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 3, 'run': 1}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 4, 'run': 1}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 4, 'run': 1}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 4, 'run': 1}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 5, 'run': 1}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 2}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 1, 'run': 2}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 1, 'run': 2}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 1, 'run': 2}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 2, 'run': 2}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 2, 'run': 2}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 2, 'run': 2}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 3, 'run': 2}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 3, 'run': 2}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 3, 'run': 2}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 4, 'run': 2}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 4, 'run': 2}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 4, 'run': 2}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 5, 'run': 2}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 5, 'run': 2}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 5, 'run': 2}], b1 b2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " s1 s2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " es1 \\\n", + "0 ._curried at 0x1120a... \n", + "1 ._curried at 0x1120a... \n", + "2 ._curried at 0x1120a... \n", + "\n", + " es2 m \n", + "0 ._curried at 0x1120a... 1 \n", + "1 ._curried at 0x1120a... 2 \n", + "2 ._curried at 0x1120a... 3 ), ([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 1}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 1, 'run': 1}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 1, 'run': 1}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 1, 'run': 1}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 2, 'run': 1}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 2, 'run': 1}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 2, 'run': 1}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 3, 'run': 1}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 3, 'run': 1}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 3, 'run': 1}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 4, 'run': 1}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 4, 'run': 1}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 4, 'run': 1}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 5, 'run': 1}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 2}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 1, 'run': 2}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 1, 'run': 2}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 1, 'run': 2}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 2, 'run': 2}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 2, 'run': 2}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 2, 'run': 2}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 3, 'run': 2}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 3, 'run': 2}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 3, 'run': 2}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 4, 'run': 2}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 4, 'run': 2}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 4, 'run': 2}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 5, 'run': 2}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 5, 'run': 2}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 5, 'run': 2}], b1 b2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " s1 s2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " es1 \\\n", + "0 ._curried at 0x1120a... \n", + "1 ._curried at 0x1120a... \n", + "2 ._curried at 0x1120a... \n", + "\n", + " es2 m \n", + "0 ._curried at 0x1120a... 1 \n", + "1 ._curried at 0x1120a... 2 \n", + "2 ._curried at 0x1120a... 3 )]\n", + "multi_proc: [, , , , , ]\n", "\n", "result[0]\n", - " run s1 s2 s3 s4 substep \\\n", - "0 1 0 0 1 1 0 \n", - "1 1 1 4 5 0.8686135246637317619544660374 1 \n", - "2 1 ab 6 5 0.8686135246637317619544660374 2 \n", - "3 1 [c, d] [30, 300] 5 0.8686135246637317619544660374 3 \n", - "4 1 1 4 5 0.9454530210559482586784741082 1 \n", - "\n", - " timestep \n", - "0 0 \n", - "1 1 \n", - "2 1 \n", - "3 1 \n", - "4 2 \n", + " run s1 s2 s3 s4 substep timestep\n", + "0 1 0 0 1 1 0 0\n", + "1 1 1 4 5 10 1 1\n", + "2 1 ab 6 5 10 2 1\n", + "3 1 [c, d] [30, 300] 5 10 3 1\n", + "4 1 1 4 5 10.88462238049958452634768946 1 2\n", "\n", "result[1]\n", " run s1 s2 s3 \\\n", "0 1 0 0 1 \n", - "1 1 1 0 1.055145404454642443781153816 \n", - "2 1 a 0 1.055145404454642443781153816 \n", - "3 1 [c, d] [30, 300] 1.055145404454642443781153816 \n", - "4 1 1 [30, 300] 1.297006679532223553389019665 \n", + "1 1 1 0 10 \n", + "2 1 a 0 10 \n", + "3 1 [c, d] [30, 300] 10 \n", + "4 1 1 [30, 300] 12.29220801281495800694187892 \n", "\n", - " s4 substep timestep \n", - "0 1 0 0 \n", - "1 0.8686135246637317619544660374 1 1 \n", - "2 0.8686135246637317619544660374 2 1 \n", - "3 0.8686135246637317619544660374 3 1 \n", - "4 0.9454530210559482586784741082 1 2 \n", + " s4 substep timestep \n", + "0 1 0 0 \n", + "1 10 1 1 \n", + "2 10 2 1 \n", + "3 10 3 1 \n", + "4 10.88462238049958452634768946 1 2 \n", "\n", "result[2]\n", " run s1 s2 s3 s4 substep timestamp timestep\n", @@ -185,6 +271,7 @@ "from validation import sweep_config\n", "multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc)\n", "run2 = Executor(exec_context=multi_proc_ctx, configs=configs)\n", + "print(run2.main())\n", "results = []\n", "tensor_fields = []\n", "for raw_result, raw_tensor_field in run2.main():\n", @@ -196,6 +283,13 @@ " print(f\"result[{idx}]\")\n", " print(r.head())" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/simulations/validation/config1.py b/simulations/validation/config1.py index a2d09d3..1ad90e5 100644 --- a/simulations/validation/config1.py +++ b/simulations/validation/config1.py @@ -111,7 +111,7 @@ raw_exogenous_states = { env_processes = { "s3": env_a, - "s4": proc_trigger('2018-10-01 15:16:25', env_b) + "s4": proc_trigger(1, env_b) } diff --git a/simulations/validation/config2.py b/simulations/validation/config2.py index 6a22d01..31734e2 100644 --- a/simulations/validation/config2.py +++ b/simulations/validation/config2.py @@ -109,8 +109,8 @@ raw_exogenous_states = { env_processes = { - "s3": proc_trigger('2018-10-01 15:16:25', env_a), - "s4": proc_trigger('2018-10-01 15:16:25', env_b) + "s3": proc_trigger(1, env_a), + "s4": proc_trigger(1, env_b) } diff --git a/simulations/validation/sweep_config.py b/simulations/validation/sweep_config.py index eb54b72..09ccd6b 100644 --- a/simulations/validation/sweep_config.py +++ b/simulations/validation/sweep_config.py @@ -128,7 +128,7 @@ raw_exogenous_states = { # ToDo: make env proc trigger field agnostic # ToDo: input json into function renaming __name__ -triggered_env_b = proc_trigger('2018-10-01 15:16:25', env_b) +triggered_env_b = proc_trigger(1, env_b) env_processes = { "s3": env_a, #sweep(beta, env_a), "s4": triggered_env_b #rename('parameterized', triggered_env_b) #sweep(beta, triggered_env_b)