Skip to content

Commit 40baf91

Browse files
authored
Merge pull request #923 from nci/develop
Merge to main for version 2.3.0
2 parents 2293b0d + 99482d6 commit 40baf91

File tree

84 files changed

+15519
-11464
lines changed

Some content is hidden

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

84 files changed

+15519
-11464
lines changed

.zenodo.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,23 @@
7979
"orcid": "https://orcid.org/0000-0003-3271-6874",
8080
"affiliation": "Australian National University, Australia",
8181
"name": "Squire, Dougal T."
82+
},
83+
{
84+
"orcid": "https://orcid.org/0009-0003-0771-4671",
85+
"affiliation": "Bureau of Meteorology, Australia",
86+
"name": "Pagano, Thomas C."
87+
},
88+
{
89+
"affiliation": "Bureau of Meteorology, Australia",
90+
"name": "Smith, Paul R."
91+
},
92+
{
93+
"orcid": "https://orcid.org/0009-0006-4111-7610",
94+
"affiliation": "Swinburne University, Australia",
95+
"name": "Smallwood, J."
8296
}
97+
98+
8399
],
84100
"license": "Apache-2.0",
85101

README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,43 @@
22

33
[![DOI](https://joss.theoj.org/papers/10.21105/joss.06889/status.svg)](https://doi.org/10.21105/joss.06889) [![CodeQL](https://github.com/nci/scores/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/nci/scores/actions/workflows/github-code-scanning/codeql) [![Coverage Status](https://coveralls.io/repos/github/nci/scores/badge.svg)](https://coveralls.io/github/nci/scores) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/nci/scores/main?labpath=tutorials%2FTutorial_Gallery.ipynb) [![PyPI Version](https://img.shields.io/pypi/v/scores.svg)](https://pypi.org/project/scores/) [![Conda Version](https://img.shields.io/conda/vn/conda-forge/scores.svg)](https://anaconda.org/conda-forge/scores)
44

5-
>
5+
>
66
> **A list of over 60 metrics, statistical techniques and data processing tools contained in `scores` is [available here](https://scores.readthedocs.io/en/stable/included.html).**
77
88
`scores` is a Python package containing mathematical functions for the verification, evaluation and optimisation of forecasts, predictions or models. It supports labelled n-dimensional (multidimensional) data, which is used in many scientific fields and in machine learning. At present, `scores` primarily supports the geoscience communities; in particular, the meteorological, climatological and oceanographic communities.
99

1010
Documentation: [scores.readthedocs.io](https://scores.readthedocs.io)
1111
Source code: [github.com/nci/scores](https://github.com/nci/scores)
1212
Tutorial gallery: [available here](https://scores.readthedocs.io/en/stable/tutorials/Tutorial_Gallery.html)
13-
Journal article: [*scores: A Python package for verifying and evaluating models and predictions with xarray*](https://doi.org/10.21105/joss.06889)
13+
Journal paper: [*scores: A Python package for verifying and evaluating models and predictions with xarray*](https://doi.org/10.21105/joss.06889)
14+
15+
**If you use `scores` for your work or a publication, [please cite](https://scores.readthedocs.io/en/stable/#acknowledging-or-citing-scores)
16+
our [paper](https://doi.org/10.21105/joss.06889).**
1417

1518
## Overview
1619

1720
Below is a **curated selection** of the metrics, tools and statistical tests included in `scores`. [(Click here for the full list.)](https://scores.readthedocs.io/en/stable/included.html)
1821

1922
| | **Description** | **Selection of Included Functions** |
2023
|----------------------- |----------------- |-------------- |
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). |
23-
| **[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. |
24-
| **[Spatial](https://scores.readthedocs.io/en/stable/included.html#spatial)** |Scores that take into account spatial structure. |Fractions Skill Score. |
25-
| **[Statistical Tests](https://scores.readthedocs.io/en/stable/included.html#statistical-tests)** |Tools to conduct statistical tests and generate confidence intervals. |Diebold Mariano. |
26-
| **[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. |
28-
| **[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. |
24+
| **[Continuous](https://scores.readthedocs.io/en/stable/included.html#continuous)** |Scores for evaluating single-valued continuous forecasts. |E.g. MAE, MSE, RMSE, Bias, Pearson's Correlation Coefficient, Kling-Gupta Efficiency, NSE, Flip-Flop Index, Quantile Loss, Quantile Interval Score, Interval Score, and threshold weighted scores for expectiles, quantiles and Huber Loss. [See all.](https://scores.readthedocs.io/en/stable/included.html#continuous) |
25+
| **[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. |E.g. Brier Score, CRPS for CDFs and ensembles (including threshold weighted versions), and Isotonic Regression (reliability diagrams). [See all.](https://scores.readthedocs.io/en/stable/included.html#probability) |
26+
| **[Categorical](https://scores.readthedocs.io/en/stable/included.html#categorical)** |Scores for evaluating forecasts of categories. |E.g. 18 binary contingency table (confusion matrix) metrics, the FIxed Risk Multicategorical (FIRM) Score, the SEEPS score and the Risk Matrix Score. [See all.](https://scores.readthedocs.io/en/stable/included.html#categorical) |
27+
| **[Spatial](https://scores.readthedocs.io/en/stable/included.html#spatial)** |Scores that take into account spatial structure. |Fractions Skill Score. [See all.](https://scores.readthedocs.io/en/stable/included.html#spatial) |
28+
| **[Statistical Tests](https://scores.readthedocs.io/en/stable/included.html#statistical-tests)** |Tools to conduct statistical tests and generate confidence intervals. |Diebold Mariano. [See all.](https://scores.readthedocs.io/en/stable/included.html#statistical-tests) |
29+
| **[Processing Tools](https://scores.readthedocs.io/en/stable/included.html#processing-tools-for-preparing-data)** |Tools to pre-process data. |E.g. Data matching, Discretisation, Block Bootstrapping, and Cumulative Density Function Manipulation. [See all.](https://scores.readthedocs.io/en/stable/included.html#processing-tools-for-preparing-data) |
30+
| **[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. [See all.](https://scores.readthedocs.io/en/stable/included.html#plotting-data) |
31+
| **[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. | *Note - the Risk Matrix Score has recently been moved to 'categorical' following peer-reviewed publication*. |
2932

3033
`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.
3134

32-
`scores` primarily supports xarray datatypes for Earth system data allowing it to work with NetCDF4, HDF5, Zarr and GRIB data formats among others. `scores` uses Dask for scaling and performance. Some metrics work with pandas and we aim to expand this capability.
35+
`scores` primarily supports xarray datatypes for Earth system data allowing it to work with NetCDF4, HDF5, Zarr and GRIB data formats among others. `scores` uses Dask for scaling and performance. Some metrics work with pandas and we aim to expand this capability.
3336

3437
All of the scores and metrics in this package have undergone a thorough scientific and software review. Every score has a companion Jupyter Notebook tutorial that demonstrates its use in practice.
3538

3639
## Contributing
37-
To find out more about contributing, see our [contributing guide](https://scores.readthedocs.io/en/stable/contributing.html).
40+
41+
Contributions from the community are warmly welcomed. To find out more, see our [contributing guide](https://scores.readthedocs.io/en/stable/contributing.html).
3842

3943
All interactions in discussions, issues, emails and code (e.g., pull requests, code comments) will be managed according to the expectations outlined in the [ code of conduct ](https://github.com/nci/scores/blob/main/CODE_OF_CONDUCT.md) and in accordance with all relevant laws and obligations. This project is an inclusive, respectful and open project with high standards for respectful behaviour and language. The code of conduct is the Contributor Covenant, adopted by over 40,000 open source projects. Any concerns will be dealt with fairly and respectfully, with the processes described in the code of conduct.
4044

@@ -46,7 +50,7 @@ The [installation guide](https://scores.readthedocs.io/en/stable/installation.ht
4650

4751
```bash
4852
# From a local checkout of the Git repository
49-
pip install -e .[all]
53+
pip install -e ".[all]"
5054
```
5155
**To install the mathematical functions ONLY** (no tutorial dependencies, no developer libraries), use the default *minimal* installation option. *minimal* is a stable version with limited dependencies. This can be installed from the [Python Package Index (PyPI)](https://pypi.org/project/scores/) or with [conda](https://anaconda.org/conda-forge/scores).
5256

@@ -73,7 +77,7 @@ Here is a short example of the use of `scores`:
7377
<xarray.DataArray ()>
7478
array(2.)
7579
```
76-
[Jupyter Notebook tutorials](https://scores.readthedocs.io/en/stable/tutorials/Tutorial_Gallery.html) are provided for each metric and statistical test in `scores`, as well as for some of the key features of `scores` (e.g., [dimension handling](https://scores.readthedocs.io/en/stable/tutorials/Dimension_Handling.html) and [weighting results](https://scores.readthedocs.io/en/stable/tutorials/Weighting_Results.html)).
80+
[Jupyter Notebook tutorials](https://scores.readthedocs.io/en/stable/tutorials/Tutorial_Gallery.html) are provided for each metric and statistical test in `scores`, as well as for some of the key features of `scores` (e.g., [dimension handling](https://scores.readthedocs.io/en/stable/tutorials/Dimension_Handling.html) and [weighting results](https://scores.readthedocs.io/en/stable/tutorials/Weighting_Results.html)).
7781

7882
To watch a PyCon AU 2024 conference presentation about `scores` [click here](https://youtu.be/jyq2jOqtXe0?si=HYoW1cNiplbb3R0c).
7983

docs/api.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
.. autofunction:: scores.continuous.correlation.spearmanr
2525
.. autofunction:: scores.continuous.multiplicative_bias
2626
.. autofunction:: scores.continuous.pbias
27+
.. autofunction:: scores.continuous.percent_within_x
2728
.. autofunction:: scores.continuous.kge
2829
.. autofunction:: scores.continuous.nse
2930
.. autofunction:: scores.continuous.isotonic_fit
@@ -71,6 +72,9 @@
7172
:members:
7273
.. autoclass:: scores.categorical.EventOperator
7374
:members:
75+
.. autofunction:: scores.categorical.risk_matrix_score
76+
.. autofunction:: scores.categorical.matrix_weights_to_array
77+
.. autofunction:: scores.categorical.weights_from_warning_scaling
7478
.. autofunction:: scores.categorical.seeps
7579
```
7680

@@ -91,6 +95,7 @@
9195

9296
## scores.processing
9397
```{eval-rst}
98+
.. autofunction:: scores.processing.aggregate
9499
.. autofunction:: scores.processing.block_bootstrap
95100
.. autofunction:: scores.processing.isotonic_fit
96101
.. autofunction:: scores.processing.broadcast_and_match_nan
@@ -123,9 +128,9 @@
123128
.. autofunction:: scores.pandas.continuous.mae
124129
```
125130

131+
<!--
126132
## scores.emerging
127133
```{eval-rst}
128-
.. autofunction:: scores.emerging.risk_matrix_score
129-
.. autofunction:: scores.emerging.matrix_weights_to_array
130-
.. autofunction:: scores.emerging.weights_from_warning_scaling
131-
```
134+
.. autofunction:: scores.emerging.name_of_emerging_score
135+
```
136+
-->

docs/coding_practices.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/conf.py

Lines changed: 20 additions & 2 deletions
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.2.0"
12+
release = "2.3.0"
1313

1414
version = __version__
1515

@@ -41,16 +41,34 @@
4141
"use_repository_button": True,
4242
"show_toc_level": 3,
4343
}
44+
4445
html_baseurl = "https://scores.readthedocs.io/en/stable/"
4546
autodoc_typehints = "description"
4647

48+
nbsphinx_thumbnails = {
49+
"tutorials/Risk_Matrix_Score": "_images/risk_matrix.png",
50+
"tutorials/Block_Bootstrapping": "_images/block_bootstrapping_thumbnail.png",
51+
"tutorials/Isotonic_Regression_And_Reliability_Diagrams": "_images/isotonic_regression_thumbnail.png",
52+
"tutorials/Binary_Contingency_Scores": "_images/binary_contingency_thumbnail.png",
53+
"tutorials/Dimension_Handling": "_images/dimension_handling_thumbnail.png",
54+
"tutorials/Angular_data": "_images/angular_data_thumbnail.png",
55+
"tutorials/Q-Q_plots": "_images/qq_thumbnail.png",
56+
"tutorials/NSE": "_images/NSE_thumbnail.png",
57+
"tutorials/Quantile_Loss": "_images/quantile_loss_thumbnail.png",
58+
"tutorials/Threshold_Weighted_Scores": "_images/threshold_weighted_scores_thumbnail.png",
59+
"tutorials/Threshold_Weighted_CRPS_for_Ensembles": "_images/twCRPS_for_ensembles_thumbnail.png",
60+
"tutorials/Brier_Score": "_images/brier_thumbnail.png",
61+
"tutorials/Quantile_Interval_And_Interval_Score": "_images/quantile_interval_score_and_interval_score_thumbnail.png",
62+
"tutorials/Fractions_Skill_Score": "_images/fss_thumbnail.png",
63+
"tutorials/Diebold_Mariano_Test_Statistic": "_images/diebold_mariano_thumbnail.png",
64+
}
65+
4766
# This is needed to allow linking into auto-generated API documentation
4867
# It means there is a risk that genuine cross-referencing errors will be
4968
# suppressed. Perhaps some way around this could be found in future.
5069
# Uncomment this during testing to reveal potential errors
5170
suppress_warnings = ["myst.xref_missing"]
5271

53-
5472
# -- nbsphinx ---------------------------------------------------------------
5573
# This is processed by Jinja2 and inserted after each notebook
5674
nbsphinx_prolog = r"""

docs/contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Here is a simple setup process for an individual developer, assuming you have cl
9191
```bash
9292
python3 -m venv <specify path to your virtual environment>
9393
source source <path to virtual environment>/bin/activate
94-
pip install -e .[all]
94+
pip install -e ".[all]"
9595
pytest
9696
```
9797
### `conda`-based virtual environment
@@ -100,7 +100,7 @@ pytest
100100
# overwrite default name `scores` with `-n <new-name>` if desired
101101
conda env create -f environment.yml
102102
conda activate scores
103-
pip install -e .[all]
103+
pip install -e ".[all]"
104104
pytest
105105
```
106106

0 commit comments

Comments
 (0)