Skip to content

Commit

Permalink
Bump to v0.4.0 (#384)
Browse files Browse the repository at this point in the history
- Bump conda env dependencies and remove unused dependencies
- Update GH Actions build workflow with latest dependencies
- Fix `mypy` warnings and errors
  • Loading branch information
tomvothecoder authored Nov 9, 2022
1 parent e5ef35e commit d5d4fd7
Show file tree
Hide file tree
Showing 15 changed files with 136 additions and 108 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ jobs:

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Checkout Code Repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Set up Python 3.9
uses: actions/setup-python@v2
name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: 3.9
python-version: "3.10"

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
# Run all pre-commit hooks on all the files.
# Getting only staged files can be tricky in case a new PR is opened
# since the action is run on a branch in detached head state
name: Install and Run Pre-commit
uses: pre-commit/action@v2.0.3
uses: pre-commit/action@v3.0.0

build:
name: Build (Python ${{ matrix.python-version }})
Expand All @@ -60,11 +60,11 @@ jobs:
do_not_skip: '["push", "workflow_dispatch"]'

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
uses: actions/checkout@v2
uses: actions/checkout@v3

- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Cache Conda
uses: actions/cache@v2
uses: actions/cache@v3
env:
# Increase this value to reset cache if conda-env/ci.yml has not changed in the workflow
CACHE_NUMBER: 0
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
name: Upload Coverage Report
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
file: "tests_coverage_reports/coverage.xml"
fail_ci_if_error: true
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: check-yaml

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.10.0
hooks:
- id: black

Expand All @@ -23,22 +23,22 @@ repos:
# Need to use flake8 GitHub mirror due to CentOS git issue with GitLab
# https://github.com/pre-commit/pre-commit/issues/1206
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8
args: ["--config=setup.cfg"]
additional_dependencies: [flake8-isort]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v0.990
hooks:
- id: mypy
args: ["--config=setup.cfg"]
additional_dependencies:
[
dask==2022.7.1,
numpy==1.22.4,
pandas==1.4.3,
xarray==2022.6.0,
dask==2022.10.2,
numpy==1.23.4,
pandas==1.5.1,
xarray==2022.11.0,
types-python-dateutil==2.8.19,
]
73 changes: 73 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,79 @@
History
=======

v0.4.0 (9 November 2022)
--------------------------

This minor release includes a feature update to support datasets that
have *N* dimensions mapped to *N* coordinates to represent an axis. This
means ``xcdat`` APIs are able to intelligently select which axis's
coordinates and bounds to work with if multiple are present within the
dataset. Decoding time is now a lazy operation, leading to significant
upfront runtime improvements when opening datasets with
``decode_times=True``.

A new notebook called “A Gentle Introduction to xCDAT” was added to the
documentation gallery to help guide new xarray/xcdat users. xCDAT is now
hosted on Zenodo with a DOI for citations.

There are various bug fixes for bounds, naming of spatial weights, and a
missing flag for ``xesmf`` that broke curvilinear regridding.

Features
~~~~~~~~

- Support for N axis dimensions mapped to N coordinates by
`Tom Vo`_ and `Stephen Po-Chedley`_ in
https://github.com/xCDAT/xcdat/pull/343

- Rename ``get_axis_coord()`` to ``get_dim_coords()`` and
``get_axis_dim()`` to ``get_dim_keys()``
- Update spatial and temporal accessor class methods to refer to the
dimension coordinate variable on the data_var being operated on,
rather than the parent dataset

- Decoding times (``decode_time()``) is now a lazy operation, which
results in significant runtime improvements by `Tom Vo`_ in
https://github.com/xCDAT/xcdat/pull/343

Bug Fixes
~~~~~~~~~

- Fix ``add_bounds()`` not ignoring 0-dim singleton coords by
`Tom Vo`_ and `Stephen Po-Chedley`_ in
https://github.com/xCDAT/xcdat/pull/343
- Fix name of spatial weights with singleton coord by `Tom Vo`_ in
https://github.com/xCDAT/xcdat/pull/379
- Fixes ``xesmf`` flag that was missing which broke curvilinear
regridding by `Jason Boutte`_ and `Stephen Po-Chedley`_ in
https://github.com/xCDAT/xcdat/pull/374

Documentation
~~~~~~~~~~~~~

- Add FAQs section for temporal metadata by `Tom Vo`_ in
https://github.com/xCDAT/xcdat/pull/383
- Add gentle introduction notebook by `Tom Vo`_ in
https://github.com/xCDAT/xcdat/pull/373
- Link repo to Zenodo and upload GitHub releases by `Tom Vo`_ in
https://github.com/xCDAT/xcdat/pull/367
- Update project overview, FAQs, and add a link to xarray tutorials by
`Tom Vo`_ in https://github.com/xCDAT/xcdat/pull/365
- Update feature list, add metadata interpretation to FAQs, and add
``ipython`` syntax highlighting for notebooks by `Tom Vo`_ in
https://github.com/xCDAT/xcdat/pull/362

DevOps
~~~~~~

- Update release-drafter template by `Tom Vo`_ in
https://github.com/xCDAT/xcdat/pull/371 and
https://github.com/xCDAT/xcdat/pull/370
- Automate release notes generation by `Tom Vo`_ in
https://github.com/xCDAT/xcdat/pull/368

**Full Changelog**: https://github.com/xCDAT/xcdat/compare/v0.3.3...v0.4.0

v0.3.3 (12 October 2022)
------------------------

Expand Down
1 change: 0 additions & 1 deletion conda-env/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
- dask
- esmpy
- netcdf4
- numba >=0.55.2 # TODO: Remove this pin once `numba` is properly patched with `numpy` compatability.
- numpy
- pandas
- xarray
Expand Down
35 changes: 17 additions & 18 deletions conda-env/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ dependencies:
# Base
# ==================
# NOTE: If versions are updated, also `additional_dependencies` list for mypy in `.pre-commit-config.yaml`
- python=3.9.13 # TODO: Update to >=3.10 once sphinxcontrib-napoleon supports it.
- pip=22.2.2
- python=3.10.6
- pip=22.3.1
- cf_xarray=0.7.4
- cftime=1.6.1
- dask=2022.8.0
- netcdf4=1.6.0
- numba=0.55.2 # TODO: Remove this pin once `numba` is properly patched with `numpy` compatibility.
- numpy=1.22.4
- pandas=1.4.3
- cftime=1.6.2
- dask=2022.10.2
- netcdf4=1.6.1
- numpy=1.23.4
- pandas=1.5.1
- python-dateutil=2.8.2
- xarray=2022.6.0
- xarray=2022.11.0
# ==================
# Optional
# ==================
Expand All @@ -27,32 +26,32 @@ dependencies:
# Documentation
# ==================
- sphinx=4.5.0
- sphinxcontrib-napoleon=0.7
- sphinx-autosummary-accessors=2022.4.0
- sphinx-book-theme=0.3.3
- sphinx-copybutton=0.5.0
- nbsphinx=0.8.9
- pandoc=2.19
- pandoc=2.19.2
- ipython=8.5.0 # Required for nbsphinx syntax highlighting
# ==================
# Quality Assurance
# ==================
# NOTE: If versions are updated, also update 'rev' in `.pre-commit.config.yaml`
- black=22.6.0
- black=22.10.0
- flake8=5.0.4
- flake8-isort=4.2.0
- flake8-isort=5.0.0
- isort=5.10.1
- mypy=0.971
- mypy=0.990
- pre-commit=2.20.0
- types-python-dateutil=2.8.19
# ==================
# Testing
# ==================
- pytest=7.1.2
- pytest-cov=3.0.0
- pytest=7.2.0
- pytest-cov=4.0.0
# ==================
# Developer Tools
# ==================
- matplotlib=3.5.2
- jupyterlab=3.4.5
- matplotlib=3.6.2
- jupyterlab=3.5.0
- tbump=6.9.0
prefix: /opt/miniconda3/envs/xcdat_dev
46 changes: 0 additions & 46 deletions conda-env/dev_min.yml

This file was deleted.

25 changes: 13 additions & 12 deletions conda-env/readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,32 @@ dependencies:
# Base
# ==================
# NOTE: If versions are updated, also `additional_dependencies` list for mypy in `.pre-commit-config.yaml`
- python=3.9.13 # TODO: Update to >=3.10 once sphinxcontrib-napoleon supports it.
- pip=22.2.2
- python=3.10.6
- pip=22.3.1
- cf_xarray=0.7.4
- cftime=1.6.1
- dask=2022.8.0
- netcdf4=1.6.0
- numba=0.55.2 # TODO: Remove this pin once `numba` is properly patched with `numpy` compatibility.
- numpy=1.22.4
- pandas=1.4.3
- cftime=1.6.2
- dask=2022.10.2
- netcdf4=1.6.1
- numpy=1.23.4
- pandas=1.5.1
- python-dateutil=2.8.2
- types-python-dateutil=2.8.19
- xarray=2022.6.0
- xarray=2022.11.0
# ==================
# Optional
# ==================
- xesmf=0.6.3
# ==================
# ==================
# Quality Assurance
# ==================
- types-python-dateutil=2.8.19
# Documentation
# ==================
- sphinx=4.5.0
- sphinxcontrib-napoleon=0.7
- sphinx-autosummary-accessors=2022.4.0
- sphinx-book-theme=0.3.3
- sphinx-copybutton=0.5.0
- nbsphinx=0.8.9
- pandoc=2.19
- ipython=8.5.0 # Required for nbsphinx syntax highlighting.
- ipython=8.5.0 # Required for nbsphinx syntax highlighting.
prefix: /opt/miniconda3/envs/xcdat_rtd
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx_autosummary_accessors",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_autosummary_accessors",
"sphinx_copybutton",
"sphinxcontrib.napoleon",
"nbsphinx",
]

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ exclude =
venv

[mypy]
python_version = 3.9
python_version = 3.10
check_untyped_defs = True
ignore_missing_imports = True
warn_unused_ignores = True
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
test_suite="tests",
tests_require=test_requires,
url="https://github.com/xCDAT/xcdat",
version="0.3.3",
version="0.4.0",
zip_safe=False,
)
2 changes: 1 addition & 1 deletion tbump.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
github_url = "https://github.com/xCDAT/xcdat"

[version]
current = "0.3.3"
current = "0.4.0"

# Example of a semver regexp.
# Make sure this matches current_version before
Expand Down
2 changes: 1 addition & 1 deletion xcdat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
from xcdat.temporal import TemporalAccessor # noqa: F401
from xcdat.utils import compare_datasets # noqa: F401

__version__ = "0.3.3"
__version__ = "0.4.0"
Loading

0 comments on commit d5d4fd7

Please sign in to comment.