Skip to content

Commit

Permalink
merge mast
Browse files Browse the repository at this point in the history
  • Loading branch information
aulemahal committed Sep 8, 2023
2 parents 96fb356 + 06a3fbe commit a2f01ba
Show file tree
Hide file tree
Showing 32 changed files with 1,107 additions and 276 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"project_slug": "xscen",
"project_short_description": "A climate change scenario-building analysis framework, built with xclim/xarray.",
"pypi_username": "RondeauG",
"version": "0.6.19-beta",
"version": "0.7.2-beta",
"use_pytest": "y",
"use_black": "y",
"add_pyup_badge": "n",
Expand Down
26 changes: 26 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# label rules used by .github/workflows/label.yml

# label 'ci' all automation-related steps and files
# Since this repository is in itself an automation process to deploy a server instance,
# we refer here to CI as the 'meta' configuration files for managing the code and integrations with the repository,
# not configurations related to the deployment process itself.

CI:
- .* # all '.<something>' files
- .github/workflows/*
- docs/Makefile
- tox.ini
- Makefile

docs:
- .readthedocs.yml
- docs/**/*
- AUTHORS.rst
- CONTRIBUTING.rst
- ISSUE_TEMPLATE/**/*
- ISSUE_TEMPLATE.md
- PULL_REQUEST_TEMPLATE.md
- README.rst

xclim:
- xscen/xclim_modules/**/*
25 changes: 25 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler/blob/master/README.md

name: Labeler
on: [pull_request_target]
# Note: potential security risk from this action using pull_request_target.
# Do not add actions in here which need a checkout of the repo, and do not use any caching in here.
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target

permissions:
checks: write
contents: read
pull-requests: write

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
python-version: "3.9"
- name: Install tox
run: |
pip install tox~=3.0
pip install tox
- name: Run linting suite
run: |
tox -e black
testing:
name: Smoke Test with Python${{ matrix.python-version }}
name: Test with Python${{ matrix.python-version }}
needs: black
runs-on: ubuntu-latest
strategy:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/remove-obsolete-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Example taken from https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#managing-caches
name: Cleanup Caches on PR Merge

on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 16 additions & 2 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@
History
=======

v0.7.0 (unreleased)
v0.7.1 (2023-08-23)
-------------------
* Update dependencies by removing ``pygeos``, pinning ``shapely>=2`` and ``intake-esm>=2023.07.07`` as well as other small fixes to the environment files. (:pull:`243`).
* Fix ``xs.aggregate.spatial_mean`` with method ``cos-lat`` when the data is on a rectilinear grid. (:pull:`243`).

Internal changes
^^^^^^^^^^^^^^^^
* Added a workflow that removes obsolete GitHub Workflow caches from merged pull requests. (:pull:`250`).
* Added a workflow to perform automated labeling of pull requests, dependent on the files changed. (:pull:`250`).

v0.7.0 (2023-08-22)
-------------------
Contributors to this version: Gabriel Rondeau-Genesse (:user:`RondeauG`), Pascal Bourgault (:user:`aulemahal`), Trevor James Smith (:user:`Zeitsperre`), Juliette Lavoie (:user:`juliettelavoie`), Marco Braun (:user:`vindelico`).

Announcements
^^^^^^^^^^^^^
* Dropped support for Python 3.8, added support for 3.11. (:pull:`199`, :pull:`222`).
* `xscen` is now available on `conda-forge <https://anaconda.org/conda-forge/xscen>`_, and can be installed with ``conda install -c conda-forge xscen``. (:pull:`241`)

New features and enhancements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -23,7 +34,9 @@ New features and enhancements
* Add more comments in the template. (:pull:`233`, :issue:`232`).
* ``generate_weights`` now allows to split weights between experiments, and make them vary along the time/horizon axis. (:issue:`108`, :pull:`231`).
* New independence_level, `institution`, added to ``generate_weights``. (:pull:`231`).
* Updated ``produce_horizon`` so it can accept multiple periods or warming levels. (:pull:`231`).
* Updated ``produce_horizon`` so it can accept multiple periods or warming levels. (:pull:`231`, :pull:`240`).
* Add more comments in the template. (:pull:`233`, :pull:`235`, :issue:`232`).
* New function ``diagnostics.health_checks`` that can perform multiple checkups on a dataset. (:pull:`238`).

Breaking changes
^^^^^^^^^^^^^^^^
Expand All @@ -38,6 +51,7 @@ Breaking changes
* Legacy support for `stats_kwargs` in ``ensemble_stats`` was dropped. (:pull:`231`).
* `period` in ``produce_horizon`` has been deprecated and replaced with `periods`. (:pull:`231`).
* Some automated `to_level` were updated to reflect more recent changes. (:pull:`231`).
* Removed ``diagnostics.fix_unphysical_values``. (:pull:`238`).

Bug fixes
^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ recursive-exclude * __pycache__
recursive-exclude * *.py[co]
recursive-exclude docs notebooks *.rst conf.py Makefile make.bat *.jpg *.png *.gif *.ipynb *.csv *.json *.yml *.md
recursive-exclude docs notebooks samples *.csv *.json
recursive-exclude conda *.yml
recursive-exclude templates *.csv *.json *.py *.yml

exclude .cruft.json
Expand Down
18 changes: 13 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xscen |logo|
============

|pypi| |status| |build| |coverage| |docs| |black| |pre-commit| |versions|
|pypi| |conda| |status| |build| |coverage| |docs| |black| |pre-commit| |versions|

