verif 1.3.0.dev1__tar.gz → 1.4.0b2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- verif-1.4.0b2/.github/workflows/python-package.yml +44 -0
- verif-1.4.0b2/.gitignore +16 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/LICENSE +1 -1
- verif-1.4.0b2/PKG-INFO +35 -0
- verif-1.4.0b2/README.rst +107 -0
- verif-1.4.0b2/examples/kf.txt +1528 -0
- verif-1.4.0b2/examples/raw.txt +1528 -0
- verif-1.4.0b2/makefile +40 -0
- verif-1.4.0b2/other/UPLOADING.rst +23 -0
- verif-1.4.0b2/other/count_metrics.py +24 -0
- verif-1.4.0b2/other/create_bash_completion.py +97 -0
- verif-1.4.0b2/other/image.jpg +0 -0
- verif-1.4.0b2/other/verif.sh +27 -0
- verif-1.4.0b2/pyproject.toml +57 -0
- verif-1.4.0b2/scripts/accumulate.py +109 -0
- verif-1.4.0b2/scripts/add_ensemble_stats.py +100 -0
- verif-1.4.0b2/scripts/ens2prob.py +167 -0
- verif-1.4.0b2/scripts/expandverif.py +106 -0
- verif-1.4.0b2/scripts/gamlss2verif.R +372 -0
- verif-1.4.0b2/scripts/run_gamlss_example.R +34 -0
- verif-1.4.0b2/scripts/text2nc.py +89 -0
- verif-1.4.0b2/scripts/time_interpolation.py +179 -0
- verif-1.4.0b2/scripts/window.py +84 -0
- verif-1.4.0b2/tox.ini +15 -0
- verif-1.4.0b2/verif/.gitignore +2 -0
- verif-1.4.0b2/verif/__main__.py +6 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/aggregator.py +44 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/axis.py +1 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/data.py +230 -78
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/driver.py +27 -4
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/field.py +36 -6
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/input.py +139 -10
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/metric.py +167 -20
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/output.py +413 -110
- verif-1.4.0b2/verif/tests/__init__.py +0 -0
- verif-1.4.0b2/verif/tests/files/.gitignore +2 -0
- verif-1.4.0b2/verif/tests/files/comps_invalid1.nc +0 -0
- verif-1.4.0b2/verif/tests/files/comps_valid1.nc +0 -0
- verif-1.4.0b2/verif/tests/files/comps_valid2.nc +0 -0
- verif-1.4.0b2/verif/tests/files/config1.txt +1 -0
- verif-1.4.0b2/verif/tests/files/configEmpty.txt +0 -0
- verif-1.4.0b2/verif/tests/files/example.txt +6 -0
- verif-1.4.0b2/verif/tests/files/file1.txt +19 -0
- verif-1.4.0b2/verif/tests/files/file1_compatibility.txt +19 -0
- verif-1.4.0b2/verif/tests/files/file1_crps.txt +19 -0
- verif-1.4.0b2/verif/tests/files/file1_different_missing.txt +19 -0
- verif-1.4.0b2/verif/tests/files/file1_ens.txt +19 -0
- verif-1.4.0b2/verif/tests/files/file1_leadtime.txt +19 -0
- verif-1.4.0b2/verif/tests/files/file1_no_fcst.txt +19 -0
- verif-1.4.0b2/verif/tests/files/file1_no_header.txt +18 -0
- verif-1.4.0b2/verif/tests/files/file1_no_obs.txt +19 -0
- verif-1.4.0b2/verif/tests/files/file1_quantiles.txt +19 -0
- verif-1.4.0b2/verif/tests/files/file1_same_lat_lon.txt +19 -0
- verif-1.4.0b2/verif/tests/files/file1_x0_x1.txt +23 -0
- verif-1.4.0b2/verif/tests/files/file2.txt +13 -0
- verif-1.4.0b2/verif/tests/files/file2_ens.txt +10 -0
- verif-1.4.0b2/verif/tests/files/file3.txt +28 -0
- verif-1.4.0b2/verif/tests/files/file3_ens.txt +10 -0
- verif-1.4.0b2/verif/tests/files/file3locations.txt +4 -0
- verif-1.4.0b2/verif/tests/files/file4.txt +21 -0
- verif-1.4.0b2/verif/tests/files/fileConflictingInfo.txt +4 -0
- verif-1.4.0b2/verif/tests/files/fileNoElev.txt +4 -0
- verif-1.4.0b2/verif/tests/files/fileNoLat.txt +4 -0
- verif-1.4.0b2/verif/tests/files/fileNoLocation.txt +4 -0
- verif-1.4.0b2/verif/tests/files/file_many_locations.txt +7 -0
- verif-1.4.0b2/verif/tests/files/file_missing_values.txt +7 -0
- verif-1.4.0b2/verif/tests/files/file_nan_time.txt +7 -0
- verif-1.4.0b2/verif/tests/files/file_odd_header_names.txt +4 -0
- verif-1.4.0b2/verif/tests/files/file_order1.txt +4 -0
- verif-1.4.0b2/verif/tests/files/file_order2.txt +4 -0
- verif-1.4.0b2/verif/tests/files/file_sigdig.txt +11 -0
- verif-1.4.0b2/verif/tests/files/makefile +2 -0
- verif-1.4.0b2/verif/tests/files/netcdf_ens.nc +0 -0
- verif-1.4.0b2/verif/tests/files/netcdf_invalid1.nc +0 -0
- verif-1.4.0b2/verif/tests/files/netcdf_invalid2.nc +0 -0
- verif-1.4.0b2/verif/tests/files/netcdf_repeated_leadtimes.nc +0 -0
- verif-1.4.0b2/verif/tests/files/netcdf_repeated_locations.nc +0 -0
- verif-1.4.0b2/verif/tests/files/netcdf_repeated_times.nc +0 -0
- verif-1.4.0b2/verif/tests/files/netcdf_valid1.nc +0 -0
- verif-1.4.0b2/verif/tests/files/netcdf_valid2.nc +0 -0
- verif-1.4.0b2/verif/tests/files/netcdf_valid3.nc +0 -0
- verif-1.4.0b2/verif/tests/files/text_hour.txt +5 -0
- verif-1.4.0b2/verif/tests/test_aggregator.py +65 -0
- verif-1.4.0b2/verif/tests/test_axis.py +19 -0
- verif-1.4.0b2/verif/tests/test_data.py +410 -0
- verif-1.4.0b2/verif/tests/test_data_time_aggregation.py +69 -0
- verif-1.4.0b2/verif/tests/test_field.py +36 -0
- verif-1.4.0b2/verif/tests/test_input_comps.py +61 -0
- verif-1.4.0b2/verif/tests/test_input_netcdf.py +90 -0
- verif-1.4.0b2/verif/tests/test_input_precomputed.py +22 -0
- verif-1.4.0b2/verif/tests/test_input_text.py +231 -0
- verif-1.4.0b2/verif/tests/test_integration.py +508 -0
- verif-1.4.0b2/verif/tests/test_interval.py +95 -0
- verif-1.4.0b2/verif/tests/test_location.py +33 -0
- verif-1.4.0b2/verif/tests/test_metric.py +326 -0
- verif-1.4.0b2/verif/tests/test_metric_type.py +33 -0
- verif-1.4.0b2/verif/tests/test_output.py +106 -0
- verif-1.4.0b2/verif/tests/test_pep8.py +58 -0
- verif-1.4.0b2/verif/tests/test_script.py +41 -0
- verif-1.4.0b2/verif/tests/test_util.py +272 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/util.py +8 -34
- verif-1.4.0b2/verif/version.py +1 -0
- verif-1.4.0b2/verif.egg-info/PKG-INFO +35 -0
- verif-1.4.0b2/verif.egg-info/SOURCES.txt +112 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif.egg-info/entry_points.txt +0 -1
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif.egg-info/requires.txt +2 -4
- verif-1.3.0.dev1/PKG-INFO +0 -166
- verif-1.3.0.dev1/README.rst +0 -139
- verif-1.3.0.dev1/setup.py +0 -114
- verif-1.3.0.dev1/verif/version.py +0 -1
- verif-1.3.0.dev1/verif.egg-info/PKG-INFO +0 -166
- verif-1.3.0.dev1/verif.egg-info/SOURCES.txt +0 -24
- {verif-1.3.0.dev1 → verif-1.4.0b2}/setup.cfg +0 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/__init__.py +0 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/interval.py +0 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/location.py +0 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/metric_type.py +0 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif/variable.py +0 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif.egg-info/dependency_links.txt +0 -0
- {verif-1.3.0.dev1 → verif-1.4.0b2}/verif.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: Python package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [ master, test ]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [ master ]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
python-version: ["3.10"]
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python-version }}
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: |
|
|
28
|
+
# sudo apt install libgeos-dev libproj-dev
|
|
29
|
+
python -m pip install --upgrade pip
|
|
30
|
+
python -m pip install flake8 nose
|
|
31
|
+
- name: Install package
|
|
32
|
+
run: |
|
|
33
|
+
python -m pip install .[test] --only-binary=:all:
|
|
34
|
+
- name: Lint with flake8
|
|
35
|
+
run: |
|
|
36
|
+
# stop the build if there are Python syntax errors or undefined names
|
|
37
|
+
flake8 verif scripts --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
38
|
+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
39
|
+
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
40
|
+
- name: Test with nose
|
|
41
|
+
run: |
|
|
42
|
+
coverage run --source verif -m unittest discover
|
|
43
|
+
coverage report --precision 2
|
|
44
|
+
|
verif-1.4.0b2/.gitignore
ADDED
verif-1.4.0b2/PKG-INFO
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: verif
|
|
3
|
+
Version: 1.4.0b2
|
|
4
|
+
Summary: A verification program for meteorological forecasts and observations
|
|
5
|
+
Author-email: Thomas Nipen <thomasn@met.no>
|
|
6
|
+
License-Expression: BSD-3-Clause
|
|
7
|
+
Project-URL: Homepage, https://github.com/WFRT/verif
|
|
8
|
+
Keywords: meteorology,verification,weather prediction
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
11
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
19
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
20
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: numpy>=1.7
|
|
25
|
+
Requires-Dist: matplotlib
|
|
26
|
+
Requires-Dist: scipy
|
|
27
|
+
Requires-Dist: netCDF4
|
|
28
|
+
Requires-Dist: PyQt6
|
|
29
|
+
Requires-Dist: cartopy
|
|
30
|
+
Provides-Extra: test
|
|
31
|
+
Requires-Dist: coverage; extra == "test"
|
|
32
|
+
Requires-Dist: pep8; extra == "test"
|
|
33
|
+
Requires-Dist: pylint; extra == "test"
|
|
34
|
+
Requires-Dist: flake8; extra == "test"
|
|
35
|
+
Dynamic: license-file
|
verif-1.4.0b2/README.rst
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Forecast verification software
|
|
2
|
+
==============================
|
|
3
|
+
.. image:: https://img.shields.io/github/v/release/WFRT/verif.svg
|
|
4
|
+
:target: https://github.com/WFRT/verif/releases
|
|
5
|
+
:alt: Release badge
|
|
6
|
+
.. image:: https://github.com/WFRT/verif/actions/workflows/python-package.yml/badge.svg
|
|
7
|
+
:target: https://github.com/WFRT/verif/actions/workflows/python-package.yml
|
|
8
|
+
:alt: CI badge
|
|
9
|
+
.. image:: https://img.shields.io/badge/DOI-10.1175%2FBAMS--D--22--0253.1-blue
|
|
10
|
+
:target: https://doi.org/10.1175/BAMS-D-22-0253.1
|
|
11
|
+
:alt: Bams Article
|
|
12
|
+
|
|
13
|
+
Verif is a command-line tool that lets you verify the quality of weather forecasts for point
|
|
14
|
+
locations. It can also compare forecasts from different forecasting systems (that have different
|
|
15
|
+
models, post-processing methods, etc).
|
|
16
|
+
|
|
17
|
+
The program reads files with observations and forecasts in a specific format (see "Input files"
|
|
18
|
+
below). The input files contain information about dates, forecast lead times, and locations such
|
|
19
|
+
that statistics can be aggregated across different dimensions. To ensure a fair comparison among
|
|
20
|
+
files, Verif will discard data points where one or more forecast systems have missing forecasts.
|
|
21
|
+
Since Verif is a command-line tool, it can be used in scripts to automatically create
|
|
22
|
+
verification figures.
|
|
23
|
+
|
|
24
|
+
Verif version 1.3 has been released (see "Installation Instruction" below). We welcome suggestions
|
|
25
|
+
for improvements. Verif is developed by Thomas Nipen (thomasn@met.no), with contributions from many.
|
|
26
|
+
|
|
27
|
+
Features
|
|
28
|
+
--------
|
|
29
|
+
|
|
30
|
+
* Deterministic metrics such as MAE, bias, correlation, RMSE (e.g. ``-m mae``)
|
|
31
|
+
* Threshold-based metrics such as the false alarm rate, ETS, EDI, Yule's Q (e.g. ``-m ets``)
|
|
32
|
+
* Probabilistic metrics such as brier score, PIT-histogram, reliability diagrams (e.g. ``-m bs``)
|
|
33
|
+
* Special plots like Taylor diagrams (``-m taylor``), quantile-quantile plots (``-m qq``).
|
|
34
|
+
* Plot scores as a function of date, lead time, station altitude/lat/longitude (e.g. ``-x date``)
|
|
35
|
+
* Show scores on maps (``-type map``)
|
|
36
|
+
* Subset the data by specifying a date range and lat/lon range (``-latrange 58,60``)
|
|
37
|
+
* Export to text (``-type text``)
|
|
38
|
+
* Options to adjust font sizes, label positions, tick marks, legends, etc (``-labfs 14``)
|
|
39
|
+
* Anomaly statistics relative to a baseline like climatology (``-c climfile.txt``)
|
|
40
|
+
* Output to png, jpeg, eps, etc and specify dimensions and resolution (``-f image.png -dpi 300``)
|
|
41
|
+
|
|
42
|
+
Resources
|
|
43
|
+
---------
|
|
44
|
+
|
|
45
|
+
* Check out the **wiki** at https://github.com/WFRT/verif/wiki.
|
|
46
|
+
* Found a bug? Please report it in the **issue tracker** at https://github.com/WFRT/verif/issues.
|
|
47
|
+
* Reach out to the Verif community in the **discussions** at https://github.com/WFRT/verif/discussions.
|
|
48
|
+
* Check out our `article <https://journals.ametsoc.org/view/journals/bams/104/9/BAMS-D-22-0253.1.xml>`_ published in BAMS.
|
|
49
|
+
|
|
50
|
+
.. image:: other/image.jpg
|
|
51
|
+
:alt: Example plots
|
|
52
|
+
:width: 400
|
|
53
|
+
:align: center
|
|
54
|
+
|
|
55
|
+
Getting started
|
|
56
|
+
---------------
|
|
57
|
+
|
|
58
|
+
The easiest way to get started is to install verif with pip:
|
|
59
|
+
|
|
60
|
+
.. code-block:: bash
|
|
61
|
+
|
|
62
|
+
pip3 install verif
|
|
63
|
+
|
|
64
|
+
The `verif` command-line program should then be available.
|
|
65
|
+
|
|
66
|
+
Note that the python package "cartopy" is optional and not installed by default when verif is
|
|
67
|
+
installed, Verif uses "cartopy" for creating a background map when verification scores are plotted
|
|
68
|
+
on a map. To install Cartopy run
|
|
69
|
+
|
|
70
|
+
.. code-block:: bash
|
|
71
|
+
|
|
72
|
+
pip3 install cartopy
|
|
73
|
+
|
|
74
|
+
To upgrade to a newer version of Verif, run the following:
|
|
75
|
+
|
|
76
|
+
.. code-block:: bash
|
|
77
|
+
|
|
78
|
+
pip3 install verif --upgrade
|
|
79
|
+
|
|
80
|
+
Examples
|
|
81
|
+
--------
|
|
82
|
+
To test Verif, you can download example datasets from the github
|
|
83
|
+
`discussion page <https://github.com/WFRT/verif/discussions>`_. For example, download the following two files from the wind speed dataset: `MEPS.nc <https://thredds.met.no/thredds/fileServer/metusers/thomasn/verif_datasets/short_range_wind/MEPS.nc>`_ (2.5 km regional model; 20MB file size) and `ECMWF.nc <https://thredds.met.no/thredds/fileServer/metusers/thomasn/verif_datasets/short_range_wind/ECMWF.nc>`_ (0.2° global model; 24MB file size). Then run the following
|
|
84
|
+
commands to test out the software:
|
|
85
|
+
|
|
86
|
+
.. code-block:: bash
|
|
87
|
+
|
|
88
|
+
# Shows mean absolute error as a function of lead-time
|
|
89
|
+
verif MEPS.nc ECMWF.nc -m mae
|
|
90
|
+
# Shows average observed and forecasted values as a function on time
|
|
91
|
+
verif MEPS.nc ECMWF.nc -m obsfcst -x time
|
|
92
|
+
# Shows equitable threat score as a function of threshold
|
|
93
|
+
verif MEPS.nc ECMWF.nc -m ets
|
|
94
|
+
# Shows a reliability diagram for a threshold of 13.9 m/s (gale force winds)
|
|
95
|
+
verif MEPS.nc ECMWF.nc -m reliability -r 13.9
|
|
96
|
+
# Shows Brier skill score as a function of threshold
|
|
97
|
+
verif MEPS.nc ECMWF.nc -m bss -x threshold
|
|
98
|
+
|
|
99
|
+
How to cite
|
|
100
|
+
-----------
|
|
101
|
+
Nipen, T. N., R. B. Stull, C. Lussana, and I. A. Seierstad, 2023: `Verif: A Weather-Prediction Verification Tool for Effective Product Development <https://journals.ametsoc.org/view/journals/bams/104/9/BAMS-D-22-0253.1.xml>`_. Bull. Amer. Meteor. Soc., 104, E1610–E1618, https://doi.org/10.1175/BAMS-D-22-0253.1.
|
|
102
|
+
|
|
103
|
+
Copyright and license
|
|
104
|
+
---------------------
|
|
105
|
+
|
|
106
|
+
Copyright © 2013-2026 UBC Weather Forecast Research Team. Verif is licensed under the 3-clause
|
|
107
|
+
BSD license. See LICENSE file.
|