floatcsep 0.2.1__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {floatcsep-0.2.1/floatcsep.egg-info → floatcsep-0.3.0}/PKG-INFO +2 -2
- {floatcsep-0.2.1 → floatcsep-0.3.0}/README.md +1 -1
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/__init__.py +1 -1
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/evaluation.py +3 -3
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/experiment.py +27 -23
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/infrastructure/environments.py +113 -8
- floatcsep-0.3.0/floatcsep/infrastructure/logger.py +133 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/infrastructure/registries.py +291 -212
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/infrastructure/repositories.py +250 -223
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/model.py +71 -20
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/postprocess/plot_handler.py +10 -10
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/postprocess/reporting.py +5 -5
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/utils/accessors.py +9 -5
- floatcsep-0.2.1/floatcsep/utils/readers.py → floatcsep-0.3.0/floatcsep/utils/file_io.py +180 -6
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/utils/helpers.py +13 -12
- {floatcsep-0.2.1 → floatcsep-0.3.0/floatcsep.egg-info}/PKG-INFO +2 -2
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep.egg-info/SOURCES.txt +17 -5
- floatcsep-0.3.0/tests/artifacts/models/docker_test/invalid_entrypoint/Dockerfile +2 -0
- floatcsep-0.3.0/tests/artifacts/models/docker_test/invalid_image/Dockerfile +1 -0
- floatcsep-0.3.0/tests/artifacts/models/docker_test/invalid_no_entrypoint/Dockerfile +2 -0
- floatcsep-0.3.0/tests/artifacts/models/docker_test/invalid_permission/Dockerfile +2 -0
- floatcsep-0.3.0/tests/artifacts/models/docker_test/valid/Dockerfile +2 -0
- floatcsep-0.3.0/tests/artifacts/models/docker_test/valid_custom_uid-gid/Dockerfile +4 -0
- floatcsep-0.3.0/tests/artifacts/models/td_model/forecasts/mock_2020-01-01_2020-01-02.csv +2 -0
- floatcsep-0.3.0/tests/artifacts/models/td_model/forecasts/mock_2020-01-02_2020-01-03.csv +2 -0
- floatcsep-0.2.1/tests/integration/test_model_interface.py → floatcsep-0.3.0/tests/integration/test_model_accessors.py +8 -122
- floatcsep-0.3.0/tests/integration/test_model_docker.py +119 -0
- floatcsep-0.3.0/tests/integration/test_model_infrastructure.py +130 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/unit/test_environments.py +142 -3
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/unit/test_experiment.py +2 -1
- floatcsep-0.2.1/tests/unit/test_readers.py → floatcsep-0.3.0/tests/unit/test_io.py +16 -16
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/unit/test_model.py +18 -17
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/unit/test_plot_handler.py +2 -2
- floatcsep-0.3.0/tests/unit/test_registry.py +179 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/unit/test_reporting.py +1 -1
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/unit/test_repositories.py +23 -19
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/unit/test_utils.py +19 -19
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_h/custom_report.py +3 -3
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_h/models.yml +1 -1
- floatcsep-0.3.0/tutorials/case_i/catalog.csep +7232 -0
- floatcsep-0.3.0/tutorials/case_i/config.yml +25 -0
- floatcsep-0.3.0/tutorials/case_i/models.yml +14 -0
- floatcsep-0.3.0/tutorials/case_i/tests.yml +6 -0
- floatcsep-0.2.1/floatcsep/infrastructure/logger.py +0 -62
- floatcsep-0.2.1/tests/artifacts/models/td_model/forecasts/mock_2020-01-01_2020-01-02.csv +0 -2
- floatcsep-0.2.1/tests/artifacts/models/td_model/forecasts/mock_2020-01-02_2020-01-03.csv +0 -2
- floatcsep-0.2.1/tests/unit/test_registry.py +0 -95
- {floatcsep-0.2.1 → floatcsep-0.3.0}/.github/workflows/build-sphinx.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/.github/workflows/build-test.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/.github/workflows/publish-pypi.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/.github/workflows/release-tutorials.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/.readthedocs.yaml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/CODE_OF_CONDUCT.md +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/CONTRIBUTING.md +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/CREDITS.md +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/LICENSE +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/MANIFEST.in +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/Makefile +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/_static/CSEP2_Logo_CMYK.png +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/_static/custom.js +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/_static/experiment_classes.png +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/_static/floatCSEP_Logo_CMYK.png +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/_static/float_scheme.png +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/_static/floatcsep_logo.svg +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/conf.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/guide/evaluation_config.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/guide/executing_experiment.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/guide/experiment_config.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/guide/model_config.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/guide/postprocess_config.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/index.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/intro/concepts.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/intro/installation.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/reference/api_reference.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/reference/commands.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/reference/evaluation.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/reference/experiment.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/reference/infrastructure.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/reference/model.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/reference/postprocess.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/reference/utilities.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/tutorials/case_a.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/tutorials/case_b.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/tutorials/case_c.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/tutorials/case_d.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/tutorials/case_e.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/tutorials/case_f.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/tutorials/case_g.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/docs/tutorials/case_h.rst +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/environment.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/commands/__init__.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/commands/main.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/infrastructure/__init__.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/infrastructure/engine.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/postprocess/__init__.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep/utils/__init__.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep.egg-info/dependency_links.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep.egg-info/entry_points.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep.egg-info/not-zip-safe +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep.egg-info/requires.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/floatcsep.egg-info/top_level.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/pyproject.toml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/requirements.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/requirements_dev.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/setup.cfg +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/setup.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/catalog.json +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/evaluations/tests_cfg.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/gcmt/vcr_search.yaml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/gcmt/vcr_summary.yaml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/model.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/model_cfg.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/model_h5.hdf5 +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/qtree/TEAM=N10L11.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/qtree/TEAM=N25L11.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/td_model/input/args.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/td_model/setup.cfg +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/Dockerfile +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/README.md +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/docs/userguide +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/examples/case_3/case3_run +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/examples/case_3/data/case3_catalog +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/forecasts/template_2023-01-01 +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/input/catalog +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/parameters +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/requirements +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/run +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/run_tests +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/setup +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/source/lib_a +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/source/lib_b +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/source/main +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/tests/test_liba +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/tests/test_libb +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/models/template/tests/test_main +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/regions/italy_midpoints +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/artifacts/regions/mock_region +0 -0
- {floatcsep-0.2.1/tests/qa → floatcsep-0.3.0/tests/e2e}/test_data.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/integration/experiment typologies +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/unit/test_accessors.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/unit/test_commands.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/unit/test_engine.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tests/unit/test_evaluation.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tox.ini +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_a/best_model.dat +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_a/case_a.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_a/catalog.csep +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_a/config.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_a/region.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_b/case_b.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_b/catalog.json +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_b/config.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_b/models/model_a.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_b/models/model_b.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_b/models/model_c.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_b/models/model_d.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_b/models.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_b/region.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_b/tests.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_c/case_c.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_c/catalog.json +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_c/config.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_c/models/model_a.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_c/models/model_b.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_c/models/model_c.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_c/models/model_d.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_c/models.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_c/region.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_c/tests.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_d/config.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_d/models.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_d/tests.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_e/case_e.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_e/catalog.json +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_e/config.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_e/models/gulia-wiemer.ALM.italy.10yr.2010-01-01.xml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_e/models/meletti.MPS04.italy.10yr.2010-01-01.xml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_e/models/zechar.TripleS-CPTI.italy.10yr.2010-01-01.xml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_e/models.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_e/tests.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_f/catalog.json +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_f/config.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_f/etas/forecasts/etas_2016-11-14_2016-11-15.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_f/etas/forecasts/etas_2016-11-15_2016-11-16.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_f/etas/forecasts/etas_2016-11-16_2016-11-17.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_f/etas/forecasts/etas_2016-11-17_2016-11-18.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_f/etas/forecasts/etas_2016-11-18_2016-11-19.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_f/etas/forecasts/etas_2016-11-19_2016-11-20.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_f/etas/forecasts/etas_2016-11-20_2016-11-21.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_f/models.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_f/tests.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/catalog.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/config.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/custom_plot_script.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/models.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/pymock/Dockerfile +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/pymock/README.md +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/pymock/input/args.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/pymock/pymock/__init__.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/pymock/pymock/libs.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/pymock/pymock/main.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/pymock/pyproject.toml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/pymock/requirements.txt +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/pymock/run.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/pymock/setup.cfg +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/pymock/setup.py +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_g/tests.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_h/catalog.csv +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_h/config.yml +0 -0
- {floatcsep-0.2.1 → floatcsep-0.3.0}/tutorials/case_h/tests.yml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: floatcsep
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: CSEP Floating Experiment application
|
|
5
5
|
Home-page: https://github.com/cseptesting/floatcsep.git
|
|
6
6
|
Author: Pablo Iturrieta
|
|
@@ -162,7 +162,7 @@ the tutorials**!
|
|
|
162
162
|
# Roadmap and Known Issues
|
|
163
163
|
|
|
164
164
|
* Create tool to check a TD model's interface with ``floatcsep``
|
|
165
|
-
* Define a dependency strategy to ensure experiments' reproducibility.
|
|
165
|
+
* Define a dependency strategy to ensure experiments' reproducibility (e.g., storing docker image).
|
|
166
166
|
* Implement spatial database and HDF5 experiment storage feature
|
|
167
167
|
* Set up task parallelization
|
|
168
168
|
* Document the process of an experiment deployment
|
|
@@ -89,7 +89,7 @@ the tutorials**!
|
|
|
89
89
|
# Roadmap and Known Issues
|
|
90
90
|
|
|
91
91
|
* Create tool to check a TD model's interface with ``floatcsep``
|
|
92
|
-
* Define a dependency strategy to ensure experiments' reproducibility.
|
|
92
|
+
* Define a dependency strategy to ensure experiments' reproducibility (e.g., storing docker image).
|
|
93
93
|
* Implement spatial database and HDF5 experiment storage feature
|
|
94
94
|
* Set up task parallelization
|
|
95
95
|
* Document the process of an experiment deployment
|
|
@@ -2,7 +2,7 @@ from floatcsep import evaluation
|
|
|
2
2
|
from floatcsep import experiment
|
|
3
3
|
from floatcsep import model
|
|
4
4
|
from floatcsep.infrastructure import engine, environments, registries, repositories, logger
|
|
5
|
-
from floatcsep.utils import
|
|
5
|
+
from floatcsep.utils import file_io, accessors, helpers
|
|
6
6
|
from floatcsep.postprocess import reporting, plot_handler
|
|
7
7
|
|
|
8
8
|
from importlib.metadata import version, PackageNotFoundError
|
|
@@ -287,7 +287,7 @@ class Evaluation:
|
|
|
287
287
|
# Regular consistency/comparative test plots (e.g., many models)
|
|
288
288
|
try:
|
|
289
289
|
for time_str in timewindow:
|
|
290
|
-
fig_path = registry.
|
|
290
|
+
fig_path = registry.get_figure_key(time_str, self.name)
|
|
291
291
|
results = self.read_results(time_str, models)
|
|
292
292
|
ax = func(results, plot_args=fargs, **fkwargs)
|
|
293
293
|
if "code" in fargs:
|
|
@@ -307,7 +307,7 @@ class Evaluation:
|
|
|
307
307
|
registry.figures[time_str][fig_name] = os.path.join(
|
|
308
308
|
time_str, "figures", fig_name
|
|
309
309
|
)
|
|
310
|
-
fig_path = registry.
|
|
310
|
+
fig_path = registry.get_figure_key(time_str, fig_name)
|
|
311
311
|
ax = func(result, plot_args=fargs, **fkwargs, show=False)
|
|
312
312
|
if "code" in fargs:
|
|
313
313
|
exec(fargs["code"])
|
|
@@ -318,7 +318,7 @@ class Evaluation:
|
|
|
318
318
|
pyplot.show()
|
|
319
319
|
|
|
320
320
|
elif self.type in ["sequential", "sequential_comparative", "batch"]:
|
|
321
|
-
fig_path = registry.
|
|
321
|
+
fig_path = registry.get_figure_key(timewindow[-1], self.name)
|
|
322
322
|
results = self.read_results(timewindow[-1], models)
|
|
323
323
|
ax = func(results, plot_args=fargs, **fkwargs)
|
|
324
324
|
|
|
@@ -25,6 +25,7 @@ from floatcsep.utils.helpers import (
|
|
|
25
25
|
parse_nested_dicts,
|
|
26
26
|
)
|
|
27
27
|
from floatcsep.infrastructure.engine import Task, TaskGraph
|
|
28
|
+
from floatcsep.infrastructure.logger import log_models_tree, log_results_tree
|
|
28
29
|
|
|
29
30
|
log = logging.getLogger("floatLogger")
|
|
30
31
|
|
|
@@ -52,8 +53,8 @@ class Experiment:
|
|
|
52
53
|
- growth (:class:`str`): `incremental` or `cumulative`
|
|
53
54
|
- offset (:class:`float`): recurrence of forecast creation.
|
|
54
55
|
|
|
55
|
-
For further details, see :func:`~floatcsep.utils.
|
|
56
|
-
and :func:`~floatcsep.utils.
|
|
56
|
+
For further details, see :func:`~floatcsep.utils.time_windows_ti`
|
|
57
|
+
and :func:`~floatcsep.utils.time_windows_td`
|
|
57
58
|
|
|
58
59
|
region_config (dict): Contains all the spatial and magnitude
|
|
59
60
|
specifications. It must contain the following keys:
|
|
@@ -75,6 +76,7 @@ class Experiment:
|
|
|
75
76
|
|
|
76
77
|
model_config (str): Path to the models' configuration file
|
|
77
78
|
test_config (str): Path to the evaluations' configuration file
|
|
79
|
+
run_mode (str): 'sequential' or 'parallel'
|
|
78
80
|
default_test_kwargs (dict): Default values for the testing
|
|
79
81
|
(seed, number of simulations, etc.)
|
|
80
82
|
postprocess (dict): Contains the instruction for postprocessing
|
|
@@ -99,6 +101,7 @@ class Experiment:
|
|
|
99
101
|
postprocess: str = None,
|
|
100
102
|
default_test_kwargs: dict = None,
|
|
101
103
|
rundir: str = "results",
|
|
104
|
+
run_mode: str = "sequential",
|
|
102
105
|
report_hook: dict = None,
|
|
103
106
|
**kwargs,
|
|
104
107
|
) -> None:
|
|
@@ -118,7 +121,7 @@ class Experiment:
|
|
|
118
121
|
os.makedirs(os.path.join(workdir, rundir), exist_ok=True)
|
|
119
122
|
|
|
120
123
|
self.name = name if name else "floatingExp"
|
|
121
|
-
self.registry = ExperimentRegistry(workdir, rundir)
|
|
124
|
+
self.registry = ExperimentRegistry.factory(workdir=workdir, run_dir=rundir)
|
|
122
125
|
self.results_repo = ResultsRepository(self.registry)
|
|
123
126
|
self.catalog_repo = CatalogRepository(self.registry)
|
|
124
127
|
|
|
@@ -126,6 +129,7 @@ class Experiment:
|
|
|
126
129
|
self.original_config = kwargs.get("original_config", None)
|
|
127
130
|
self.original_run_dir = kwargs.get("original_rundir", None)
|
|
128
131
|
self.run_dir = rundir
|
|
132
|
+
self.run_mode = run_mode
|
|
129
133
|
self.seed = kwargs.get("seed", None)
|
|
130
134
|
self.time_config = read_time_cfg(time_config, **kwargs)
|
|
131
135
|
self.region_config = read_region_cfg(region_config, **kwargs)
|
|
@@ -143,7 +147,7 @@ class Experiment:
|
|
|
143
147
|
log.info(f"Setting up experiment {self.name}:")
|
|
144
148
|
log.info(f"\tStart: {self.start_date}")
|
|
145
149
|
log.info(f"\tEnd: {self.end_date}")
|
|
146
|
-
log.info(f"\tTime windows: {len(self.
|
|
150
|
+
log.info(f"\tTime windows: {len(self.time_windows)}")
|
|
147
151
|
log.info(f"\tRegion: {self.region.name if self.region else None}")
|
|
148
152
|
log.info(
|
|
149
153
|
f"\tMagnitude range: [{numpy.min(self.magnitudes)},"
|
|
@@ -175,7 +179,7 @@ class Experiment:
|
|
|
175
179
|
Override built-in method to return the experiment attributes by also using the command
|
|
176
180
|
``experiment.{attr}``. Adds also to the experiment scope the keys of
|
|
177
181
|
:attr:`region_config` or :attr:`time_config`. These are: ``start_date``, ``end_date``,
|
|
178
|
-
``
|
|
182
|
+
``time_windows``, ``horizon``, ``offset``, ``region``, ``magnitudes``, ``mag_min``,
|
|
179
183
|
`mag_max``, ``mag_bin``, ``depth_min`` depth_max .
|
|
180
184
|
"""
|
|
181
185
|
|
|
@@ -295,8 +299,8 @@ class Experiment:
|
|
|
295
299
|
"""
|
|
296
300
|
log.info("Staging models")
|
|
297
301
|
for i in self.models:
|
|
298
|
-
i.stage(self.
|
|
299
|
-
self.registry.
|
|
302
|
+
i.stage(self.time_windows, run_mode=self.run_mode, run_dir=self.run_dir)
|
|
303
|
+
self.registry.add_model_registry(i)
|
|
300
304
|
|
|
301
305
|
def set_tests(self, test_config: Union[str, Dict, List]) -> list:
|
|
302
306
|
"""
|
|
@@ -376,17 +380,17 @@ class Experiment:
|
|
|
376
380
|
"""
|
|
377
381
|
|
|
378
382
|
# Set the file path structure
|
|
379
|
-
self.registry.build_tree(self.
|
|
383
|
+
self.registry.build_tree(self.time_windows, self.models, self.tests, self.run_mode)
|
|
380
384
|
|
|
381
385
|
log.debug("Pre-run forecast summary")
|
|
382
|
-
self.registry
|
|
386
|
+
log_models_tree(log, self.registry, self.time_windows)
|
|
383
387
|
log.debug("Pre-run result summary")
|
|
384
|
-
self.registry
|
|
388
|
+
log_results_tree(log, self.registry)
|
|
385
389
|
|
|
386
390
|
log.info("Setting up experiment's tasks")
|
|
387
391
|
|
|
388
392
|
# Get the time windows strings
|
|
389
|
-
tw_strings = timewindow2str(self.
|
|
393
|
+
tw_strings = timewindow2str(self.time_windows)
|
|
390
394
|
|
|
391
395
|
# Prepare the testing catalogs
|
|
392
396
|
task_graph = TaskGraph()
|
|
@@ -481,7 +485,7 @@ class Experiment:
|
|
|
481
485
|
)
|
|
482
486
|
# Set up the Sequential_Comparative Scores
|
|
483
487
|
elif test_k.type == "sequential_comparative":
|
|
484
|
-
tw_strs = timewindow2str(self.
|
|
488
|
+
tw_strs = timewindow2str(self.time_windows)
|
|
485
489
|
for model_j in self.models:
|
|
486
490
|
task_k = Task(
|
|
487
491
|
instance=test_k,
|
|
@@ -504,7 +508,7 @@ class Experiment:
|
|
|
504
508
|
)
|
|
505
509
|
# Set up the Batch comparative Scores
|
|
506
510
|
elif test_k.type == "batch":
|
|
507
|
-
time_str = timewindow2str(self.
|
|
511
|
+
time_str = timewindow2str(self.time_windows[-1])
|
|
508
512
|
for model_j in self.models:
|
|
509
513
|
task_k = Task(
|
|
510
514
|
instance=test_k,
|
|
@@ -540,9 +544,9 @@ class Experiment:
|
|
|
540
544
|
self.task_graph.run()
|
|
541
545
|
log.info("Calculation completed")
|
|
542
546
|
log.debug("Post-run forecast registry")
|
|
543
|
-
self.registry
|
|
547
|
+
log_models_tree(log, self.registry, self.time_windows)
|
|
544
548
|
log.debug("Post-run result summary")
|
|
545
|
-
self.registry
|
|
549
|
+
log_results_tree(log, self.registry)
|
|
546
550
|
|
|
547
551
|
def read_results(self, test: Evaluation, window: str) -> List:
|
|
548
552
|
"""
|
|
@@ -559,7 +563,7 @@ class Experiment:
|
|
|
559
563
|
|
|
560
564
|
"""
|
|
561
565
|
log.info("Creating reproducibility config file")
|
|
562
|
-
repr_config = self.registry.
|
|
566
|
+
repr_config = self.registry.get_attr("repr_config")
|
|
563
567
|
|
|
564
568
|
# Dropping region to results folder if it is a file
|
|
565
569
|
region_path = self.region_config.get("path", False)
|
|
@@ -604,7 +608,7 @@ class Experiment:
|
|
|
604
608
|
"time_config": {
|
|
605
609
|
i: j
|
|
606
610
|
for i, j in self.time_config.items()
|
|
607
|
-
if (i not in ("
|
|
611
|
+
if (i not in ("time_windows",) or extended)
|
|
608
612
|
},
|
|
609
613
|
"region_config": {
|
|
610
614
|
i: j
|
|
@@ -731,7 +735,7 @@ class ExperimentComparison:
|
|
|
731
735
|
|
|
732
736
|
def get_results(self):
|
|
733
737
|
|
|
734
|
-
win_orig = timewindow2str(self.original.
|
|
738
|
+
win_orig = timewindow2str(self.original.time_windows)
|
|
735
739
|
|
|
736
740
|
tests_orig = self.original.tests
|
|
737
741
|
|
|
@@ -787,7 +791,7 @@ class ExperimentComparison:
|
|
|
787
791
|
|
|
788
792
|
def get_filecomp(self):
|
|
789
793
|
|
|
790
|
-
win_orig = timewindow2str(self.original.
|
|
794
|
+
win_orig = timewindow2str(self.original.time_windows)
|
|
791
795
|
|
|
792
796
|
tests_orig = self.original.tests
|
|
793
797
|
|
|
@@ -801,8 +805,8 @@ class ExperimentComparison:
|
|
|
801
805
|
for tw in win_orig:
|
|
802
806
|
results[test.name][tw] = dict.fromkeys(models_orig)
|
|
803
807
|
for model in models_orig:
|
|
804
|
-
orig_path = self.original.registry.
|
|
805
|
-
repr_path = self.reproduced.registry.
|
|
808
|
+
orig_path = self.original.registry.get_result_key(tw, test, model)
|
|
809
|
+
repr_path = self.reproduced.registry.get_result_key(tw, test, model)
|
|
806
810
|
|
|
807
811
|
results[test.name][tw][model] = {
|
|
808
812
|
"hash": (self.get_hash(orig_path) == self.get_hash(repr_path)),
|
|
@@ -811,8 +815,8 @@ class ExperimentComparison:
|
|
|
811
815
|
else:
|
|
812
816
|
results[test.name] = dict.fromkeys(models_orig)
|
|
813
817
|
for model in models_orig:
|
|
814
|
-
orig_path = self.original.registry.
|
|
815
|
-
repr_path = self.reproduced.registry.
|
|
818
|
+
orig_path = self.original.registry.get_result_key(win_orig[-1], test, model)
|
|
819
|
+
repr_path = self.reproduced.registry.get_result_key(win_orig[-1], test, model)
|
|
816
820
|
results[test.name][model] = {
|
|
817
821
|
"hash": (self.get_hash(orig_path) == self.get_hash(repr_path)),
|
|
818
822
|
"byte2byte": filecmp.cmp(orig_path, repr_path),
|
|
@@ -9,6 +9,8 @@ import venv
|
|
|
9
9
|
from abc import ABC, abstractmethod
|
|
10
10
|
from typing import Union
|
|
11
11
|
|
|
12
|
+
import docker
|
|
13
|
+
from docker.errors import ImageNotFound, NotFound, APIError
|
|
12
14
|
from packaging.specifiers import SpecifierSet
|
|
13
15
|
|
|
14
16
|
log = logging.getLogger("floatLogger")
|
|
@@ -387,20 +389,123 @@ class DockerManager(EnvironmentManager):
|
|
|
387
389
|
"""
|
|
388
390
|
|
|
389
391
|
def __init__(self, base_name: str, model_directory: str) -> None:
|
|
390
|
-
self.base_name = base_name
|
|
392
|
+
self.base_name = base_name.replace(" ", "_")
|
|
391
393
|
self.model_directory = model_directory
|
|
392
394
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
+
# use a lower-case slug for tags
|
|
396
|
+
slug = self.base_name.lower()
|
|
397
|
+
self.image_tag = f"{slug}_image"
|
|
398
|
+
self.container_name = f"{slug}_container"
|
|
395
399
|
|
|
396
|
-
|
|
397
|
-
|
|
400
|
+
# Docker SDK client
|
|
401
|
+
self.client = docker.from_env()
|
|
398
402
|
|
|
399
|
-
def
|
|
400
|
-
|
|
403
|
+
def create_environment(self, force: bool = False) -> None:
|
|
404
|
+
"""
|
|
405
|
+
Build (or rebuild) the Docker image for this model.
|
|
406
|
+
"""
|
|
407
|
+
|
|
408
|
+
# If forced, remove the existing image
|
|
409
|
+
if force and self.env_exists():
|
|
410
|
+
log.info(f"[{self.base_name}] Removing existing image '{self.image_tag}'")
|
|
411
|
+
try:
|
|
412
|
+
self.client.images.remove(self.image_tag, force=True)
|
|
413
|
+
except APIError as e:
|
|
414
|
+
log.warning(f"[{self.base_name}] Could not remove image: {e}")
|
|
415
|
+
|
|
416
|
+
# If image is missing or rebuild was requested, build it now
|
|
417
|
+
if force or not self.env_exists():
|
|
418
|
+
build_path = os.path.abspath(self.model_directory)
|
|
419
|
+
uid, gid = os.getuid(), os.getgid()
|
|
420
|
+
build_args = {
|
|
421
|
+
"USER_UID": str(uid),
|
|
422
|
+
"USER_GID": str(gid),
|
|
423
|
+
}
|
|
424
|
+
log.info(f"[{self.base_name}] Building image '{self.image_tag}' from {build_path}")
|
|
425
|
+
|
|
426
|
+
build_logs = self.client.api.build(
|
|
427
|
+
path=build_path,
|
|
428
|
+
tag=self.image_tag,
|
|
429
|
+
rm=True,
|
|
430
|
+
decode=True,
|
|
431
|
+
buildargs=build_args,
|
|
432
|
+
nocache=False # todo: create model arg for --no-cache
|
|
433
|
+
)
|
|
434
|
+
|
|
435
|
+
# Stream each chunk
|
|
436
|
+
for chunk in build_logs:
|
|
437
|
+
if "stream" in chunk:
|
|
438
|
+
for line in chunk["stream"].splitlines():
|
|
439
|
+
log.debug(f"[{self.base_name}][build] {line}")
|
|
440
|
+
elif "errorDetail" in chunk:
|
|
441
|
+
msg = chunk["errorDetail"].get("message", "").strip()
|
|
442
|
+
log.error(f"[{self.base_name}][build error] {msg}")
|
|
443
|
+
raise RuntimeError(f"Docker build error: {msg}")
|
|
444
|
+
log.info(f"[{self.base_name}] Successfully built '{self.image_tag}'")
|
|
445
|
+
|
|
446
|
+
def env_exists(self) -> bool:
|
|
447
|
+
"""
|
|
448
|
+
Checks if the Docker image with the given tag already exists.
|
|
449
|
+
|
|
450
|
+
Returns:
|
|
451
|
+
bool: True if the Docker image exists, False otherwise.
|
|
452
|
+
"""
|
|
453
|
+
"""
|
|
454
|
+
Returns True if an image with our tag already exists locally.
|
|
455
|
+
"""
|
|
456
|
+
try:
|
|
457
|
+
self.client.images.get(self.image_tag)
|
|
458
|
+
return True
|
|
459
|
+
except ImageNotFound:
|
|
460
|
+
return False
|
|
461
|
+
|
|
462
|
+
def run_command(self, command=None) -> None:
|
|
463
|
+
"""
|
|
464
|
+
Runs the model’s Docker container with input/ and forecasts/ mounted.
|
|
465
|
+
Streams logs and checks for non-zero exit codes.
|
|
466
|
+
"""
|
|
467
|
+
model_root = os.path.abspath(self.model_directory)
|
|
468
|
+
mounts = {
|
|
469
|
+
os.path.join(model_root, "input"): {'bind': '/app/input', 'mode': 'rw'},
|
|
470
|
+
os.path.join(model_root, "forecasts"): {'bind': '/app/forecasts', 'mode': 'rw'},
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
uid, gid = os.getuid(), os.getgid()
|
|
474
|
+
|
|
475
|
+
log.info(f"[{self.base_name}] Launching container {self.container_name}")
|
|
476
|
+
|
|
477
|
+
try:
|
|
478
|
+
container = self.client.containers.run(
|
|
479
|
+
self.image_tag,
|
|
480
|
+
remove=False,
|
|
481
|
+
volumes=mounts,
|
|
482
|
+
detach=True,
|
|
483
|
+
user=f"{uid}:{gid}",
|
|
484
|
+
)
|
|
485
|
+
except docker.errors.APIError as e:
|
|
486
|
+
raise RuntimeError(f"[{self.base_name}] Failed to start container: {e}")
|
|
487
|
+
|
|
488
|
+
# Log output live
|
|
489
|
+
for line in container.logs(stream=True):
|
|
490
|
+
log.info(f"[{self.base_name}] {line.decode().rstrip()}")
|
|
491
|
+
|
|
492
|
+
# Wait for exit
|
|
493
|
+
exit_code = container.wait().get("StatusCode", 1)
|
|
494
|
+
|
|
495
|
+
# Clean up
|
|
496
|
+
container.remove(force=True)
|
|
497
|
+
|
|
498
|
+
if exit_code != 0:
|
|
499
|
+
raise RuntimeError(f"[{self.base_name}] Container exited with code {exit_code}")
|
|
500
|
+
|
|
501
|
+
log.info(f"[{self.base_name}] Container finished successfully.")
|
|
401
502
|
|
|
402
503
|
def install_dependencies(self) -> None:
|
|
403
|
-
|
|
504
|
+
"""
|
|
505
|
+
Installs dependencies for Docker-based models. This is typically handled by the Dockerfile,
|
|
506
|
+
so no additional action is needed here.
|
|
507
|
+
"""
|
|
508
|
+
log.info("No additional dependency installation required for Docker environments.")
|
|
404
509
|
|
|
405
510
|
|
|
406
511
|
class EnvironmentFactory:
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
import logging.config
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
LOG_NAME = "experiment.log"
|
|
7
|
+
LOGGING_CONFIG = {
|
|
8
|
+
"version": 1,
|
|
9
|
+
"formatters": {
|
|
10
|
+
"default": {
|
|
11
|
+
"format": "%(asctime)s %(levelname)s - %(message)s",
|
|
12
|
+
"datefmt": "%Y-%m-%d %H:%M:%S",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
"handlers": {
|
|
16
|
+
"console": {
|
|
17
|
+
"formatter": "default",
|
|
18
|
+
"level": "INFO",
|
|
19
|
+
"class": "logging.StreamHandler",
|
|
20
|
+
"stream": "ext://sys.stdout",
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"loggers": {"floatLogger": {"level": "DEBUG", "handlers": ["console"], "propagate": False}},
|
|
24
|
+
"root": {"level": "INFO", "handlers": ["console"]},
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def add_fhandler(filename):
|
|
29
|
+
formatter = logging.Formatter(
|
|
30
|
+
fmt=LOGGING_CONFIG["formatters"]["default"]["format"],
|
|
31
|
+
datefmt=LOGGING_CONFIG["formatters"]["default"]["datefmt"],
|
|
32
|
+
)
|
|
33
|
+
fhandler = logging.FileHandler(filename)
|
|
34
|
+
fhandler.setFormatter(formatter)
|
|
35
|
+
fhandler.setLevel(logging.DEBUG)
|
|
36
|
+
logging.getLogger("floatLogger").addHandler(fhandler)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def is_sphinx_build():
|
|
40
|
+
# Check if Sphinx is running
|
|
41
|
+
return "sphinx" in sys.argv[0] or os.getenv("SPHINX_BUILD") is not None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def setup_logger():
|
|
45
|
+
if is_sphinx_build():
|
|
46
|
+
# Reduce logging or disable it during Sphinx builds
|
|
47
|
+
logging.basicConfig(level=logging.WARNING)
|
|
48
|
+
else:
|
|
49
|
+
logging.config.dictConfig(LOGGING_CONFIG)
|
|
50
|
+
logging.getLogger("numexpr").setLevel(logging.WARNING)
|
|
51
|
+
logging.getLogger("matplotlib").setLevel(logging.CRITICAL)
|
|
52
|
+
# numpy.seterr(all="ignore")
|
|
53
|
+
warnings.filterwarnings("ignore")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def set_console_log_level(log_level):
|
|
57
|
+
"""Set the console log level based on the user's CLI input."""
|
|
58
|
+
logger = logging.getLogger("floatLogger")
|
|
59
|
+
# Update the log level for the console handler
|
|
60
|
+
for handler in logger.handlers:
|
|
61
|
+
if isinstance(handler, logging.StreamHandler):
|
|
62
|
+
handler.setLevel(log_level)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def log_models_tree(log, experiment_registry, time_windows):
|
|
68
|
+
"""
|
|
69
|
+
Logs the forecasts for all models managed by this ExperimentFileRegistry.
|
|
70
|
+
"""
|
|
71
|
+
log.debug("===================")
|
|
72
|
+
log.debug(f" Total Time Windows: {len(time_windows)}")
|
|
73
|
+
for model_name, registry in experiment_registry.model_registries.items():
|
|
74
|
+
log.debug(f" Model: {model_name}")
|
|
75
|
+
exists_group = []
|
|
76
|
+
not_exist_group = []
|
|
77
|
+
|
|
78
|
+
for timewindow, filepath in registry.forecasts.items():
|
|
79
|
+
if registry.forecast_exists(timewindow):
|
|
80
|
+
exists_group.append(timewindow)
|
|
81
|
+
else:
|
|
82
|
+
not_exist_group.append(timewindow)
|
|
83
|
+
|
|
84
|
+
log.debug(f" Existing forecasts: {len(exists_group)}")
|
|
85
|
+
log.debug(f" Missing forecasts: {len(not_exist_group)}")
|
|
86
|
+
for timewindow in not_exist_group:
|
|
87
|
+
log.debug(f" Time Window: {timewindow}")
|
|
88
|
+
log.debug("===================")
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def log_results_tree(log, experiment_registry):
|
|
92
|
+
"""
|
|
93
|
+
Logs a summary of the results dictionary, sorted by test.
|
|
94
|
+
For each test and time window, it logs whether all models have results,
|
|
95
|
+
or if some results are missing, and specifies which models are missing.
|
|
96
|
+
"""
|
|
97
|
+
log.debug("===================")
|
|
98
|
+
|
|
99
|
+
total_results = results_exist_count = results_not_exist_count = 0
|
|
100
|
+
|
|
101
|
+
# Get all unique test names and sort them
|
|
102
|
+
all_tests = sorted(
|
|
103
|
+
{test_name for tests in experiment_registry.results.values() for test_name in tests}
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
for test_name in all_tests:
|
|
107
|
+
log.debug(f"Test: {test_name}")
|
|
108
|
+
for timewindow, tests in experiment_registry.results.items():
|
|
109
|
+
if test_name in tests:
|
|
110
|
+
models = tests[test_name]
|
|
111
|
+
missing_models = []
|
|
112
|
+
|
|
113
|
+
for model_name, result_path in models.items():
|
|
114
|
+
total_results += 1
|
|
115
|
+
result_full_path = experiment_registry.get_result_key(timewindow, test_name, model_name)
|
|
116
|
+
if os.path.exists(result_full_path):
|
|
117
|
+
results_exist_count += 1
|
|
118
|
+
else:
|
|
119
|
+
results_not_exist_count += 1
|
|
120
|
+
missing_models.append(model_name)
|
|
121
|
+
|
|
122
|
+
if not missing_models:
|
|
123
|
+
log.debug(f" Time Window: {timewindow} - All models evaluated.")
|
|
124
|
+
else:
|
|
125
|
+
log.debug(
|
|
126
|
+
f" Time Window: {timewindow} - Missing results for models: "
|
|
127
|
+
f"{', '.join(missing_models)}"
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
log.debug(f"Total Results: {total_results}")
|
|
131
|
+
log.debug(f"Results that Exist: {results_exist_count}")
|
|
132
|
+
log.debug(f"Results that Do Not Exist: {results_not_exist_count}")
|
|
133
|
+
log.debug("===================")
|