Skip to content

Commit

Permalink
feat: fuzz test plots (#359)
Browse files Browse the repository at this point in the history
* feat: add additional data fn

* feat: update agents

* feat: add coverage plot

* feat: update scenario

* feat: add fuzz plots

* feat: update registry

* feat: update requirements

* feat: add output script

* fix: run make black

* fix: standard outputs

* fix: plot_gen docker

* feat: update colorscale

* feat: address feedback
  • Loading branch information
cdummett authored Mar 21, 2023
1 parent 16bd076 commit 37eb96f
Show file tree
Hide file tree
Showing 15 changed files with 635 additions and 86 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ dmypy.json
.vscode/*

*.jpg
*.html
vega_sim/bin/*
rl_logs/
numerical_results/
Expand Down
26 changes: 15 additions & 11 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ snakeviz = {version = "^2.1.1", optional = true}
pytest-profiling = {version = "^1.7.0", optional = true}
ipywidgets = {version = "^7.7.1", optional = true}
grpc-gateway-protoc-gen-openapiv2 = "^0.1.0"
plotly = {version = "^5.10.0", optional = true}
plotly = "^5.10.0"
TA-Lib = {version = "^0.4.25", optional = true}
python-dotenv = "^0.21.0"
deprecated = "^1.2.13"
Expand All @@ -46,12 +46,8 @@ pytest-xdist = "^2.5.0"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"





[tool.poetry.extras]
learning = ["matplotlib", "tqdm", "torch"]
jupyter = ["jupyterlab", "jupyter", "matplotlib", "plotly", "ipywidgets"]
jupyter = ["jupyterlab", "jupyter", "matplotlib", "ipywidgets"]
profile = ["snakeviz", "pytest-profiling"]
agents = ["TA-Lib"]
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pexpect==4.8.0 ; python_version >= "3.9" and python_version < "3.11" and sys_pla
pickleshare==0.7.5 ; python_version >= "3.9" and python_version < "3.11"
pillow==9.4.0 ; python_version >= "3.9" and python_version < "3.11"
platformdirs==3.0.0 ; python_version >= "3.9" and python_version < "3.11"
plotly==5.13.0 ; python_version >= "3.9" and python_version < "3.11"
pluggy==1.0.0 ; python_version >= "3.9" and python_version < "3.11"
prompt-toolkit==3.0.37 ; python_version >= "3.9" and python_version < "3.11"
protobuf==3.20.3 ; python_version >= "3.9" and python_version < "3.11"
Expand Down Expand Up @@ -84,6 +85,7 @@ scipy==1.10.1 ; python_version >= "3.9" and python_version < "3.11"
setuptools==67.4.0 ; python_version >= "3.9" and python_version < "3.11"
six==1.16.0 ; python_version >= "3.9" and python_version < "3.11"
stack-data==0.6.2 ; python_version >= "3.9" and python_version < "3.11"
tenacity==8.2.1 ; python_version >= "3.9" and python_version < "3.11"
toml==0.10.2 ; python_version >= "3.9" and python_version < "3.11"
tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.11"
tornado==6.2 ; python_version >= "3.9" and python_version < "3.11"
Expand Down
2 changes: 2 additions & 0 deletions requirements-learning.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pexpect==4.8.0 ; python_version >= "3.9" and python_version < "3.11" and sys_pla
pickleshare==0.7.5 ; python_version >= "3.9" and python_version < "3.11"
pillow==9.4.0 ; python_version >= "3.9" and python_version < "3.11"
platformdirs==3.0.0 ; python_version >= "3.9" and python_version < "3.11"
plotly==5.13.0 ; python_version >= "3.9" and python_version < "3.11"
pluggy==1.0.0 ; python_version >= "3.9" and python_version < "3.11"
prompt-toolkit==3.0.37 ; python_version >= "3.9" and python_version < "3.11"
protobuf==3.20.3 ; python_version >= "3.9" and python_version < "3.11"
Expand Down Expand Up @@ -84,6 +85,7 @@ scipy==1.10.1 ; python_version >= "3.9" and python_version < "3.11"
setuptools==67.4.0 ; python_version >= "3.9" and python_version < "3.11"
six==1.16.0 ; python_version >= "3.9" and python_version < "3.11"
stack-data==0.6.2 ; python_version >= "3.9" and python_version < "3.11"
tenacity==8.2.1 ; python_version >= "3.9" and python_version < "3.11"
toml==0.10.2 ; python_version >= "3.9" and python_version < "3.11"
tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.11"
torch==1.12.1 ; python_version >= "3.9" and python_version < "3.11"
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ numpy==1.24.2 ; python_version >= "3.9" and python_version < "3.11"
packaging==23.0 ; python_version >= "3.9" and python_version < "3.11"
pandas==1.5.3 ; python_version >= "3.9" and python_version < "3.11"
pillow==9.4.0 ; python_version >= "3.9" and python_version < "3.11"
plotly==5.13.0 ; python_version >= "3.9" and python_version < "3.11"
protobuf==3.20.3 ; python_version >= "3.9" and python_version < "3.11"
pycparser==2.21 ; python_version >= "3.9" and python_version < "3.11"
pynacl==1.5.0 ; python_version >= "3.9" and python_version < "3.11"
Expand All @@ -29,6 +30,7 @@ requests==2.28.2 ; python_version >= "3.9" and python_version < "3.11"
scipy==1.10.1 ; python_version >= "3.9" and python_version < "3.11"
setuptools==67.4.0 ; python_version >= "3.9" and python_version < "3.11"
six==1.16.0 ; python_version >= "3.9" and python_version < "3.11"
tenacity==8.2.1 ; python_version >= "3.9" and python_version < "3.11"
toml==0.10.2 ; python_version >= "3.9" and python_version < "3.11"
urllib3==1.26.14 ; python_version >= "3.9" and python_version < "3.11"
wrapt==1.14.1 ; python_version >= "3.9" and python_version < "3.11"
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-docker-fuzz-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ docker run \
--platform linux/amd64 \
-v "${RESULT_DIR}:/tmp" \
vega_sim_learning:latest \
python -m vega_sim.scenario.adhoc -s fuzz_test
python -m vega_sim.scenario.fuzzed_markets.run_fuzz_test --steps 2*60*24
10 changes: 7 additions & 3 deletions tests/integration/test_plot_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ def generate_trading_plot():
opening_auction_trade_amount=0.0001,
market_order_trader_base_order_size=0.01,
)
with VegaServiceNull(warn_on_raw_data_access=False, retain_log_files=True) as vega:
with VegaServiceNull(
warn_on_raw_data_access=False,
retain_log_files=True,
) as vega:
scen.run_iteration(vega=vega, output_data=True)
plot = plot_run_outputs()
plot.savefig("run.jpg")
figs = plot_run_outputs()
for key, value in figs.items():
value.savefig(f"run.jpg")


if __name__ == "__main__":
Expand Down
Loading

0 comments on commit 37eb96f

Please sign in to comment.