A climate change scenario-building analysis framework, built with Intake-esm catalogs and xarray-based packages such as xclim and xESMF.

Expand All @@ -11,11 +11,11 @@ For documentation concerning `xscen`, see: https://xscen.readthedocs.io/en/lates
Features
--------
* Supports workflows with YAML configuration files for better transparency, reproducibility, and long-term backups.
* Intake_esm-based catalog to find and manage climate data.
* `Intake-esm`_-based catalog to find and manage climate data.
* Climate dataset extraction, subsetting, and temporal aggregation.
* Calculate missing variables through Intake-esm's DerivedVariableRegistry.
* Regridding with xESMF.
* Bias adjustment with xclim.
* Calculate missing variables through intake-esm's `DerivedVariableRegistry`_.
* Regridding powered by `xESMF`_.
* Bias adjustment tools provided by `xclim`_.

Installation
------------
Expand All @@ -29,6 +29,10 @@ This package was created with Cookiecutter_ and the `Ouranosinc/cookiecutter-pyp
.. _Cookiecutter: https://github.com/cookiecutter/cookiecutter
.. _Ouranosinc/cookiecutter-pypackage: https://github.com/Ouranosinc/cookiecutter-pypackage
.. _installation docs: https://xscen.readthedocs.io/en/latest/installation.html
.. _Intake-esm: https://intake-esm.readthedocs.io/
.. _DerivedVariableRegistry: https://intake-esm.readthedocs.io/en/latest/how-to/define-and-use-derived-variable-registry.html
.. _xclim: https://xclim.readthedocs.io/
.. _xESMF: https://xesmf.readthedocs.io/

.. |logo| image:: https://raw.githubusercontent.com/Ouranosinc/xscen/main/docs/_static/_images/xscen-logo-small.png
:target: https://github.com/Ouranosinc/xscen
Expand All @@ -46,6 +50,10 @@ This package was created with Cookiecutter_ and the `Ouranosinc/cookiecutter-pyp
:target: https://pypi.python.org/pypi/xscen
:alt: Python Package Index Build

.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/xscen.svg
:target: https://anaconda.org/conda-forge/xscen
:alt: Conda Build

.. |docs| image:: https://readthedocs.org/projects/xscen/badge/?version=latest
:target: https://xscen.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
Expand Down
29 changes: 16 additions & 13 deletions conda/xscen/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,37 @@ build:

requirements:
host:
- python >=3.8
- python >=3.9
- pip
run:
- python >=3.8
- cartopy
- cftime
- cf_xarray >=0.7.6
- clisops >=0.9.5
- clisops >=0.10
- dask-core
- flox
- fsspec
- geopandas
- h5netcdf
- intake
- intake-esm >=2022.9.18
- matplotlib-base
- pyarrow # Used when opening catalogs.
- pygeos
- netcdf4
- h5py
- intake-esm >=2023.07.07
- matplotlib
- netCDF4
- numpy
- pandas
- pandas >= 2
- parse
- pyyaml
- rechunker
- shapely
- xarray <2023.3.0
- xclim >=0.37
- shapely >= 2
- sparse
- toolz
- xarray
- xclim >=0.43.0
- xesmf >=0.7
- zarr
# Opt
- nc-time-axis >=1.3.1
- pyarrow >=1.0.0

test:
imports:
Expand Down
27 changes: 15 additions & 12 deletions conda/xscen/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,37 @@ build:

requirements:
host:
- python >=3.8
- python >=3.9
- pip
run:
- python >=3.8
- cartopy
- cftime
- cf_xarray >=0.7.6
- clisops
- clisops >=0.10
- dask-core
- flox
- fsspec
- geopandas
- h5netcdf
- intake
- intake-esm >=2022.9.18
- matplotlib-base
- pyarrow # Used when opening catalogs.
- pygeos
- netcdf4
- h5py
- intake-esm >=2023.07.07
- matplotlib
- netCDF4
- numpy
- pandas
- pandas >= 2
- parse
- pyyaml
- rechunker
- shapely
- shapely >= 2
- sparse
- toolz
- xarray
- xclim >=0.37
- xclim >=0.43.0
- xesmf >=0.7
- zarr
# Opt
- nc-time-axis >=1.3.1
- pyarrow >=1.0.0

test:
imports:
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Features

readme
installation
templates
goodtoknow
notebooks/1_catalog
notebooks/2_getting_started
Expand All @@ -35,6 +34,7 @@ Features
notebooks/5_warminglevels
notebooks/6_config
columns
templates
api
contributing
authors
Expand Down
11 changes: 5 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ Installation
Official Sources
----------------

Because of some packages being absent from PyPI (such as `xESMF`), we strongly recommend installing
`xscen` in an Anaconda environment.
Because of some packages being absent from PyPI (such as `xESMF`), we strongly recommend installing `xscen` in an Anaconda environment.

`xscen` can be installed directly from Anaconda.org:
`xscen` can be installed directly from conda-forge:

.. code-block:: console
$ conda install -c ouranosinc xscen
$ conda install -c conda-forge xscen
.. note::

Expand All @@ -24,8 +23,8 @@ If for some reason you wish to install the `PyPI` version of `xscen` into an exi
$ pip install xscen
Development Installation (conda + pip)
--------------------------------------
Development Installation (Anaconda + pip)
-----------------------------------------

For development purposes, we provide the means for generating a conda environment with the latest dependencies in an `environment.yml` file at the top-level of the `Github repo`_.

Expand Down
Loading

0 comments on commit a2f01ba

Please sign in to comment.