Skip to content

Commit 20a8547

Browse files
authored
Merge pull request #630 from nci/develop
Release 1.1.0
2 parents 0d269d3 + e6c0db2 commit 20a8547

28 files changed

+79553
-157
lines changed

.zenodo.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"creators": [
3+
{
4+
"orcid": "https://orcid.org/0009-0008-2024-1967",
5+
"affiliation": "Bureau of Meteorology",
6+
"name": "Leeuwenburg, Tennessee"
7+
},
8+
{
9+
"orcid": "https://orcid.org/0009-0000-5796-7069",
10+
"affiliation": "Bureau of Meteorology",
11+
"name": "Loveday, Nicholas"
12+
},
13+
{
14+
"affiliation": "Bureau of Meteorology",
15+
"name": "Ebert, Elizabeth E."
16+
},
17+
{
18+
"orcid": "https://orcid.org/0009-0009-3207-4876",
19+
"affiliation": "Bureau of Meteorology",
20+
"name": "Cook, Harrison"
21+
},
22+
{
23+
"orcid": "https://orcid.org/0000-0002-5017-9622",
24+
"affiliation": "Bureau of Meteorology",
25+
"name": "Khanarmuei, Mohammadreza"
26+
},
27+
{
28+
"orcid": "https://orcid.org/0000-0002-0067-5687",
29+
"affiliation": "Bureau of Meteorology",
30+
"name": "Taggart, Robert J."
31+
},
32+
{
33+
"orcid": "https://orcid.org/0009-0002-7406-7438",
34+
"affiliation": "Bureau of Meteorology",
35+
"name": "Ramanathan, Nikeeth"
36+
},
37+
{
38+
"orcid": "https://orcid.org/0009-0008-6830-8251",
39+
"affiliation": "Bureau of Meteorology",
40+
"name": "Carroll, Maree"
41+
},
42+
{
43+
"orcid": "https://orcid.org/0009-0007-0796-4127",
44+
"affiliation": "Independent Contributor",
45+
"name": "Chong, Stephanie"
46+
},
47+
{
48+
"affiliation": "Work undertaken while at the Bureau of Meteorology",
49+
"name": "Griffiths, Aidan"
50+
},
51+
{
52+
"affiliation": "Bureau of Meteorology",
53+
"name": "Sharples, John"
54+
},
55+
],
56+
57+
"license": "Apache-2.0",
58+
59+
"title": "scores: A Python package for verifying and evaluating models and predictions with xarray",
60+
61+
"related_identifiers": [
62+
{
63+
"scheme": "doi",
64+
"identifier": "10.21105/joss.06889",
65+
"relation": "isDocumentedBy",
66+
"resource_type": "publication-article"
67+
}
68+
],
69+
70+
"keywords": ["verification", "statistics", "modelling", "geoscience", "earth system science"],
71+
}

README.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,64 @@
11
# scores: Verification and Evaluation for Forecasts and Models
22

