Skip to content

Commit

Permalink
Merge branch 'AusClimateService:master' into nonstationary_gev
Browse files Browse the repository at this point in the history
  • Loading branch information
stellema authored Oct 15, 2023
2 parents ea7eaf1 + 8ac42f6 commit 260479d
Show file tree
Hide file tree
Showing 12 changed files with 1,175 additions and 1,260 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout source
Expand All @@ -19,8 +18,7 @@ jobs:
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
environment-file: ci/environment-${{ matrix.python-version }}.yml
environment-file: ci/environment.yml
activate-environment: unseen-test
auto-activate-base: false

Expand Down
16 changes: 0 additions & 16 deletions ci/environment-3.11.yml

This file was deleted.

16 changes: 0 additions & 16 deletions ci/environment-3.9.yml

This file was deleted.

11 changes: 10 additions & 1 deletion ci/environment-3.10.yml → ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@ name: unseen-test
channels:
- conda-forge
dependencies:
- python=3.10
- python
- geopandas
- regionmask
- xarray
- dask-core
- numpy
- pytest
- cftime
- gitpython
- cmdline_provenance
- xclim
- xskillscore
- seaborn
- zarr
- netcdf4
- dask-jobqueue
- pip
- pip:
- codecov
- pytest-cov
- xstatstests
Binary file modified docs/user_guide/distribution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user_guide/independence.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user_guide/moments.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user_guide/return_curve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user_guide/stability.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,332 changes: 1,121 additions & 1,211 deletions docs/user_guide/worked_example-HadGEM3-GC31-MM.ipynb

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions docs/user_guide/worked_example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ you could also run it at the command line and submit to the job queue.

.. code-block:: none
$ fileio HadGEM3-GC31-MM_dcppA-hindcast_pr_files.txt Rx5day_HadGEM3-GC31-MM_dcppA-hindcast_s1960-2018_gn_hobart.zarr.zip --n_ensemble_files 10 --variables pr --time_freq A-DEC --time_agg max --input_freq D --point_selection -42.9 147.3 --reset_times --complete_time_agg_periods --units pr=mm day-1 --forecast -v --n_time_files 12
$ fileio HadGEM3-GC31-MM_dcppA-hindcast_pr_files.txt Rx5day_HadGEM3-GC31-MM_dcppA-hindcast_s1960-2018_gn_hobart.zarr.zip --n_ensemble_files 10 --variables pr --rolling_sum_window 5 --time_freq A-DEC --time_agg max --input_freq D --point_selection -42.9 147.3 --reset_times --complete_time_agg_periods --units pr=mm day-1 --forecast -v --n_time_files 12
Stability and stationarity testing
Expand All @@ -295,7 +295,7 @@ To do this, we can use the ``stability`` module:
uncertainty=True,
return_method='gev',
units='Rx5day (mm)',
ylim=(0, 250),
ylim=(0, 450),
)
Expand Down Expand Up @@ -469,9 +469,9 @@ we can use the ``similarity`` module:
.. code-block:: none
KS score: 0.6598098
KS p-value: 0.0
AD score: 235.39091
KS score: 0.2797175
KS p-value: 7.914835e-09
AD score: 29.255798
AD p-value: 0.001
Expand All @@ -486,9 +486,9 @@ we can use the ``similarity`` module:
.. code-block:: none
KS score: 0.0795494
KS p-value: 0.40908137
AD score: -0.29753023
KS score: 0.07429516
KS p-value: 0.49535686
AD score: -0.15807883
AD p-value: 0.25
Expand Down Expand Up @@ -516,8 +516,8 @@ Once we've stacked our model data so it's one dimensional,
.. code-block:: none
<xarray.DataArray 'pr' (sample: 5900)>
array([ 84.050224, 81.98476 , 46.54293 , ..., 68.81363 , 129.38924 ,
28.640915], dtype=float32)
array([124.84209 , 73.138466, 62.510113, ..., 57.245464, 121.23235 ,
34.655647], dtype=float32)
Coordinates:
time (sample) object 1961-11-01 12:00:00 ... 2028-11-01 12:00:00
* sample (sample) object MultiIndex
Expand Down Expand Up @@ -549,8 +549,8 @@ Once we've stacked our model data so it's one dimensional,
.. code-block:: none
220 year return period
95% CI: 177-280 years
235 year return period
95% CI: 188-304 years
.. image:: return_curve.png
Expand Down
32 changes: 31 additions & 1 deletion unseen/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,40 @@

import numpy as np
import xarray as xr

import dask
import dask.array as dsa

# Import all modules to test that dependencies are installed
import unseen.array_handling
import unseen.bias_correction
import unseen.bootstrap
import unseen.dask_setup
import unseen.fileio
import unseen.general_utils
import unseen.independence
import unseen.indices
import unseen.moments
import unseen.similarity
import unseen.spatial_selection
import unseen.stability
import unseen.time_utils


# To avoid linting errors need to use all imported modules
unseen.array_handling.__name__
unseen.bias_correction.__name__
unseen.bootstrap.__name__
unseen.dask_setup.__name__
unseen.fileio.__name__
unseen.general_utils.__name__
unseen.independence.__name__
unseen.indices.__name__
unseen.moments.__name__
unseen.similarity.__name__
unseen.spatial_selection.__name__
unseen.stability.__name__
unseen.time_utils.__name__


def pytest_configure():
pytest.TIME_DIM = "time"
Expand Down

0 comments on commit 260479d

Please sign in to comment.