From c836683a0a463cbb466bb86f1bbfebd6788ce595 Mon Sep 17 00:00:00 2001 From: pciturri Date: Mon, 29 Jul 2024 18:08:40 +0200 Subject: [PATCH] examples: added new case_f, which includes a series of flat file, time-dependent forecasts. Time-dependent examples with source code, were displaced to case_g and case_h fix: now reading catalog forecasts from file, includes the option to auto-filter spatially on read. tests: added (new) case_f and case_g (old case_f) to qa_tests. Fixed existing tests for these commit's changes --- examples/case_g/config.yml | 9 +++--- examples/case_g/models.yml | 29 +++---------------- examples/{case_f => case_g}/pymock/Dockerfile | 0 examples/{case_f => case_g}/pymock/README.md | 0 .../{case_f => case_g}/pymock/input/args.txt | 0 .../pymock/pymock/__init__.py | 0 .../{case_f => case_g}/pymock/pymock/libs.py | 0 .../{case_f => case_g}/pymock/pymock/main.py | 0 .../{case_f => case_g}/pymock/pyproject.toml | 0 .../pymock/requirements.txt | 0 examples/{case_f => case_g}/pymock/run.py | 0 examples/{case_f => case_g}/pymock/setup.cfg | 0 examples/{case_f => case_g}/pymock/setup.py | 0 examples/case_g/tests.yml | 2 -- examples/{case_f => case_h}/catalog.csv | 0 examples/case_h/config.yml | 19 ++++++++++++ examples/case_h/models.yml | 28 ++++++++++++++++++ examples/case_h/tests.yml | 16 ++++++++++ 18 files changed, 72 insertions(+), 31 deletions(-) rename examples/{case_f => case_g}/pymock/Dockerfile (100%) rename examples/{case_f => case_g}/pymock/README.md (100%) rename examples/{case_f => case_g}/pymock/input/args.txt (100%) rename examples/{case_f => case_g}/pymock/pymock/__init__.py (100%) rename examples/{case_f => case_g}/pymock/pymock/libs.py (100%) rename examples/{case_f => case_g}/pymock/pymock/main.py (100%) rename examples/{case_f => case_g}/pymock/pyproject.toml (100%) rename examples/{case_f => case_g}/pymock/requirements.txt (100%) rename examples/{case_f => case_g}/pymock/run.py (100%) rename examples/{case_f => case_g}/pymock/setup.cfg (100%) rename examples/{case_f => case_g}/pymock/setup.py (100%) rename examples/{case_f => case_h}/catalog.csv (100%) create mode 100644 examples/case_h/config.yml create mode 100644 examples/case_h/models.yml create mode 100644 examples/case_h/tests.yml diff --git a/examples/case_g/config.yml b/examples/case_g/config.yml index 5130376..5a56a93 100644 --- a/examples/case_g/config.yml +++ b/examples/case_g/config.yml @@ -1,9 +1,9 @@ -name: case_f +name: case_g time_config: - start_date: 2016-8-25T00:00:00 - end_date: 2016-8-27T00:00:00 - horizon: 1days + start_date: 2012-5-23T00:00:00 + end_date: 2012-6-23T00:00:00 + horizon: 7days exp_class: td region_config: @@ -14,6 +14,7 @@ region_config: depth_min: 0 depth_max: 70 +force_rerun: True catalog: catalog.csv model_config: models.yml test_config: tests.yml \ No newline at end of file diff --git a/examples/case_g/models.yml b/examples/case_g/models.yml index 7129da4..90e1247 100644 --- a/examples/case_g/models.yml +++ b/examples/case_g/models.yml @@ -1,28 +1,7 @@ -- etas: - giturl: https://git.gfz-potsdam.de/csep/it_experiment/models/vetas.git - args_file: input/args.json - path: models/etas - func: etas-run +- pymock: + path: pymock + func: python run.py func_kwargs: - n_sims: 1000 - mc: 3.5 - build: pip -- Poisson Mock: - giturl: https://git.gfz-potsdam.de/csep/it_experiment/models/pymock.git - path: models/pymock_poisson - func: pymock - prefix: pymock - func_kwargs: - n_sims: 1000 - mag_min: 3.5 - build: pip -- Negbinom Mock: - giturl: https://git.gfz-potsdam.de/csep/it_experiment/models/pymock.git - path: models/pymock_nb - func: pymock - func_kwargs: - n_sims: 1000 + n_sims: 100 mag_min: 3.5 - distribution: negbinom build: pip - prefix: pymock diff --git a/examples/case_f/pymock/Dockerfile b/examples/case_g/pymock/Dockerfile similarity index 100% rename from examples/case_f/pymock/Dockerfile rename to examples/case_g/pymock/Dockerfile diff --git a/examples/case_f/pymock/README.md b/examples/case_g/pymock/README.md similarity index 100% rename from examples/case_f/pymock/README.md rename to examples/case_g/pymock/README.md diff --git a/examples/case_f/pymock/input/args.txt b/examples/case_g/pymock/input/args.txt similarity index 100% rename from examples/case_f/pymock/input/args.txt rename to examples/case_g/pymock/input/args.txt diff --git a/examples/case_f/pymock/pymock/__init__.py b/examples/case_g/pymock/pymock/__init__.py similarity index 100% rename from examples/case_f/pymock/pymock/__init__.py rename to examples/case_g/pymock/pymock/__init__.py diff --git a/examples/case_f/pymock/pymock/libs.py b/examples/case_g/pymock/pymock/libs.py similarity index 100% rename from examples/case_f/pymock/pymock/libs.py rename to examples/case_g/pymock/pymock/libs.py diff --git a/examples/case_f/pymock/pymock/main.py b/examples/case_g/pymock/pymock/main.py similarity index 100% rename from examples/case_f/pymock/pymock/main.py rename to examples/case_g/pymock/pymock/main.py diff --git a/examples/case_f/pymock/pyproject.toml b/examples/case_g/pymock/pyproject.toml similarity index 100% rename from examples/case_f/pymock/pyproject.toml rename to examples/case_g/pymock/pyproject.toml diff --git a/examples/case_f/pymock/requirements.txt b/examples/case_g/pymock/requirements.txt similarity index 100% rename from examples/case_f/pymock/requirements.txt rename to examples/case_g/pymock/requirements.txt diff --git a/examples/case_f/pymock/run.py b/examples/case_g/pymock/run.py similarity index 100% rename from examples/case_f/pymock/run.py rename to examples/case_g/pymock/run.py diff --git a/examples/case_f/pymock/setup.cfg b/examples/case_g/pymock/setup.cfg similarity index 100% rename from examples/case_f/pymock/setup.cfg rename to examples/case_g/pymock/setup.cfg diff --git a/examples/case_f/pymock/setup.py b/examples/case_g/pymock/setup.py similarity index 100% rename from examples/case_f/pymock/setup.py rename to examples/case_g/pymock/setup.py diff --git a/examples/case_g/tests.yml b/examples/case_g/tests.yml index 5dc7459..67315da 100644 --- a/examples/case_g/tests.yml +++ b/examples/case_g/tests.yml @@ -1,7 +1,5 @@ - Catalog_N-test: func: catalog_evaluations.number_test - func_kwargs: - verbose: False plot_func: - plot_number_test: plot_args: diff --git a/examples/case_f/catalog.csv b/examples/case_h/catalog.csv similarity index 100% rename from examples/case_f/catalog.csv rename to examples/case_h/catalog.csv diff --git a/examples/case_h/config.yml b/examples/case_h/config.yml new file mode 100644 index 0000000..5130376 --- /dev/null +++ b/examples/case_h/config.yml @@ -0,0 +1,19 @@ +name: case_f + +time_config: + start_date: 2016-8-25T00:00:00 + end_date: 2016-8-27T00:00:00 + horizon: 1days + exp_class: td + +region_config: + region: italy_csep_region + mag_min: 3.5 + mag_max: 8.0 + mag_bin: 0.5 + depth_min: 0 + depth_max: 70 + +catalog: catalog.csv +model_config: models.yml +test_config: tests.yml \ No newline at end of file diff --git a/examples/case_h/models.yml b/examples/case_h/models.yml new file mode 100644 index 0000000..7129da4 --- /dev/null +++ b/examples/case_h/models.yml @@ -0,0 +1,28 @@ +- etas: + giturl: https://git.gfz-potsdam.de/csep/it_experiment/models/vetas.git + args_file: input/args.json + path: models/etas + func: etas-run + func_kwargs: + n_sims: 1000 + mc: 3.5 + build: pip +- Poisson Mock: + giturl: https://git.gfz-potsdam.de/csep/it_experiment/models/pymock.git + path: models/pymock_poisson + func: pymock + prefix: pymock + func_kwargs: + n_sims: 1000 + mag_min: 3.5 + build: pip +- Negbinom Mock: + giturl: https://git.gfz-potsdam.de/csep/it_experiment/models/pymock.git + path: models/pymock_nb + func: pymock + func_kwargs: + n_sims: 1000 + mag_min: 3.5 + distribution: negbinom + build: pip + prefix: pymock diff --git a/examples/case_h/tests.yml b/examples/case_h/tests.yml new file mode 100644 index 0000000..5dc7459 --- /dev/null +++ b/examples/case_h/tests.yml @@ -0,0 +1,16 @@ +- Catalog_N-test: + func: catalog_evaluations.number_test + func_kwargs: + verbose: False + plot_func: + - plot_number_test: + plot_args: + title: 1 + name: 1 + - plot_consistency_test: + plot_kwargs: + one_sided_lower: True + + + +