3-
[![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) [![DOI](https://joss.theoj.org/papers/10.21105/joss.06889/status.svg)](https://doi.org/10.21105/joss.06889)
3+
[![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

55
>
66
> **A list of over 50 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

10-
Documentation is hosted at [scores.readthedocs.io](https://scores.readthedocs.io).
11-
Source code is hosted at [github.com/nci/scores](https://github.com/nci/scores).
12-
The tutorial gallery is hosted at [as part of the documentation, here](https://scores.readthedocs.io/en/stable/tutorials/Tutorial_Gallery.html).
10+
Documentation: [scores.readthedocs.io](https://scores.readthedocs.io)
11+
Source code: [github.com/nci/scores](https://github.com/nci/scores)
12+
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)
1314

1415
## Overview
1516
Here is a **curated selection** of the metrics, tools and statistical tests included in `scores`:
1617

1718
| | **Description** | **Selection of Included Functions** |
1819
|----------------------- |----------------- |-------------- |
19-
| **[Continuous](https://scores.readthedocs.io/en/stable/included.html#continuous)** |Scores for evaluating single-valued continuous forecasts. |Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Additive Bias, Multiplicative Bias, Pearson's Correlation Coefficient, Flip-Flop Index, Quantile Loss, Murphy Score, families of consistent scoring functions for quantiles and expectiles. |
20+
| **[Continuous](https://scores.readthedocs.io/en/stable/included.html#continuous)** |Scores for evaluating single-valued continuous forecasts. |Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Additive Bias, Multiplicative Bias, Pearson's Correlation Coefficient, Flip-Flop Index, Quantile Loss, Murphy Score, families of consistent scoring functions for quantiles and expectiles, Threshold Weighted Squared Error, Threshold Weighted Quantile Score, Threshold Weighted Absolute Error, Threshold Weighted Expectile Score, Threshold Weighted Huber Loss. |
2021
| **[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 Function (CDF), Threshold weighted CRPS for CDF, CRPS for ensembles, Receiver Operating Characteristic (ROC), Isotonic Regression (reliability diagrams). |
2122
| **[Categorical](https://scores.readthedocs.io/en/stable/included.html#categorical)** |Scores (including contingency table metrics) for evaluating forecasts of categories. |Probability of Detection (POD), False Alarm Ratio (FAR), Probability of False Detection (POFD), Success Ratio, Accuracy, Peirce's Skill Score, Critical Success Index (CSI), Gilbert Skill Score, Heidke Skill Score, Odds Ratio, Odds Ratio Skill Score, F1 score, Symmetric Extremal Dependence Index, FIxed Risk Multicategorical (FIRM) Score. |
2223
| **[Spatial](https://scores.readthedocs.io/en/stable/included.html#spatial)** |Scores that take into account spatial structure. |Fractions Skill Score. |
2324
| **[Statistical Tests](https://scores.readthedocs.io/en/stable/included.html#statistical-tests)** |Tools to conduct statistical tests and generate confidence intervals. |Diebold Mariano. |
2425
| **[Processing Tools](https://scores.readthedocs.io/en/stable/included.html#processing-tools-for-preparing-data)** |Tools to pre-process data. |Data matching, Discretisation, Cumulative Density Function Manipulation. |
2526

2627

27-
`scores` not only includes common scores (e.g. MAE, RMSE), it includes novel scores not commonly found elsewhere (e.g. FIRM, Flip-Flop Index), complex scores (e.g. threshold weighted CRPS), and statistical tests (such as 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.
28+
`scores` not only includes common scores (e.g., MAE, RMSE), it includes novel scores not commonly found elsewhere (e.g., FIRM, Flip-Flop Index), complex scores (e.g., threshold weighted CRPS), and statistical tests (such as 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.
2829

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

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

3334
## Contributing
34-
To find out more about contributing, see our [Contributing Guide](https://scores.readthedocs.io/en/stable/contributing.html).
35+
To find out more about contributing, see our [contributing guide](https://scores.readthedocs.io/en/stable/contributing.html).
3536

36-
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.
37+
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.
3738

38-
## Using This Package
39+
## Installation
3940

4041
The [installation guide](https://scores.readthedocs.io/en/stable/installation.html) describes four different use cases for installing, using and working with this package.
4142

42-
Most users currently want the *all* installation option. This includes the mathematical functions (scores, metrics, statistical tests etc.), the tutorial notebooks and development libraries.
43+
**Most users currently want the *all* installation option.** This includes the mathematical functions (scores, metrics, statistical tests etc.), the tutorial dependencies and development libraries.
4344

44-
From a Local Checkout of the Git Repository
45+
```bash
46+
# From a local checkout of the Git repository
47+
pip install -e .[all]
48+
```
49+
**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).
4550

4651
```bash
47-
> pip install -e .[all]
52+
# From PyPI
53+
pip install scores
4854
```
55+
```bash
56+
# From conda-forge
57+
conda install conda-forge::scores
58+
```
59+
(Note: at present, only the *minimal* installation option is available from conda. In time, we intend to add more installation options to conda.)
60+
61+
## Using `scores`
4962

5063
Here is a short example of the use of scores:
5164

@@ -58,16 +71,11 @@ Here is a short example of the use of scores:
5871
<xarray.DataArray ()>
5972
array(2.)
6073
```
61-
62-
To install the mathematical functions ONLY (no tutorial notebooks, no developer libraries), use the *minimal* installation option. *minimal* is a stable version with limited dependencies and can be installed from the Python Package Index.
63-
64-
```bash
65-
> pip install scores
66-
```
74+
[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)).
6775

6876
## Finding, Downloading and Working With Data
6977

70-
All metrics, statistical techniques and data processing tools in `scores` work with [xarray](https://xarray.dev). [Some metrics](https://scores.readthedocs.io/en/stable/included.html#pandas) work with [pandas](https://pandas.pydata.org/). As such, `scores` works with any data source for which xarray or pandas can be used. See the [Data Sources](https://scores.readthedocs.io/en/stable/data.html) page and [this tutorial](https://scores.readthedocs.io/en/stable/tutorials/First_Data_Fetching.html) for more information on finding, downloading and working with different sources of data.
78+
All metrics, statistical techniques and data processing tools in `scores` work with [xarray](https://xarray.dev). [Some metrics](https://scores.readthedocs.io/en/stable/included.html#pandas) work with [pandas](https://pandas.pydata.org/). As such, `scores` works with any data source for which xarray or pandas can be used. See the [data sources](https://scores.readthedocs.io/en/stable/data.html) page and [this tutorial](https://scores.readthedocs.io/en/stable/tutorials/First_Data_Fetching.html) for more information on finding, downloading and working with different sources of data.
7179

7280
## Acknowledging This Work
7381

docs/api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
.. autofunction:: scores.continuous.consistent_expectile_score
2727
.. autofunction:: scores.continuous.consistent_quantile_score
2828
.. autofunction:: scores.continuous.consistent_huber_score
29+
.. autofunction:: scores.continuous.tw_quantile_score
30+
.. autofunction:: scores.continuous.tw_absolute_error
31+
.. autofunction:: scores.continuous.tw_squared_error
32+
.. autofunction:: scores.continuous.tw_huber_loss
33+
.. autofunction:: scores.continuous.tw_expectile_score
2934
```
3035

3136
## scores.probability

docs/conf.py

Lines changed: 3 additions & 18 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 = "1.0.0"
12+
release = "1.1.0"
1313

1414
version = __version__
1515

@@ -54,29 +54,14 @@
5454
# -- nbsphinx ---------------------------------------------------------------
5555
# This is processed by Jinja2 and inserted after each notebook
5656
nbsphinx_prolog = r"""
57-
{% set docname = '' + env.doc2path(env.docname, base=False) %}
57+
{% set docname = '' + env.doc2path(env.docname, base=False)|string() %}
5858
5959
.. raw:: html
6060
6161
<div class="admonition note">
6262
Interactive online version:
6363
<span style="white-space: nowrap;"><a href="https://mybinder.org/v2/gh/nci/scores/main?labpath={{ docname|e }}"><img alt="Binder badge" src="https://mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a>.</span>
6464
<a href="{{ env.docname.split('/')|last|e + '.ipynb' }}" class="reference download internal" download>Download notebook</a>.
65-
<script>
66-
if (document.location.host) {
67-
let nbviewer_link = document.createElement('a');
68-
nbviewer_link.setAttribute('href',
69-
'https://nbviewer.org/url' +
70-
(window.location.protocol == 'https:' ? 's/' : '/') +
71-
window.location.host +
72-
window.location.pathname.slice(0, -4) +
73-
'ipynb');
74-
nbviewer_link.innerHTML = 'Or view it on <em>nbviewer</em>';
75-
nbviewer_link.classList.add('reference');
76-
nbviewer_link.classList.add('external');
77-
document.currentScript.replaceWith(nbviewer_link, '.');
78-
}
79-
</script>
8065
</div>
8166
8267
.. raw:: latex
@@ -88,7 +73,7 @@
8873

8974
# This is processed by Jinja2 and inserted after each notebook
9075
nbsphinx_epilog = r"""
91-
{% set docname = 'doc/' + env.doc2path(env.docname, base=None) %}
76+
{% set docname = 'doc/' + env.doc2path(env.docname, base=None)|string() %}
9277
.. raw:: latex
9378
9479
\nbsphinxstopnotebook{\scriptsize\noindent\strut

docs/included.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,26 @@
117117
- [API](api.md#scores.continuous.rmse)
118118
- [Tutorial](project:./tutorials/Root_Mean_Squared_Error.md)
119119
- [Wikipedia](https://en.wikipedia.org/wiki/Root-mean-square_deviation)
120+
* - Threshold Weighted Absolute Error
121+
- [API](api.md#scores.continuous.tw_absolute_error)
122+
- [Tutorial](project:./tutorials/Threshold_Weighted_Scores.md)
123+
- [Taggart (2022)](https://doi.org/10.1002/qj.4206)
124+
* - Threshold Weighted Expectile Score
125+
- [API](api.md#scores.continuous.tw_expectile_score)
126+
- [Tutorial](project:./tutorials/Threshold_Weighted_Scores.md)
127+
- [Taggart (2022)](https://doi.org/10.1002/qj.4206)
128+
* - Threshold Weighted Huber Loss
129+
- [API](api.md#scores.continuous.tw_huber_loss)
130+
- [Tutorial](project:./tutorials/Threshold_Weighted_Scores.md)
131+
- [Taggart (2022)](https://doi.org/10.1002/qj.4206)
132+
* - Threshold Weighted Quantile Score
133+
- [API](api.md#scores.continuous.tw_quantile_score)
134+
- [Tutorial](project:./tutorials/Threshold_Weighted_Scores.md)
135+
- [Taggart (2022)](https://doi.org/10.1002/qj.4206)
136+
* - Threshold Weighted Squared Error
137+
- [API](api.md#scores.continuous.tw_squared_error)
138+
- [Tutorial](project:./tutorials/Threshold_Weighted_Scores.md)
139+
- [Taggart (2022)](https://doi.org/10.1002/qj.4206)
120140
```
121141

122142
## Probability

0 commit comments

Comments
 (0)