Skip to content

Commit 0f0b5a9

Browse files
authored
Update floatCSEP interface to pyCSEP v0.8.0 (#123)
* ft: updated interfaces to pycsep v0.8.0: modified plot function names from all tutorials, modified pycsep function parsers, and fixed imports. * ci: updated workflows and removed py=3.9 support fix: changed tutorial g env to conda. * fix: case g is now tested only locally
1 parent 95cd3e5 commit 0f0b5a9

File tree

18 files changed

+31
-37
lines changed

18 files changed

+31
-37
lines changed

.github/workflows/build-test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
include:
18-
- os: ubuntu-latest
19-
python-version: '3.9'
2018
- os: ubuntu-latest
2119
python-version: '3.10'
2220
- os: ubuntu-latest

.github/workflows/publish-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
generate-run-shell: true
2222
environment-file: environment.yml
2323
create-args: >-
24-
python=3.10
24+
python=3.11
2525
2626
- name: Install py-build and setuptools-scm
2727
run: |

docs/intro/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Installation
33

44
.. important::
55

6-
This application uses ``3.9 <= python <= 3.12``
6+
This application uses ``3.10 <= python <= 3.12``
77

88

99
Latest Version
@@ -128,7 +128,7 @@ Having a ``conda`` manager installed (see ``conda`` managers in :ref:`conda-inst
128128
$ conda activate experiment
129129
$ conda install -c conda-forge floatcsep
130130
131-
where ``3.9 < {PYTHON_VERSION} <= 3.12`` is at your convenience.
131+
where ``3.10 < {PYTHON_VERSION} <= 3.12`` is at your convenience.
132132

133133
2. From the ``PyPI`` repository
134134
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

floatcsep/evaluation.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,17 @@ class Evaluation:
4747
"sequential_information_gain": "sequential_comparative",
4848
}
4949

50-
"plot_sequential_likelihood"
51-
"plot_matrix_comparative_test"
5250

5351
_PLOTS = {
54-
"csep.utils.plots.plot_consistency_test": "aggregate",
55-
"csep.utils.plots.plot_poisson_consistency_test": "aggregate",
56-
"csep.utils.plots.plot_comparison_test": "aggregate",
52+
"csep.plots.plot_consistency_test": "aggregate",
53+
"csep.plots.plot_comparison_test": "aggregate",
54+
"csep.plots.plot_magnitude_test": "per_model",
55+
"csep.plots.plot_test_distribution": "per_model",
56+
"csep.plots.plot_calibration_test": "per_model",
57+
"csep.plots.plot_concentration_ROC_diagram": "per_model",
58+
"csep.plots.plot_ROC_diagram": "per_model",
59+
"csep.plots.plot_Molchan_diagram": "per_model",
5760
"floatcsep.utils.helpers.plot_matrix_comparative_test": "aggregate",
58-
"csep.utils.plots.plot_number_test": "per_model",
59-
"csep.utils.plots.plot_magnitude_test": "per_model",
60-
"csep.utils.plots.plot_distribution_test": "per_model",
61-
"csep.utils.plots.plot_likelihood_test": "per_model",
62-
"csep.utils.plots.plot_spatial_test": "per_model",
63-
"csep.utils.plots.plot_calibration_test": "per_model",
64-
"csep.utils.plots.plot_concentration_ROC_diagram": "per_model",
65-
"csep.utils.plots.plot_ROC_diagram": "per_model",
66-
"csep.utils.plots.plot_Molchan_diagram": "per_model",
6761
"floatcsep.utils.helpers.plot_sequential_likelihood": "sequential",
6862
}
6963

floatcsep/utils/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _getattr(obj_, attr_):
7474
_target_modules = [
7575
csep,
7676
csep.utils,
77-
csep.utils.plots,
77+
csep.plots,
7878
csep.core.regions,
7979
floatcsep.utils.helpers,
8080
floatcsep.utils.accessors,

tests/e2e/test_data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def test_case_f(self, *args):
8888
self.run_evaluation(cfg)
8989
self.assertEqual(1, 1)
9090

91+
@skip_on_ci("Tested only locally")
9192
def test_case_g(self, *args):
9293
cfg = self.get_runpath("g")
9394
self.run_evaluation(cfg)
@@ -145,6 +146,7 @@ def test_case_f(self, *args):
145146
self.view_dashboard(cfg)
146147
self.assertEqual(1, 1)
147148

149+
@skip_on_ci("Tested only locally")
148150
def test_case_g(self, *args):
149151
cfg = self.get_rerunpath("g")
150152
self.view_dashboard(cfg)

tests/unit/test_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from datetime import datetime
55

66
import csep
7-
import csep.utils.plots
7+
import csep.plots
88
import csep.core.regions
99

1010
import floatcsep
@@ -31,8 +31,8 @@ def test_parse_csep_func(self):
3131
parse_csep_func("join_struct_arrays"), csep.utils.join_struct_arrays.__class__
3232
)
3333
self.assertIsInstance(
34-
parse_csep_func("plot_poisson_consistency_test"),
35-
csep.utils.plots.plot_poisson_consistency_test.__class__,
34+
parse_csep_func("plot_consistency_test"),
35+
csep.plots.plot_consistency_test.__class__,
3636
)
3737
self.assertIsInstance(
3838
parse_csep_func("italy_csep_region"), csep.core.regions.italy_csep_region.__class__

tutorials/case_a/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ models:
2020
tests:
2121
- Poisson N-test:
2222
func: poisson_evaluations.number_test
23-
plot_func: plot_poisson_consistency_test
23+
plot_func: plot_consistency_test
2424

2525
postprocess:
2626
plot_forecasts:

tutorials/case_b/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
- N-test:
22
func: poisson_evaluations.number_test
3-
plot_func: plot_poisson_consistency_test
3+
plot_func: plot_consistency_test
44
- S-test:
55
func: poisson_evaluations.spatial_test
6-
plot_func: plot_poisson_consistency_test
6+
plot_func: plot_consistency_test
77
plot_kwargs:
88
one_sided_lower: True
99
- M-test:
1010
func: poisson_evaluations.magnitude_test
11-
plot_func: plot_poisson_consistency_test
11+
plot_func: plot_consistency_test
1212
plot_kwargs:
1313
one_sided_lower: True
1414
- CL-test:
1515
func: poisson_evaluations.conditional_likelihood_test
16-
plot_func: plot_poisson_consistency_test
16+
plot_func: plot_consistency_test
1717
plot_kwargs:
1818
one_sided_lower: True
1919
- T-test:

tutorials/case_c/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- S-test:
22
func: poisson_evaluations.spatial_test
3-
plot_func: plot_poisson_consistency_test
3+
plot_func: plot_consistency_test
44
plot_args:
55
title: Poisson S-test
66
xlabel: Log-Likelihood

0 commit comments

Comments
 (0)