From ebd9916dd12c5f7af2cca9fa038f61be8bd67426 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 10 Aug 2022 12:43:32 +0100 Subject: [PATCH] feat: Adding random state fixing to parameter experiments to ensure comparability (#107) * feat: Adding random state fixing to parameter experiments to ensure comparability --- poetry.lock | 176 +++++++++++++++--- requirements-dev.txt | 10 +- requirements.txt | 10 +- .../parameter_test/parameter/experiment.py | 12 +- .../scenario/ideal_market_maker/agents.py | 1 - .../scenario/ideal_market_maker/scenario.py | 14 +- .../ideal_market_maker_v2/scenario.py | 19 +- vega_sim/scenario/market_crash/scenario.py | 16 +- vega_sim/scenario/scenario.py | 9 +- 9 files changed, 212 insertions(+), 55 deletions(-) diff --git a/poetry.lock b/poetry.lock index 1465e2ed9..95423d163 100644 --- a/poetry.lock +++ b/poetry.lock @@ -78,17 +78,17 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "attrs" -version = "21.4.0" +version = "22.1.0" description = "Classes Without Boilerplate" category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = ">=3.5" [package.extras] -dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"] +dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "mypy (>=0.900,!=0.940)", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"] docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] -tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "cloudpickle"] -tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "cloudpickle"] +tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "mypy (>=0.900,!=0.940)", "pytest-mypy-plugins", "zope.interface", "cloudpickle"] +tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "mypy (>=0.900,!=0.940)", "pytest-mypy-plugins", "cloudpickle"] [[package]] name = "babel" @@ -307,15 +307,15 @@ woff = ["zopfli (>=0.1.4)", "brotlicffi (>=0.8.0)", "brotli (>=1.0.1)"] [[package]] name = "gprof2dot" -version = "2021.2.21" +version = "2022.7.29" description = "Generate a dot graph from the output of several profilers." category = "main" optional = true -python-versions = "*" +python-versions = ">=2.7" [[package]] name = "grpcio" -version = "1.48.0rc1" +version = "1.48.0" description = "HTTP/2-based RPC framework" category = "main" optional = false @@ -325,18 +325,18 @@ python-versions = ">=3.6" six = ">=1.5.2" [package.extras] -protobuf = ["grpcio-tools (>=1.48.0rc1)"] +protobuf = ["grpcio-tools (>=1.48.0)"] [[package]] name = "grpcio-tools" -version = "1.48.0rc1" +version = "1.48.0" description = "Protobuf code generator for gRPC" category = "main" optional = false python-versions = ">=3.6" [package.dependencies] -grpcio = ">=1.48.0rc1" +grpcio = ">=1.48.0" protobuf = ">=3.12.0,<4.0dev" [[package]] @@ -496,7 +496,7 @@ i18n = ["Babel (>=2.7)"] [[package]] name = "json5" -version = "0.9.8" +version = "0.9.9" description = "A Python implementation of the JSON5 data format." category = "main" optional = true @@ -507,7 +507,7 @@ dev = ["hypothesis"] [[package]] name = "jsonschema" -version = "4.7.2" +version = "4.9.0" description = "An implementation of JSON Schema validation for Python" category = "main" optional = false @@ -1347,14 +1347,14 @@ test = ["fixtures", "mock", "purl", "pytest", "sphinx", "testrepository (>=0.0.1 [[package]] name = "scipy" -version = "1.8.1" +version = "1.9.0" description = "SciPy: Scientific Library for Python" category = "main" optional = false -python-versions = ">=3.8,<3.11" +python-versions = ">=3.8,<3.12" [package.dependencies] -numpy = ">=1.17.3,<1.25.0" +numpy = ">=1.18.5,<1.25.0" [[package]] name = "send2trash" @@ -1621,7 +1621,10 @@ argon2-cffi = [] argon2-cffi-bindings = [] asttokens = [] atomicwrites = [] -attrs = [] +attrs = [ + {file = "attrs-22.1.0-py2.py3-none-any.whl", hash = "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c"}, + {file = "attrs-22.1.0.tar.gz", hash = "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"}, +] babel = [] backcall = [] beautifulsoup4 = [] @@ -1644,9 +1647,106 @@ executing = [ fastjsonschema = [] flake8 = [] fonttools = [] -gprof2dot = [] -grpcio = [] -grpcio-tools = [] +gprof2dot = [ + {file = "gprof2dot-2022.7.29-py2.py3-none-any.whl", hash = "sha256:f165b3851d3c52ee4915eb1bd6cca571e5759823c2cd0f71a79bda93c2dc85d6"}, + {file = "gprof2dot-2022.7.29.tar.gz", hash = "sha256:45b4d298bd36608fccf9511c3fd88a773f7a1abc04d6cd39445b11ba43133ec5"}, +] +grpcio = [ + {file = "grpcio-1.48.0-cp310-cp310-linux_armv7l.whl", hash = "sha256:4a049a032144641ed5d073535c0dc69eb6029187cc729a66946c86dcc8eec3a1"}, + {file = "grpcio-1.48.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:f8bc76f5cd95f5476e5285fe5d3704a9332586a569fbbccef551b0b6f7a270f9"}, + {file = "grpcio-1.48.0-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:448d397fe88e9fef8170f019b86abdc4d554ae311aaf4dbff1532fde227d3308"}, + {file = "grpcio-1.48.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8f9b6b6f7c83869d2316c5d13f953381881a16741275a34ec5ed5762f11b206e"}, + {file = "grpcio-1.48.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5bd8541c4b6b43c9024496d30b4a12346325d3a17a1f3c80ad8924caed1e35c3"}, + {file = "grpcio-1.48.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:877d33aeba05ae0b9e81761a694914ed33613f655c35f6bbcf4ebbcb984e0167"}, + {file = "grpcio-1.48.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:cd01a8201fd8ab2ce496f7e65975da1f1e629eac8eea84ead0fd77e32e4350cd"}, + {file = "grpcio-1.48.0-cp310-cp310-win32.whl", hash = "sha256:0388da923dff58ba7f711233e41c2b749b5817b8e0f137a107672d9c15a1009c"}, + {file = "grpcio-1.48.0-cp310-cp310-win_amd64.whl", hash = "sha256:8dcffdb8921fd88857ae350fd579277a5f9315351e89ed9094ef28927a46d40d"}, + {file = "grpcio-1.48.0-cp36-cp36m-linux_armv7l.whl", hash = "sha256:2138c50331232f56178c2b36dcfa6ad67aad705fe410955f3b2a53d722191b89"}, + {file = "grpcio-1.48.0-cp36-cp36m-macosx_10_10_x86_64.whl", hash = "sha256:af2d80f142da2a6af45204a5ca2374e2747af07a99de54a1164111e169a761ff"}, + {file = "grpcio-1.48.0-cp36-cp36m-manylinux_2_17_aarch64.whl", hash = "sha256:59284bd4cdf47c147c26d91aca693765318d524328f6ece2a1a0b85a12a362af"}, + {file = "grpcio-1.48.0-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cc3ebfe356c0c6750379cd194bf2b7e5d1d2f29db1832358f05a73e9290db98c"}, + {file = "grpcio-1.48.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc2619a31339e1c53731f54761f1a2cb865d3421f690e00ef3e92f90d2a0c5ae"}, + {file = "grpcio-1.48.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:7df637405de328a54c1c8c08a3206f974c7a577730f90644af4c3400b7bfde2d"}, + {file = "grpcio-1.48.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:9e73b95969a579798bfbeb85d376695cce5172357fb52e450467ceb8e7365152"}, + {file = "grpcio-1.48.0-cp36-cp36m-win32.whl", hash = "sha256:059e9d58b5aba7fb9eabe3a4d2ac49e1dcbc2b54b0f166f6475e40b7f4435343"}, + {file = "grpcio-1.48.0-cp36-cp36m-win_amd64.whl", hash = "sha256:7cebcf645170f0c82ef71769544f9ac4515993a4d367f5900aba2eb4ecd2a32f"}, + {file = "grpcio-1.48.0-cp37-cp37m-linux_armv7l.whl", hash = "sha256:8af3a8845df35b838104d6fb1ae7f4969d248cf037fa2794916d31e917346f72"}, + {file = "grpcio-1.48.0-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:a1ef40975ec9ced6c17ce7fbec9825823da782fa606f0b92392646ff3886f198"}, + {file = "grpcio-1.48.0-cp37-cp37m-manylinux_2_17_aarch64.whl", hash = "sha256:7cccbf6db31f2a78e1909047ff69620f94a4e6e53251858e9502fbbff5714b48"}, + {file = "grpcio-1.48.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f3f142579f58def64c0850f0bb0eb1b425ae885f5669dda5b73ade64ad2b753"}, + {file = "grpcio-1.48.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:656c6f6f7b815bca3054780b8cdfa1e4e37cd36c887a48558d00c2cf85f31697"}, + {file = "grpcio-1.48.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:cba4538e8a2ef123ea570e7b1d62162e158963c2471e35d79eb9690c971a10c0"}, + {file = "grpcio-1.48.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:9daa67820fafceec6194ed1686c1783816e62d6756ff301ba93e682948836846"}, + {file = "grpcio-1.48.0-cp37-cp37m-win32.whl", hash = "sha256:7ec264a7fb413e0c804a7a48a6f7d7212742955a60724c44d793da35a8f30873"}, + {file = "grpcio-1.48.0-cp37-cp37m-win_amd64.whl", hash = "sha256:a2b1b33b92359388b8164807313dcbb3317101b038a5d54342982560329d958f"}, + {file = "grpcio-1.48.0-cp38-cp38-linux_armv7l.whl", hash = "sha256:7b820696a5ce7b98f459f234698cb323f89b355373789188efa126d7f47a2a92"}, + {file = "grpcio-1.48.0-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:e4dfae66ebc165c46c5b7048eb554472ee72fbaab2c2c2da7f9b1621c81e077c"}, + {file = "grpcio-1.48.0-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:f7115038edce33b494e0138b0bd31a2eb6595d45e2eed23be46bc32886feb741"}, + {file = "grpcio-1.48.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b4e996282238943ca114628255be61980e38b25f73a08ae2ffd02b63eaf70d3a"}, + {file = "grpcio-1.48.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13dad31f5155fa555d393511cc8108c41b1b5b54dc4c24c27d4694ddd7a78fad"}, + {file = "grpcio-1.48.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:c84b9d90b2641963de98b35bb7a2a51f78119fe5bd00ef27246ba9f4f0835e36"}, + {file = "grpcio-1.48.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:41b65166779d7dafac4c98380ac19f690f1c5fe18083a71d370df87b24dd30ff"}, + {file = "grpcio-1.48.0-cp38-cp38-win32.whl", hash = "sha256:b890e5f5fbc21cb994894f73ecb2faaa66697d8debcb228a5adb0622b9bec3b2"}, + {file = "grpcio-1.48.0-cp38-cp38-win_amd64.whl", hash = "sha256:5fe3af539d2f50891ed93aed3064ffbcc38bf848aa3f7ed1fbedcce139c57302"}, + {file = "grpcio-1.48.0-cp39-cp39-linux_armv7l.whl", hash = "sha256:a4ed57f4e3d91259551e6765782b22d9e8b8178fec43ebf8e1b2c392c4ced37b"}, + {file = "grpcio-1.48.0-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:60843d8184e171886dd7a93d6672e2ef0b08dfd4f88da7421c10b46b6e031ac4"}, + {file = "grpcio-1.48.0-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:0ecba22f25ccde2442be7e7dd7fa746905d628f03312b4a0c9961f0d99771f53"}, + {file = "grpcio-1.48.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:34f5917f0c49a04633dc12d483c8aee6f6d9f69133b700214d3703f72a72f501"}, + {file = "grpcio-1.48.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f4c4ad8ad7e2cf3a272cbc96734d56635e6543939022f17e0c4487f7d2a45bf9"}, + {file = "grpcio-1.48.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:111fb2f5f4a069f331ae23106145fd16dd4e1112ca223858a922068614dac6d2"}, + {file = "grpcio-1.48.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:beb0573daa49889efcfea0a6e995b4f39d481aa1b94e1257617406ef417b56a6"}, + {file = "grpcio-1.48.0-cp39-cp39-win32.whl", hash = "sha256:ce70254a082cb767217b2fdee374cc79199d338d46140753438cd6d67c609b2f"}, + {file = "grpcio-1.48.0-cp39-cp39-win_amd64.whl", hash = "sha256:ae3fd135666448058fe277d93c10e0f18345fbcbb015c4642de2fa3db6f0c205"}, + {file = "grpcio-1.48.0.tar.gz", hash = "sha256:eaf4bb73819863440727195411ab3b5c304f6663625e66f348e91ebe0a039306"}, +] +grpcio-tools = [ + {file = "grpcio-tools-1.48.0.tar.gz", hash = "sha256:dd7f757608e7dfae4ab2e7fc1e8951e6eb9526ebdc7ce90597329bc4c408c9a1"}, + {file = "grpcio_tools-1.48.0-cp310-cp310-linux_armv7l.whl", hash = "sha256:dc9aae4346a4c2ffc0ccda92d88c69403a3dfb3e4555b8d0d1b729ee59fe3585"}, + {file = "grpcio_tools-1.48.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:4c522f9f901470f3c0b047172617fe71925f5d3bab8321165c8c1ae7648a88c9"}, + {file = "grpcio_tools-1.48.0-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:78f97f1049ea7af0cc22ed96edc25d0fbfb560e570d12c650a98a9d3f718de3f"}, + {file = "grpcio_tools-1.48.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f0d4f5a65f0a00120fb4ef972ef02f90b27a1d38899df3b0df1e4df136e49195"}, + {file = "grpcio_tools-1.48.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e4ccac5c036e058c12df88ad2c770fed89903c4ef005b43f856ed5d3a89ff8b"}, + {file = "grpcio_tools-1.48.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:84c067f69d9fbac09793800c3b49edcda01202a50ab8a11b9ada5394d9d610a6"}, + {file = "grpcio_tools-1.48.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4075080ee0d713f904f60be3b64294fdd8f839d9aeec87b69ddd7f3512a3a12f"}, + {file = "grpcio_tools-1.48.0-cp310-cp310-win32.whl", hash = "sha256:f54906c4d72c04b113b9daa9a310a9cba8318accf8ef018ebb81ba83fdc812e7"}, + {file = "grpcio_tools-1.48.0-cp310-cp310-win_amd64.whl", hash = "sha256:b8db9e68160318814eea630c33bf1cde6897164b35f60495792b1b834dfafba8"}, + {file = "grpcio_tools-1.48.0-cp36-cp36m-linux_armv7l.whl", hash = "sha256:ab192a21fa77b8705925c033124189cde11bae5ee78abb7ff4e3d441de494434"}, + {file = "grpcio_tools-1.48.0-cp36-cp36m-macosx_10_10_x86_64.whl", hash = "sha256:7387603d526fa82017ae8375aea604c38097f87353a3a630217df98163dc3de7"}, + {file = "grpcio_tools-1.48.0-cp36-cp36m-manylinux_2_17_aarch64.whl", hash = "sha256:cdd5121a7770f2116741d767c1498f124221d7340eff3805bc3ae31f6a04910e"}, + {file = "grpcio_tools-1.48.0-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:17e2d1af962dccb62f0c6ae485ec13de056a119fb852eb6fc8576bd3320ac1ab"}, + {file = "grpcio_tools-1.48.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d003060fec9775c8cad924b5711c81e3dc2f7c1224b9f5ca66727ed3e2e72482"}, + {file = "grpcio_tools-1.48.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:f62f8bfb643397cf85c57d53cb437eae9b6d94be1455c033a21eabc04e2883a0"}, + {file = "grpcio_tools-1.48.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:c2af2df0b42d468f5d619c85e0cf4f57f7315e583b1bbcb7d5a77e5acee75d18"}, + {file = "grpcio_tools-1.48.0-cp36-cp36m-win32.whl", hash = "sha256:01f1dee2375d53e448038e8f4e04417653f026108b153797f3ffec00fc9f1cb4"}, + {file = "grpcio_tools-1.48.0-cp36-cp36m-win_amd64.whl", hash = "sha256:cd24f4e17b1311ec9daab83c71a8f8779fa5d75ed56be0aa5cb2bc585e61ffa0"}, + {file = "grpcio_tools-1.48.0-cp37-cp37m-linux_armv7l.whl", hash = "sha256:80680c397b7587c2913617c7ee42bb5ee6c7fab606a5bf6b339fb4a3ed7e9a35"}, + {file = "grpcio_tools-1.48.0-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:6e4d42811fabf24b98e0d3fc1be5ba2a0a22c98883b6f856dae8f1280ca12464"}, + {file = "grpcio_tools-1.48.0-cp37-cp37m-manylinux_2_17_aarch64.whl", hash = "sha256:6faa946048ac6eea126809259d79c7bfc49ad5a6ca7b72efd4c5aca2afff99d7"}, + {file = "grpcio_tools-1.48.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4b20334df9d8ec28f56e49683804d2610ddbb12d61cf5eb47094be9eedfadad9"}, + {file = "grpcio_tools-1.48.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2dc0400adecce19e507ce14c69a0b9993e0c84b4797f1cf1cf46d939358b7e5"}, + {file = "grpcio_tools-1.48.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:15e138b91ee10495954d51e85478fc00ac0660232b96a78c65005eb5a5c0fe26"}, + {file = "grpcio_tools-1.48.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:6648e8ab7b8c34ac5e01fc801c7f847b645d373b7e1286bb7eed20832afeff00"}, + {file = "grpcio_tools-1.48.0-cp37-cp37m-win32.whl", hash = "sha256:62748a78031a46a007ebbe2d00b589967c2cb36ec09da2af3b80a6d952ed4392"}, + {file = "grpcio_tools-1.48.0-cp37-cp37m-win_amd64.whl", hash = "sha256:dc10107a6ac716281bae2b213a0b4cd76361d6e51d83cc3e5fad13fd522da732"}, + {file = "grpcio_tools-1.48.0-cp38-cp38-linux_armv7l.whl", hash = "sha256:8aaa0dfe55f2b0ca9d63205ee15c7eaa8b64e65ed0e2cf92e3d0b8cbb905a1bf"}, + {file = "grpcio_tools-1.48.0-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:ce2b9ab08076989fb8d94415e689c39bf00b7e8fbc0d115c16d73c11859e9f0a"}, + {file = "grpcio_tools-1.48.0-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:9cebc58166249dbc8d1e11a3d1829d45234061ee6e2e95c40e37550952ca2d20"}, + {file = "grpcio_tools-1.48.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d9adcf880db564bec364a7c7e596ae8823f275bb4d0346a60a737429390485ad"}, + {file = "grpcio_tools-1.48.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bafe73c61c0a66ee63ef786b3dc04fb504eebf460ea01fdf000603bb542934ed"}, + {file = "grpcio_tools-1.48.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:f528ff56eeaecc68f6c7ba8ecd54e8e23b0028fe5dd17ad921187b6968d861f2"}, + {file = "grpcio_tools-1.48.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e95972e29f5dcb4fbea184ac719f0ba6b92ecac93e5ad0b8c8ab91597f029860"}, + {file = "grpcio_tools-1.48.0-cp38-cp38-win32.whl", hash = "sha256:edbdb515fb8d4e5b3aa6131608d10e357ff2b9be251e7ebf0b92e3cc7ad3c34f"}, + {file = "grpcio_tools-1.48.0-cp38-cp38-win_amd64.whl", hash = "sha256:b582288cfe2fdb22f613a5ec9ed8ce6308a3c245d6686dc2bd42463495656cc8"}, + {file = "grpcio_tools-1.48.0-cp39-cp39-linux_armv7l.whl", hash = "sha256:f47730e008cadfab59f9dd0d267689413357368f3e87248267831599dbcd4eb6"}, + {file = "grpcio_tools-1.48.0-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:aac3a8097adae3491367ef7464458df2a2e72bde9207b1778e7228c0f206a7af"}, + {file = "grpcio_tools-1.48.0-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:f4972b2a1d6ad54c110b35ccebf431771ce68004afe4cd6ef63d95290917c0e0"}, + {file = "grpcio_tools-1.48.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b765943d17c3b75d01bab5c6c7f2e92bde73e4cf63cb791f7ee3b5453d72f745"}, + {file = "grpcio_tools-1.48.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d03c36318fa631e3c6e07b1d0e651c88e1026fe0307a4524f2eefa27c0539611"}, + {file = "grpcio_tools-1.48.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:a61fb8ae2193c4064b9e39d1505556945a4cd4fd63c25829682222828860e060"}, + {file = "grpcio_tools-1.48.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e82c4c5a2551a1aa7da2e1eae038520f78e89a2e61ddac2600fd573ff75679f5"}, + {file = "grpcio_tools-1.48.0-cp39-cp39-win32.whl", hash = "sha256:79671905e97aef0f50838657ff0c270e5f5412df117bd559940531ef45c7e188"}, + {file = "grpcio_tools-1.48.0-cp39-cp39-win_amd64.whl", hash = "sha256:e63086f42166c4fa14b06779ed7f0299f03ce87eb225e93b39031bb675535f92"}, +] idna = [] importlib-metadata = [] inflection = [] @@ -1657,8 +1757,14 @@ ipython-genutils = [] ipywidgets = [] jedi = [] jinja2 = [] -json5 = [] -jsonschema = [] +json5 = [ + {file = "json5-0.9.9-py2.py3-none-any.whl", hash = "sha256:1ff8351ee2ae80fd89d64210d9522db7e157516a7b12c72089ded6964527283f"}, + {file = "json5-0.9.9.tar.gz", hash = "sha256:2ace77117c068c5f1f23f97e530a0d49bc09a46039521b6daa74aa39524e02a2"}, +] +jsonschema = [ + {file = "jsonschema-4.9.0-py3-none-any.whl", hash = "sha256:5d0be0cd1b670438b71c3d3145b2abba1f9d197e3e91adc4c4bae4c0e114e252"}, + {file = "jsonschema-4.9.0.tar.gz", hash = "sha256:df10e65c8f3687a48e93d0d348ce0ce5f897b5a28e9bbcbbe8f7c7eaf019e850"}, +] jupyter = [] jupyter-client = [] jupyter-console = [] @@ -1723,7 +1829,31 @@ qtconsole = [] qtpy = [] requests = [] requests-mock = [] -scipy = [] +scipy = [ + {file = "scipy-1.9.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0424d1bbbfa51d5ddaa16d067fd593863c9f2fb7c6840c32f8a08a8832f8e7a4"}, + {file = "scipy-1.9.0-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:8f2232c9d9119ec356240255a715a289b3a33be828c3e4abac11fd052ce15b1e"}, + {file = "scipy-1.9.0-cp310-cp310-macosx_12_0_universal2.macosx_10_9_x86_64.whl", hash = "sha256:e2004d2a3c397b26ca78e67c9d320153a1a9b71ae713ad33f4a3a3ab3d79cc65"}, + {file = "scipy-1.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45f0d6c0d6e55582d3b8f5c58ad4ca4259a02affb190f89f06c8cc02e21bba81"}, + {file = "scipy-1.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:79dd7876614fc2869bf5d311ef33962d2066ea888bc66c80fd4fa80f8772e5a9"}, + {file = "scipy-1.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:10417935486b320d98536d732a58362e3d37e84add98c251e070c59a6bfe0863"}, + {file = "scipy-1.9.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:adb6c438c6ef550e2bb83968e772b9690cb421f2c6073f9c2cb6af15ee538bc9"}, + {file = "scipy-1.9.0-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:8d541db2d441ef87afb60c4a2addb00c3af281633602a4967e733ef4b7050504"}, + {file = "scipy-1.9.0-cp38-cp38-macosx_12_0_universal2.macosx_10_9_x86_64.whl", hash = "sha256:97a1f1e51ea30782d7baa8d0c52f72c3f9f05cb609cf1b990664231c5102bccd"}, + {file = "scipy-1.9.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:16207622570af10f9e6a2cdc7da7a9660678852477adbcd056b6d1057a036fef"}, + {file = "scipy-1.9.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb687d245b6963673c639f318eea7e875d1ba147a67925586abed3d6f39bb7d8"}, + {file = "scipy-1.9.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73b704c5eea9be811919cae4caacf3180dd9212d9aed08477c1d2ba14900a9de"}, + {file = "scipy-1.9.0-cp38-cp38-win32.whl", hash = "sha256:12005d30894e4fe7b247f7233ba0801a341f887b62e2eb99034dd6f2a8a33ad6"}, + {file = "scipy-1.9.0-cp38-cp38-win_amd64.whl", hash = "sha256:fc58c3fcb8a724b703ffbc126afdca5a8353d4d5945d5c92db85617e165299e7"}, + {file = "scipy-1.9.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:01c2015e132774feefe059d5354055fec6b751d7a7d70ad2cf5ce314e7426e2a"}, + {file = "scipy-1.9.0-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:f7c3c578ff556333f3890c2df6c056955d53537bb176698359088108af73a58f"}, + {file = "scipy-1.9.0-cp39-cp39-macosx_12_0_universal2.macosx_10_9_x86_64.whl", hash = "sha256:e2ac088ea4aa61115b96b47f5f3d94b3fa29554340b6629cd2bfe6b0521ee33b"}, + {file = "scipy-1.9.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:5d1b9cf3771fd921f7213b4b886ab2606010343bb36259b544a816044576d69e"}, + {file = "scipy-1.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3a326673ac5afa9ef5613a61626b9ec15c8f7222b4ecd1ce0fd8fcba7b83c59"}, + {file = "scipy-1.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:693b3fe2e7736ce0dbc72b4d933798eb6ca8ce51b8b934e3f547cc06f48b2afb"}, + {file = "scipy-1.9.0-cp39-cp39-win32.whl", hash = "sha256:7bad16b91918bf3288089a78a4157e04892ea6475fb7a1d9bcdf32c30c8a3dba"}, + {file = "scipy-1.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:bd490f77f35800d5620f4d9af669e372d9a88db1f76ef219e1609cc4ecdd1a24"}, + {file = "scipy-1.9.0.tar.gz", hash = "sha256:c0dfd7d2429452e7e94904c6a3af63cbaa3cf51b348bd9d35b42db7e9ad42791"}, +] send2trash = [] setuptools-scm = [] six = [] diff --git a/requirements-dev.txt b/requirements-dev.txt index b24c9ad7f..449a7e7ba 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ argon2-cffi-bindings==21.2.0; python_version >= "3.7" argon2-cffi==21.3.0; python_version >= "3.7" asttokens==2.0.5; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.8" atomicwrites==1.4.1; sys_platform == "win32" and python_version >= "3.7" and python_full_version >= "3.7.0" and python_full_version < "4.0.0" -attrs==21.4.0; python_full_version >= "3.7.0" and python_version >= "3.7" and python_full_version < "4.0.0" +attrs==22.1.0; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7" backcall==0.2.0; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.8" beautifulsoup4==4.11.1; python_full_version >= "3.6.0" and python_version >= "3.7" black==22.6.0; python_full_version >= "3.6.2" @@ -22,8 +22,8 @@ executing==0.9.1; python_full_version >= "3.7.0" and python_full_version < "4.0. fastjsonschema==2.16.1; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7" flake8==4.0.1; python_version >= "3.6" fonttools==4.34.4; python_version >= "3.7" -grpcio-tools==1.48.0rc1; python_version >= "3.6" -grpcio==1.48.0rc1; python_version >= "3.6" +grpcio-tools==1.48.0; python_version >= "3.6" +grpcio==1.48.0; python_version >= "3.6" idna==3.3; python_version >= "3.7" and python_version < "4" inflection==0.5.1; python_version >= "3.5" iniconfig==1.1.1; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7" @@ -33,7 +33,7 @@ ipython==8.4.0; python_full_version >= "3.7.0" and python_full_version < "4.0.0" ipywidgets==7.7.1 jedi==0.18.1; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.8" jinja2==3.1.2; python_version >= "3.7" -jsonschema==4.7.2; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7" +jsonschema==4.9.0; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7" jupyter-client==7.3.4; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7" jupyter-core==4.11.1; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7" jupyterlab-pygments==0.2.2; python_version >= "3.7" @@ -85,7 +85,7 @@ pywinpty==2.0.6; os_name == "nt" and python_version >= "3.7" pyzmq==23.2.0; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7" requests-mock==1.9.3 requests==2.28.1; python_version >= "3.7" and python_version < "4" -scipy==1.8.1; python_version >= "3.8" and python_version < "3.11" +scipy==1.9.0; python_version >= "3.8" and python_version < "3.12" send2trash==1.8.0; python_version >= "3.7" setuptools-scm==7.0.5; python_version >= "3.7" six==1.16.0; python_full_version >= "3.7.0" and python_version >= "3.8" and python_full_version < "4.0.0" and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.7") diff --git a/requirements.txt b/requirements.txt index 7b43e6f83..bbd1f9bc6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ argon2-cffi-bindings==21.2.0; python_version >= "3.7" argon2-cffi==21.3.0; python_version >= "3.7" asttokens==2.0.5; python_version >= "3.8" atomicwrites==1.4.1; python_version >= "3.7" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.7" and python_full_version >= "3.4.0" -attrs==21.4.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7" +attrs==22.1.0; python_version >= "3.7" backcall==0.2.0; python_version >= "3.8" beautifulsoup4==4.11.1; python_full_version >= "3.6.0" and python_version >= "3.7" bleach==5.0.1; python_version >= "3.7" @@ -19,8 +19,8 @@ entrypoints==0.4; python_version >= "3.7" executing==0.9.1; python_version >= "3.8" fastjsonschema==2.16.1; python_version >= "3.7" fonttools==4.34.4; python_version >= "3.7" -grpcio-tools==1.48.0rc1; python_version >= "3.6" -grpcio==1.48.0rc1; python_version >= "3.6" +grpcio-tools==1.48.0; python_version >= "3.6" +grpcio==1.48.0; python_version >= "3.6" idna==3.3; python_version >= "3.7" and python_version < "4" inflection==0.5.1; python_version >= "3.5" iniconfig==1.1.1; python_version >= "3.7" @@ -30,7 +30,7 @@ ipython==8.4.0; python_version >= "3.8" ipywidgets==7.7.1 jedi==0.18.1; python_version >= "3.8" jinja2==3.1.2; python_version >= "3.7" -jsonschema==4.7.2; python_version >= "3.7" +jsonschema==4.9.0; python_version >= "3.7" jupyter-client==7.3.4; python_full_version >= "3.7.0" and python_version >= "3.7" jupyter-core==4.11.1; python_version >= "3.7" jupyterlab-pygments==0.2.2; python_version >= "3.7" @@ -73,7 +73,7 @@ pywin32==304; sys_platform == "win32" and platform_python_implementation != "PyP pywinpty==2.0.6; os_name == "nt" and python_version >= "3.7" pyzmq==23.2.0; python_version >= "3.7" requests==2.28.1; python_version >= "3.7" and python_version < "4" -scipy==1.8.1; python_version >= "3.8" and python_version < "3.11" +scipy==1.9.0; python_version >= "3.8" and python_version < "3.12" send2trash==1.8.0; python_version >= "3.7" setuptools-scm==7.0.5; python_version >= "3.7" six==1.16.0; python_version >= "3.8" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.8" diff --git a/vega_sim/parameter_test/parameter/experiment.py b/vega_sim/parameter_test/parameter/experiment.py index f889f00e9..9a6f3cf90 100644 --- a/vega_sim/parameter_test/parameter/experiment.py +++ b/vega_sim/parameter_test/parameter/experiment.py @@ -4,6 +4,7 @@ import os from typing import Any, Dict, List, Optional, Tuple import pathlib +import numpy as np from vega_sim.scenario.scenario import Scenario from vega_sim.null_service import VegaServiceNull @@ -52,6 +53,7 @@ def _run_parameter_iteration( parameter_to_vary: str, value: str, additional_parameters_to_set: Optional[Dict[str, str]] = None, + random_state: Optional[np.random.RandomState] = None, ) -> Any: with VegaServiceNull( warn_on_raw_data_access=False, retain_log_files=True, run_with_console=False @@ -73,10 +75,8 @@ def _run_parameter_iteration( PARAMETER_AMEND_WALLET[0], parameter=parameter_to_vary, new_value=value ) - res = scenario.run_iteration(vega=vega) - # import pdb + res = scenario.run_iteration(vega=vega, random_state=random_state) - # pdb.set_trace() return res @@ -84,14 +84,18 @@ def run_single_parameter_experiment( experiment: SingleParameterExperiment, ) -> Dict[str, List[Any]]: results = {} + random_seeds = [ + np.random.RandomState(i) for i in range(experiment.runs_per_scenario) + ] for value in experiment.values: results[value] = [] - for _ in range(experiment.runs_per_scenario): + for state in random_seeds: results[value].append( _run_parameter_iteration( scenario=experiment.scenario, parameter_to_vary=experiment.parameter_to_vary, value=value, + random_state=state, ) ) return results diff --git a/vega_sim/scenario/ideal_market_maker/agents.py b/vega_sim/scenario/ideal_market_maker/agents.py index 637fc083c..dce43537b 100644 --- a/vega_sim/scenario/ideal_market_maker/agents.py +++ b/vega_sim/scenario/ideal_market_maker/agents.py @@ -192,7 +192,6 @@ def num_LimitOrderHit(self, bid_depth, ask_depth, num_buyMO, num_sellMO): return num_BidLimitOrderHit, num_AskLimitOrderHit def OptimalStrategy(self, current_position): - if current_position >= self.q_upper: current_bid_depth = self.optimal_bid[self.current_step, 0] current_ask_depth = 1 / 10**self.mdp diff --git a/vega_sim/scenario/ideal_market_maker/scenario.py b/vega_sim/scenario/ideal_market_maker/scenario.py index f55839f0b..5a4a94c5e 100644 --- a/vega_sim/scenario/ideal_market_maker/scenario.py +++ b/vega_sim/scenario/ideal_market_maker/scenario.py @@ -1,5 +1,6 @@ import argparse import logging +import numpy as np from typing import Any, Callable, List, Optional from vega_sim.environment.agent import Agent @@ -72,6 +73,7 @@ def set_up_background_market( self, vega: VegaServiceNull, tag: str = "", + random_state: Optional[np.random.RandomState] = None, ) -> MarketEnvironment: _, price_process = RW_model( T=self.num_steps * self.dt, @@ -79,6 +81,7 @@ def set_up_background_market( mdp=self.market_decimal, sigma=self.sigma, Midprice=self.initial_price, + random_state=random_state, ) market_maker = OptimalMarketMaker( @@ -151,10 +154,14 @@ def set_up_background_market( ) return env - def run_iteration(self, vega: VegaServiceNull, pause_at_completion: bool = False): + def run_iteration( + self, + vega: VegaServiceNull, + pause_at_completion: bool = False, + random_state: Optional[np.random.RandomState] = None, + ): env = self.set_up_background_market( - vega=vega, - tag=str(0), + vega=vega, tag=str(0), random_state=random_state ) result = env.run( pause_at_completion=pause_at_completion, @@ -163,7 +170,6 @@ def run_iteration(self, vega: VegaServiceNull, pause_at_completion: bool = False if __name__ == "__main__": - parser = argparse.ArgumentParser() parser.add_argument("--debug", action="store_true") args = parser.parse_args() diff --git a/vega_sim/scenario/ideal_market_maker_v2/scenario.py b/vega_sim/scenario/ideal_market_maker_v2/scenario.py index 04e03ebe7..93c654adf 100644 --- a/vega_sim/scenario/ideal_market_maker_v2/scenario.py +++ b/vega_sim/scenario/ideal_market_maker_v2/scenario.py @@ -1,5 +1,6 @@ import argparse import logging +import numpy as np from typing import Any, Callable, List, Optional from vega_sim.environment.agent import Agent @@ -88,16 +89,20 @@ def __init__( self.backgroundmarket_number_levels_per_side = ( backgroundmarket_number_levels_per_side ) - self.market_name = f"ETH:USD" if market_name is None else market_name - self.asset_name = f"tDAI" if asset_name is None else asset_name + self.market_name = "ETH:USD" if market_name is None else market_name + self.asset_name = "tDAI" if asset_name is None else asset_name - def _generate_price_process(self): + def _generate_price_process( + self, + random_state: Optional[np.random.RandomState] = None, + ): _, price_process = RW_model( T=self.num_steps * self.dt, dt=self.dt, mdp=self.market_decimal, sigma=self.sigma, Midprice=self.initial_price, + random_state=random_state, ) return price_process @@ -105,12 +110,13 @@ def set_up_background_market( self, vega: VegaServiceNull, tag: str = "", + random_state: Optional[np.random.RandomState] = None, ) -> MarketEnvironmentWithState: # Set up market name and settlement asset market_name = self.market_name + f"_{tag}" asset_name = self.asset_name + f"_{tag}" - price_process = self._generate_price_process() + price_process = self._generate_price_process(random_state=random_state) market_maker = OptimalMarketMaker( wallet_name=MM_WALLET.name, @@ -145,6 +151,7 @@ def set_up_background_market( tag=str(tag), buy_intensity=self.buy_intensity, sell_intensity=self.sell_intensity, + random_state=random_state, ) background_market = BackgroundMarket( @@ -207,10 +214,10 @@ def run_iteration( vega: VegaServiceNull, pause_at_completion: bool = False, run_with_console: bool = False, + random_state: Optional[np.random.RandomState] = None, ): env = self.set_up_background_market( - vega=vega, - tag=str(0), + vega=vega, tag=str(0), random_state=random_state ) result = env.run( pause_at_completion=pause_at_completion, diff --git a/vega_sim/scenario/market_crash/scenario.py b/vega_sim/scenario/market_crash/scenario.py index c311af242..4efe13d06 100644 --- a/vega_sim/scenario/market_crash/scenario.py +++ b/vega_sim/scenario/market_crash/scenario.py @@ -65,7 +65,6 @@ def __init__( Callable[[VegaServiceNull, List[Agent]], Any] ] = None, pause_every_n_steps: Optional[int] = None, - random_state: Optional[np.random.RandomState] = None, trim_to_min: Optional[float] = None, ): self.num_steps = num_steps @@ -94,7 +93,6 @@ def __init__( self.noise_buy_intensity = noise_buy_intensity self.noise_sell_intensity = noise_sell_intensity self.pause_every_n_steps = pause_every_n_steps - self.random_state = random_state self.trim_to_min = trim_to_min self.position_taker_mint = position_taker_mint self.num_position_traders = num_position_traders @@ -102,10 +100,12 @@ def __init__( self.settle_at_end = settle_at_end self.initial_asset_mint = initial_asset_mint - def _generate_price_process(self): + def _generate_price_process( + self, + random_state: Optional[np.random.RandomState] = None, + ): return regime_change_random_walk( num_steps=self.num_steps + 1, # Number of steps plus 'initial' state - random_state=self.random_state, sigma_pre=self.sigma_pre, sigma_post=self.sigma_post, drift_pre=self.drift_pre, @@ -114,12 +114,14 @@ def _generate_price_process(self): break_point=self.break_point, decimal_precision=self.market_decimal, trim_to_min=self.trim_to_min, + random_state=random_state, ) def set_up_background_market( self, vega: VegaServiceNull, tag: str = "", + random_state: Optional[np.random.RandomState] = None, ) -> MarketEnvironmentWithState: self.market_name = f"BTC:DAI_{tag}" self.asset_name = f"tDAI{tag}" @@ -154,6 +156,7 @@ def set_up_background_market( initial_asset_mint=self.position_taker_mint, buy_intensity=self.noise_buy_intensity, sell_intensity=self.noise_sell_intensity, + random_state=random_state, ) ) for i in range(self.num_position_traders): @@ -167,6 +170,7 @@ def set_up_background_market( tag=f"{tag}_pos_{i}", buy_intensity=self.position_taker_buy_intensity, sell_intensity=self.position_taker_sell_intensity, + random_state=random_state, ) ) @@ -238,10 +242,10 @@ def run_iteration( vega: VegaServiceNull, pause_at_completion: bool = False, tag: Optional[str] = None, + random_state: Optional[np.random.RandomState] = None, ): env = self.set_up_background_market( - vega=vega, - tag=tag if tag is not None else str(0), + vega=vega, tag=tag if tag is not None else str(0), random_state=random_state ) result = env.run( pause_at_completion=pause_at_completion, diff --git a/vega_sim/scenario/scenario.py b/vega_sim/scenario/scenario.py index f84e4999e..f8bc0f145 100644 --- a/vega_sim/scenario/scenario.py +++ b/vega_sim/scenario/scenario.py @@ -1,8 +1,15 @@ import abc +import numpy as np +from typing import Optional from vega_sim.null_service import VegaServiceNull class Scenario(abc.ABC): - def run_iteration(self, vega: VegaServiceNull, pause_at_completion: bool = False): + def run_iteration( + self, + vega: VegaServiceNull, + pause_at_completion: bool = False, + random_state: Optional[np.random.RandomState] = None, + ): pass