From 39903899f89f58c09d14be3680839d01124119c6 Mon Sep 17 00:00:00 2001 From: pciturri Date: Tue, 3 Feb 2026 14:22:50 -0300 Subject: [PATCH 1/3] ft: updated interfaces to pycsep v0.8.0: modified plot function names from all tutorials, modified pycsep function parsers, and fixed imports. --- floatcsep/evaluation.py | 22 ++++++++-------------- floatcsep/utils/helpers.py | 2 +- tests/unit/test_utils.py | 6 +++--- tutorials/case_a/config.yml | 2 +- tutorials/case_b/tests.yml | 8 ++++---- tutorials/case_c/tests.yml | 2 +- tutorials/case_d/tests.yml | 2 +- tutorials/case_e/tests.yml | 2 +- tutorials/case_f/tests.yml | 2 +- tutorials/case_g/tests.yml | 2 +- tutorials/case_h/tests.yml | 2 +- tutorials/case_i/tests.yml | 2 +- tutorials/case_j/tests.yml | 2 +- 13 files changed, 25 insertions(+), 31 deletions(-) diff --git a/floatcsep/evaluation.py b/floatcsep/evaluation.py index 1a9fa2f..664c21a 100644 --- a/floatcsep/evaluation.py +++ b/floatcsep/evaluation.py @@ -47,23 +47,17 @@ class Evaluation: "sequential_information_gain": "sequential_comparative", } - "plot_sequential_likelihood" - "plot_matrix_comparative_test" _PLOTS = { - "csep.utils.plots.plot_consistency_test": "aggregate", - "csep.utils.plots.plot_poisson_consistency_test": "aggregate", - "csep.utils.plots.plot_comparison_test": "aggregate", + "csep.plots.plot_consistency_test": "aggregate", + "csep.plots.plot_comparison_test": "aggregate", + "csep.plots.plot_magnitude_test": "per_model", + "csep.plots.plot_test_distribution": "per_model", + "csep.plots.plot_calibration_test": "per_model", + "csep.plots.plot_concentration_ROC_diagram": "per_model", + "csep.plots.plot_ROC_diagram": "per_model", + "csep.plots.plot_Molchan_diagram": "per_model", "floatcsep.utils.helpers.plot_matrix_comparative_test": "aggregate", - "csep.utils.plots.plot_number_test": "per_model", - "csep.utils.plots.plot_magnitude_test": "per_model", - "csep.utils.plots.plot_distribution_test": "per_model", - "csep.utils.plots.plot_likelihood_test": "per_model", - "csep.utils.plots.plot_spatial_test": "per_model", - "csep.utils.plots.plot_calibration_test": "per_model", - "csep.utils.plots.plot_concentration_ROC_diagram": "per_model", - "csep.utils.plots.plot_ROC_diagram": "per_model", - "csep.utils.plots.plot_Molchan_diagram": "per_model", "floatcsep.utils.helpers.plot_sequential_likelihood": "sequential", } diff --git a/floatcsep/utils/helpers.py b/floatcsep/utils/helpers.py index bd607a9..5d446a7 100644 --- a/floatcsep/utils/helpers.py +++ b/floatcsep/utils/helpers.py @@ -74,7 +74,7 @@ def _getattr(obj_, attr_): _target_modules = [ csep, csep.utils, - csep.utils.plots, + csep.plots, csep.core.regions, floatcsep.utils.helpers, floatcsep.utils.accessors, diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 9adc231..eacfdfd 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -4,7 +4,7 @@ from datetime import datetime import csep -import csep.utils.plots +import csep.plots import csep.core.regions import floatcsep @@ -31,8 +31,8 @@ def test_parse_csep_func(self): parse_csep_func("join_struct_arrays"), csep.utils.join_struct_arrays.__class__ ) self.assertIsInstance( - parse_csep_func("plot_poisson_consistency_test"), - csep.utils.plots.plot_poisson_consistency_test.__class__, + parse_csep_func("plot_consistency_test"), + csep.plots.plot_consistency_test.__class__, ) self.assertIsInstance( parse_csep_func("italy_csep_region"), csep.core.regions.italy_csep_region.__class__ diff --git a/tutorials/case_a/config.yml b/tutorials/case_a/config.yml index 548523c..47865e7 100644 --- a/tutorials/case_a/config.yml +++ b/tutorials/case_a/config.yml @@ -20,7 +20,7 @@ models: tests: - Poisson N-test: func: poisson_evaluations.number_test - plot_func: plot_poisson_consistency_test + plot_func: plot_consistency_test postprocess: plot_forecasts: diff --git a/tutorials/case_b/tests.yml b/tutorials/case_b/tests.yml index dd1038d..3a1f52a 100644 --- a/tutorials/case_b/tests.yml +++ b/tutorials/case_b/tests.yml @@ -1,19 +1,19 @@ - N-test: func: poisson_evaluations.number_test - plot_func: plot_poisson_consistency_test + plot_func: plot_consistency_test - S-test: func: poisson_evaluations.spatial_test - plot_func: plot_poisson_consistency_test + plot_func: plot_consistency_test plot_kwargs: one_sided_lower: True - M-test: func: poisson_evaluations.magnitude_test - plot_func: plot_poisson_consistency_test + plot_func: plot_consistency_test plot_kwargs: one_sided_lower: True - CL-test: func: poisson_evaluations.conditional_likelihood_test - plot_func: plot_poisson_consistency_test + plot_func: plot_consistency_test plot_kwargs: one_sided_lower: True - T-test: diff --git a/tutorials/case_c/tests.yml b/tutorials/case_c/tests.yml index a386026..786673b 100644 --- a/tutorials/case_c/tests.yml +++ b/tutorials/case_c/tests.yml @@ -1,6 +1,6 @@ - S-test: func: poisson_evaluations.spatial_test - plot_func: plot_poisson_consistency_test + plot_func: plot_consistency_test plot_args: title: Poisson S-test xlabel: Log-Likelihood diff --git a/tutorials/case_d/tests.yml b/tutorials/case_d/tests.yml index b911f47..c54e512 100644 --- a/tutorials/case_d/tests.yml +++ b/tutorials/case_d/tests.yml @@ -1,6 +1,6 @@ - Poisson S: func: poisson_evaluations.spatial_test - plot_func: plot_poisson_consistency_test + plot_func: plot_consistency_test plot_args: title: S-test xlabel: Spatial Log-Likelihood diff --git a/tutorials/case_e/tests.yml b/tutorials/case_e/tests.yml index 297c76d..8de6732 100644 --- a/tutorials/case_e/tests.yml +++ b/tutorials/case_e/tests.yml @@ -1,6 +1,6 @@ - Poisson_S: func: poisson_evaluations.spatial_test - plot_func: plot_poisson_consistency_test + plot_func: plot_consistency_test plot_kwargs: one_sided_lower: True plot_args: diff --git a/tutorials/case_f/tests.yml b/tutorials/case_f/tests.yml index e2bf37a..8dac326 100644 --- a/tutorials/case_f/tests.yml +++ b/tutorials/case_f/tests.yml @@ -1,7 +1,7 @@ - Catalog_N-test: func: catalog_evaluations.number_test plot_func: - - plot_number_test: + - plot_test_distribution: plot_args: title: Test distribution - plot_consistency_test: diff --git a/tutorials/case_g/tests.yml b/tutorials/case_g/tests.yml index 445ed39..ddb255e 100644 --- a/tutorials/case_g/tests.yml +++ b/tutorials/case_g/tests.yml @@ -1,7 +1,7 @@ - Catalog_N-test: func: catalog_evaluations.number_test plot_func: - - plot_number_test: + - plot_test_distribution: plot_args: title: Test distribution - plot_consistency_test: diff --git a/tutorials/case_h/tests.yml b/tutorials/case_h/tests.yml index f4c6893..909b982 100644 --- a/tutorials/case_h/tests.yml +++ b/tutorials/case_h/tests.yml @@ -3,7 +3,7 @@ func_kwargs: verbose: False plot_func: - - plot_number_test: + - plot_test_distribution: plot_args: title: Number consistency test bins: 30 diff --git a/tutorials/case_i/tests.yml b/tutorials/case_i/tests.yml index 445ed39..ddb255e 100644 --- a/tutorials/case_i/tests.yml +++ b/tutorials/case_i/tests.yml @@ -1,7 +1,7 @@ - Catalog_N-test: func: catalog_evaluations.number_test plot_func: - - plot_number_test: + - plot_test_distribution: plot_args: title: Test distribution - plot_consistency_test: diff --git a/tutorials/case_j/tests.yml b/tutorials/case_j/tests.yml index 93580a4..21cf941 100644 --- a/tutorials/case_j/tests.yml +++ b/tutorials/case_j/tests.yml @@ -1,6 +1,6 @@ - N-test: func: poisson_evaluations.number_test plot_func: - - plot_poisson_consistency_test: + - plot_consistency_test: plot_args: title: Number consistency test From 5a8a6e909f72e6af2b53fd25e0d06733bba98268 Mon Sep 17 00:00:00 2001 From: pciturri Date: Tue, 3 Feb 2026 14:29:32 -0300 Subject: [PATCH 2/3] ci: updated workflows and removed py=3.9 support fix: changed tutorial g env to conda. --- .github/workflows/build-test.yml | 2 -- .github/workflows/publish-pypi.yml | 2 +- docs/intro/installation.rst | 4 ++-- tutorials/case_g/models.yml | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 1e039ef..7755756 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,8 +15,6 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-latest - python-version: '3.9' - os: ubuntu-latest python-version: '3.10' - os: ubuntu-latest diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 879a7b8..c412ce2 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -21,7 +21,7 @@ jobs: generate-run-shell: true environment-file: environment.yml create-args: >- - python=3.10 + python=3.11 - name: Install py-build and setuptools-scm run: | diff --git a/docs/intro/installation.rst b/docs/intro/installation.rst index b929e55..bf8fa08 100644 --- a/docs/intro/installation.rst +++ b/docs/intro/installation.rst @@ -3,7 +3,7 @@ Installation .. important:: - This application uses ``3.9 <= python <= 3.12`` + This application uses ``3.10 <= python <= 3.12`` Latest Version @@ -128,7 +128,7 @@ Having a ``conda`` manager installed (see ``conda`` managers in :ref:`conda-inst $ conda activate experiment $ conda install -c conda-forge floatcsep -where ``3.9 < {PYTHON_VERSION} <= 3.12`` is at your convenience. +where ``3.10 < {PYTHON_VERSION} <= 3.12`` is at your convenience. 2. From the ``PyPI`` repository ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tutorials/case_g/models.yml b/tutorials/case_g/models.yml index 5d0488f..6d444af 100644 --- a/tutorials/case_g/models.yml +++ b/tutorials/case_g/models.yml @@ -5,4 +5,4 @@ n_sims: 100 mag_min: 3.5 seed: 23 - build: venv + build: conda From f4497d4f0bb624cc589f2f8d176e084863e753b5 Mon Sep 17 00:00:00 2001 From: pciturri Date: Tue, 3 Feb 2026 14:36:37 -0300 Subject: [PATCH 3/3] fix: case g is now tested only locally --- tests/e2e/test_data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e/test_data.py b/tests/e2e/test_data.py index 7d4fd3a..a3d7cfe 100644 --- a/tests/e2e/test_data.py +++ b/tests/e2e/test_data.py @@ -88,6 +88,7 @@ def test_case_f(self, *args): self.run_evaluation(cfg) self.assertEqual(1, 1) + @skip_on_ci("Tested only locally") def test_case_g(self, *args): cfg = self.get_runpath("g") self.run_evaluation(cfg) @@ -145,6 +146,7 @@ def test_case_f(self, *args): self.view_dashboard(cfg) self.assertEqual(1, 1) + @skip_on_ci("Tested only locally") def test_case_g(self, *args): cfg = self.get_rerunpath("g") self.view_dashboard(cfg)