Skip to content

Commit 2293b0d

Browse files
authored
Update main branch for Release 2.2.0
Merge all changes from "develop" into "main" to prepare the main branch for the next release
2 parents 8da719d + 1c15998 commit 2293b0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+14258
-1202
lines changed

.github/workflows/python-app.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
pip install .[all]
31-
- name: Test with pytest
31+
- name: Test with pytest, with dask installed
3232
run: |
3333
# editable is necessary as pytest will run against the installed
3434
# package rather than the local files creating a coverage report of 0%
@@ -37,6 +37,13 @@ jobs:
3737
- name: Test tutorial notebooks with pytest
3838
run: |
3939
pytest --nbmake tutorials/
40+
- name: Test again with without dask installed
41+
run: |
42+
# editable is necessary as pytest will run against the installed
43+
# package rather than the local files creating a coverage report of 0%
44+
pip install -e .
45+
pip uninstall dask -y
46+
pytest tests/
4047
- name: Coveralls GitHub Action
4148
uses: coverallsapp/[email protected]
4249
with:

.pre-commit-config.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
repos:
33
- repo: https://github.com/psf/black
4-
rev: 24.1.0
4+
rev: 24.10.0
55
hooks:
66
- id: black
77
name: black
88
entry: black --check
99
- repo: https://github.com/PyCQA/bandit
10-
rev: 1.7.8
10+
rev: 1.8.0
1111
hooks:
1212
- id: bandit
1313
args: [--skip, "B101", --recursive, src/scores]
@@ -25,10 +25,6 @@ repos:
2525
hooks:
2626
- id: isort
2727
entry: isort --profile=black
28-
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: v1.13.0
30-
hooks:
31-
- id: mypy
3228
- repo: local
3329
hooks:
3430
- id: pytest

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ Below is a **curated selection** of the metrics, tools and statistical tests inc
1818

1919
| | **Description** | **Selection of Included Functions** |
2020
|----------------------- |----------------- |-------------- |
21-
| **[Continuous](https://scores.readthedocs.io/en/stable/included.html#continuous)** |Scores for evaluating single-valued continuous forecasts. |MAE, MSE, RMSE, Additive Bias, Multiplicative Bias, Percent Bias, Pearson's Correlation Coefficient, Kling-Gupta Efficiency, Flip-Flop Index, Quantile Loss, Quantile Interval Score, Interval Score, Murphy Score, and threshold weighted scores for expectiles, quantiles and Huber Loss. |
22-
| **[Probability](https://scores.readthedocs.io/en/stable/included.html#probability)** |Scores for evaluating forecasts that are expressed as predictive distributions, ensembles, and probabilities of binary events. |Brier Score, Continuous Ranked Probability Score (CRPS) for Cumulative Density Functions (CDF) and ensembles (including threshold weighted versions), Receiver Operating Characteristic (ROC), Isotonic Regression (reliability diagrams). |
21+
| **[Continuous](https://scores.readthedocs.io/en/stable/included.html#continuous)** |Scores for evaluating single-valued continuous forecasts. |MAE, MSE, RMSE, Additive Bias, Multiplicative Bias, Percent Bias, Pearson's Correlation Coefficient, Spearman's Correlation Coefficient, Kling-Gupta Efficiency, Flip-Flop Index, Quantile Loss, Quantile Interval Score, Interval Score, and threshold weighted scores for expectiles, quantiles and Huber Loss. |
22+
| **[Probability](https://scores.readthedocs.io/en/stable/included.html#probability)** |Scores for evaluating forecasts that are expressed as predictive distributions, ensembles, and probabilities of binary events. |Brier Score, Continuous Ranked Probability Score (CRPS) for Cumulative Density Functions (CDF) and ensembles (including threshold weighted versions), and Isotonic Regression (reliability diagrams). |
2323
| **[Categorical](https://scores.readthedocs.io/en/stable/included.html#categorical)** |Scores for evaluating forecasts of categories. |18 binary contingency table (confusion matrix) metrics, the FIxed Risk Multicategorical (FIRM) Score, and the SEEPS score. |
2424
| **[Spatial](https://scores.readthedocs.io/en/stable/included.html#spatial)** |Scores that take into account spatial structure. |Fractions Skill Score. |
2525
| **[Statistical Tests](https://scores.readthedocs.io/en/stable/included.html#statistical-tests)** |Tools to conduct statistical tests and generate confidence intervals. |Diebold Mariano. |
2626
| **[Processing Tools](https://scores.readthedocs.io/en/stable/included.html#processing-tools-for-preparing-data)** |Tools to pre-process data. |Data matching, Discretisation, Block Bootstrapping, and Cumulative Density Function Manipulation. |
27+
| **[Plotting Data](https://scores.readthedocs.io/en/stable/included.html#plotting-data)** |Tools to generate data for plotting. |ROC curves, Murphy diagrams, and Q-Q plots. |
2728
| **[Emerging](https://scores.readthedocs.io/en/stable/included.html#emerging)** |Emerging scores that are still undergoing mathematical peer review. They may change in line with the peer review process. |Risk Matrix Score. |
2829

2930
`scores` not only includes common scores (e.g., MAE, RMSE), it also includes novel scores not commonly found elsewhere (e.g., FIRM, Flip-Flop Index), complex scores (e.g., threshold weighted CRPS), and statistical tests (e.g., the Diebold Mariano test). Additionally, it provides pre-processing tools for preparing data for scores in a variety of formats including cumulative distribution functions (CDF). `scores` provides its own implementations where relevant to avoid extensive dependencies.

docs/api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
.. autofunction:: scores.continuous.flip_flop_index
2222
.. autofunction:: scores.continuous.flip_flop_index_proportion_exceeding
2323
.. autofunction:: scores.continuous.correlation.pearsonr
24+
.. autofunction:: scores.continuous.correlation.spearmanr
2425
.. autofunction:: scores.continuous.multiplicative_bias
2526
.. autofunction:: scores.continuous.pbias
2627
.. autofunction:: scores.continuous.kge
@@ -36,6 +37,7 @@
3637
.. autofunction:: scores.continuous.tw_expectile_score
3738
.. autofunction:: scores.continuous.quantile_interval_score
3839
.. autofunction:: scores.continuous.interval_score
40+
.. autofunction:: scores.continuous.qq
3941
```
4042

4143
## scores.probability
@@ -106,6 +108,14 @@
106108
.. autofunction:: scores.processing.cdf.cdf_envelope
107109
```
108110

111+
## scores.plotdata
112+
```{eval-rst}
113+
.. autofunction:: scores.plotdata.murphy_score
114+
.. autofunction:: scores.plotdata.murphy_thetas
115+
.. autofunction:: scores.plotdata.qq
116+
.. autofunction:: scores.plotdata.roc
117+
```
118+
109119
## scores.pandas
110120
```{eval-rst}
111121
.. autofunction:: scores.pandas.continuous.mse

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
project = "scores"
1111
copyright = "Licensed under Apache 2.0 - https://www.apache.org/licenses/LICENSE-2.0"
12-
release = "2.1.0"
12+
release = "2.2.0"
1313

1414
version = __version__
1515

docs/included.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@
125125
- [API](api.md#scores.continuous.quantile_score)
126126
- [Tutorial](project:./tutorials/Quantile_Loss.md)
127127
- [Gneiting (2011) - Theorem 9](https://doi.org/10.1198/jasa.2011.r10138)
128+
* - Quantile-Quantile (QQ) Plots
129+
- [API](api.md#scores.continuous.qq)
130+
- [Tutorial](project:./tutorials/Q-Q_plots.md)
131+
- [Déqué (2011)](https://doi.org/10.1002/9781119960003.ch5)
128132
* - Quantile Score, *see Quantile Loss*
129133
- —
130134
- —
@@ -137,6 +141,10 @@
137141
- [API](api.md#scores.continuous.rmse)
138142
- [Tutorial](project:./tutorials/Root_Mean_Squared_Error.md)
139143
- [Wikipedia](https://en.wikipedia.org/wiki/Root-mean-square_deviation)
144+
* - Spearman's Correlation Coefficient
145+
- [API](api.md#scores.continuous.correlation.spearmanr)
146+
- [Tutorial](project:./tutorials/Spearmans_Correlation.md)
147+
- [Spearman (1904)](https://doi.org/10.2307/1412159)
140148
* - Threshold Weighted Absolute Error
141149
- [API](api.md#scores.continuous.tw_absolute_error)
142150
- [Tutorial](project:./tutorials/Threshold_Weighted_Scores.md)
@@ -731,6 +739,44 @@
731739
- —
732740
```
733741

742+
## Plotting Data
743+
744+
```{list-table}
745+
:header-rows: 1
746+
747+
* - Name (Alphabetical order)
748+
- API
749+
- Tutorial
750+
- Reference(s)
751+
* - Murphy Diagrams (Plots of the Murphy Score)
752+
-
753+
-
754+
-
755+
* -
756+
- Murphy Score (Mean Elementary Score)
757+
-
758+
[API](api.md#scores.plotdata.murphy_score)
759+
-
760+
[Tutorial](project:./tutorials/Murphy_Diagrams.md)
761+
-
762+
[Ehm et al. (2016) - Theorem 1](https://doi.org/10.1111/rssb.12154); [Taggart (2022) - Theorem 5.3](https://doi.org/10.1214/21-ejs1957)
763+
* -
764+
- Murphy Score (Mean Elementary Score) - Theta Values
765+
-
766+
[API](api.md#scores.plotdata.murphy_thetas)
767+
-
768+
[Tutorial](project:./tutorials/Murphy_Diagrams.md)
769+
-
770+
[Ehm et al. (2016) - Corollary 2 (p.521)](https://doi.org/10.1111/rssb.12154); [Taggart (2022) - Corollary 5.6](https://doi.org/10.1214/21-ejs1957)
771+
* - Quantile-Quantile (QQ) Plots
772+
- [API](api.md#scores.plotdata.qq)
773+
- [Tutorial](project:./tutorials/Q-Q_plots.md)
774+
- [Déqué (2011)](https://doi.org/10.1002/9781119960003.ch5)
775+
* - Receiver (Relative) Operating Characteristic (ROC)
776+
- [API](api.md#scores.plotdata.roc)
777+
- [Tutorial](project:./tutorials/ROC.md)
778+
- [Fawcett and Niculescu-Mizil (2007)](https://doi.org/10.1007/s10994-007-5011-0); [Gneiting and Vogel (2022)](https://doi.org/10.1007/s10994-021-06115-2); [Hand (2009)](https://doi.org/10.1007/s10994-009-5119-5); [Hand and Anagnostopoulos (2013)](https://doi.org/10.1016/j.patrec.2012.12.004)); [Hand and Anagnostopoulos (2023)](https://doi.org/10.1007/s11634-021-00490-3); [Pesce et al. (2010)](https://doi.org/10.1016/j.acra.2010.04.001)
779+
```
734780
## Pandas
735781

736782
```{list-table}

docs/maintainer.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Information relevant for package maintenance
99
2. In the full changelog URL, change “develop” to the correct version number, i.e (https://github.com/nci/scores/compare/(X-1).(Y-1).(Z-1)...X.Y.Z)
1010
3. Delete any unused headers
1111

12+
### Immediately before making a release, validate the .zenodo.json file
13+
1. Run the .zenodo.json file contents through a JSON validator
14+
1215
### On the pre-release branch
1316
1. Run through some of the notebooks manually
1417
2. Run the unit tests
@@ -48,9 +51,10 @@ Information relevant for package maintenance
4851
### Confirm Zenodo correctness
4952

5053
Link to Zenodo archive: [https://doi.org/10.5281/zenodo.12697241](https://doi.org/10.5281/zenodo.12697241)
51-
1. Confirm license
52-
2. Confirm authors
54+
1. Confirm license is correct
55+
2. Confirm author list is correct
5356
3. Scan everything else
57+
4. Edit the metadata - add the introductory paragraph describing `scores`, and the links to the documentation, source code and journal article.
5458

5559
## This section covers how to format and prepare release notes
5660

@@ -61,9 +65,9 @@ Link to Zenodo archive: [https://doi.org/10.5281/zenodo.12697241](https://doi.or
6165
6266
For a list of all changes in this release, see the [full changelog](https://github.com/nci/scores/compare/(X-1).(Y-1).(Z-1)...X.Y.Z). Below are the changes we think users may wish to be aware of.
6367
64-
### Features
6568
### Breaking Changes
6669
### Deprecations
70+
### Features
6771
### Bug Fixes
6872
### Documentation
6973
### Internal Changes
@@ -98,6 +102,8 @@ In .zenodo.json, please add your details at the bottom of the “creators” sec
98102
3. “name”. Format: surname, given name(s).
99103
```
100104

105+
Each time the .zenodo.json file is updated, run the file contents through a JSON validator.
106+
101107
## This section gives guidance for maintaining compatibility with old versions of Python and packages
102108

103109
tldr; about 3 years old is OK, longer if painless

0 commit comments

Comments
 (0)