Skip to content

Commit

Permalink
GCPy 1.4.2 release
Browse files Browse the repository at this point in the history
This is the release of GCPy 1.4.2, which includes:

- PR #286 (Github Action for GCPy environment)
- PR #287 (Fix dictionary key error for benchmark plotting)
- PR #289 (Use pegged versions in environment.yml; update GitHub actions

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Jan 26, 2024
2 parents a056352 + 70d649a commit 4bd730f
Show file tree
Hide file tree
Showing 17 changed files with 422 additions and 73 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build-gcpy-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
#
# GitHub action to build the GCPy production environment with micromamba
# See: https://github.com/marketplace/actions/setup-micromamba
#
name: build-gcpy-environment

on:
push:
branches: [ "main", "dev" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main", "dev" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout the GCPy repository
uses: actions/checkout@v2
- name: Create "gcpy_env" environment
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: 'latest'
environment-file: docs/environment_files/environment.yml
init-shell: bash
cache-environment: true
generate-run-shell: true
post-cleanup: 'all'
- name: Test if "import gcpy" works
run: python -c "import gcpy"
shell: micromamba-shell {0}
- name: Test if we can create a plot
run: python -m gcpy.examples.plotting.create_test_plot
shell: micromamba-shell {0}
38 changes: 38 additions & 0 deletions .github/workflows/build-test-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
#
# GitHub action to build the GCPy test environment with micromamba
# See: https://github.com/marketplace/actions/setup-micromamba
#
name: build-test-environment

on:
push:
branches: [ "main", "dev" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main", "dev" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- name: Checkout the GCPy repository
uses: actions/checkout@v2
- name: Create "testing" environment
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: 'latest'
environment-file: docs/environment_files/testing.yml
init-shell: bash
cache-environment: true
generate-run-shell: true
post-cleanup: 'all'
- name: Test if "import gcpy" works
run: python -c "import gcpy"
shell: micromamba-shell {0}
- name: Test if we can create a plot
run: python -m gcpy.examples.plotting.create_test_plot
shell: micromamba-shell {0}
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to GCPy will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.4.2] - 2024-01-26
### Added
- Example script `create_test_plot.py`, which can be used to check that GCPy has been installed properly
- GitHub action `build-gcpy-environment` which tests installation of the mamba environment specified in in `docs/environment_files/environment.yml`
- YAML file`docs/environment_files/testing.yml` for building an environment without pegged package versions (for testing)
- GitHub action `build-test-environment` to test the environment specified in `testing.yml`

### Changed
- `build-gcpy-environment` GitHub action now runs with several Python versions

### Fixed
- Prevent overwriting of the `results` variable when parallel plotting is deactivated (`n_cores: 1`)

## [1.4.1] - 2023-12-08
### Fixed
- Now use the proper default value for the `--weightsdir` argument to `gcpy/file_regrid.py`
Expand Down Expand Up @@ -157,7 +170,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Now use restarts_subdir tag from YAML file for paths to restart files (@yantosca)
- GCPy now uses proper year for dev in 1-yr benchmarks (@laestrada)
- Fixed date string issue in benchmarking scripts (@lizziel)
- Updates for new GCHP restart file format (@lizziel)
- Updates for new GCHP restart file format (@lizziel)
- Updated environment.yml with package versions that work together (@yantosca)
- Updated the AUTHORS.txt and LICENSE.txt files (@yantosca)

Expand Down
89 changes: 40 additions & 49 deletions docs/environment_files/environment.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,50 @@
---
# ======================================================================
# GCPy environment file
#
# Recommended installation: with Mambaforge
# $ mamba env create -n gcpy_env --file=/path/to/gcpy/environment.yml
#
# Some package versions are not the most recent, but these
# have been proven to work together. (Bob Yantosca, 14 Aug 2023)
# These package versions have been proven to work together.
# See: https://github.com/geoschem/gcpy/issues/284
# ======================================================================
name: gcpy_env
channels:
- conda-forge
- nodefaults
- conda-forge
- nodefaults
dependencies:
- awscli # Utilities for AWS cloud
- cartopy # Geospatial data processing
- cf_xarray # CF conventions for xarray
- dask # Parallel library; backend for xarray
- gridspec # Define Earth System Model grids
- ipython # Interactive Python (used by Jupyter)
- joblib # Parallelize python code
- jupyter # Jupyter Notebook
- matplotlib # Creates plots and visualizations
- netcdf4 # Python wrapper for netCDF
- netcdf-fortran # Python wrapper for netCDF-Fortran
- numpy # Optimized mathematical functions
- pandas # Tables/timeseries manipulation
- pip # Install packages from PyPi
- pylint # Python linter
- pyproj # Python map projections library
- python<3.10 # Any python version prior to 3.10
- pypdf # PDF utilities (bookmarks, etc.)
- recommonmark # Dependency for Sphinx
- requests # HTTP library
- scipy # Scientific python package
- sparselt>=0.1.3 # Regridding earth system model data
- tabulate # Pretty-printing for column data
- tk # Tcl/tk library
- xarray # Read data from netCDF etc files
#
# NOTE: These packages need to be pegged at specific versions
# in order to avoid an ImportError.
# -- Bob Yantosca (14 Aug 2023)
#
- esmf==8.1.1 # Earth system modeling framework
- esmpy==8.1.1 # Python wrapper for ESMF
- xesmf==0.5.1 # Universal regridder
#
# NOTE: These packages need to be pegged at specific versions
# or else the ReadTheDocs output won't render properly.
# -- Bob Yantosca (14 Aug 2023)
#
- docutils==0.16 # Convert text to other formats
- jinja2==3.0.3 # Dependency for Sphinx
- sphinx==3.5.4 # Generate ReadTheDocs output
- sphinx-autoapi==1.9.0 # Sphinx autodoc style documentation
- sphinx-autobuild==2021.3.14 # Build ReadTheDos live in browser
- sphinxcontrib-bibtex==2.2.0 # ReadTheDocs bibliography style
- sphinx_rtd_theme==0.5.2 # ReadTheDocs HTML theme files
- awscli==2.13.39 # Utilities for AWS cloud
- cartopy==0.22.0 # Geospatial data processing
- cf_xarray==0.8.4 # CF conventions for xarray
- dask==2023.9.2 # Parallel library; backend for xarray
- gridspec==0.1.0 # Define Earth System Model grids
- ipython==8.15.0 # Interactive Python (used by Jupyter)
- joblib==1.3.2 # Parallelize python code
- jupyter==1.0.0 # Jupyter Notebook
- matplotlib==3.8.0 # Creates plots and visualizations
- netcdf4==1.6.0 # Python wrapper for netCDF
- netcdf-fortran==4.5.4 # Python wrapper for netCDF-Fortran
- numpy==1.26.0 # Optimized mathematical functions
- pandas==2.1.1 # Tables/timeseries manipulation
- pip==23.2.1 # Install packages from PyPi
- pylint==2.17.5 # Python linter
- pyproj==3.6.1 # Python map projections library
- python==3.9.18 # Any python version prior to 3.10
- pypdf==3.16.1 # PDF utilities (bookmarks, etc.)
- recommonmark==0.7.1 # Dependency for Sphinx
- requests==2.31.0 # HTTP library
- scipy==1.11.2 # Scientific python package
- sparselt==0.1.3 # Regridding earth system model data
- tabulate==0.9.0 # Pretty-printing for column data
- tk==8.6.12 # Tcl/tk library
- xarray==2023.8.0 # Read data from netCDF etc files
- esmf==8.1.1 # Earth system modeling framework
- esmpy==8.1.1 # Python wrapper for ESMF
- xesmf==0.5.1 # Universal regridder
- docutils==0.16 # Convert text to other formats
- jinja2==3.0.3 # Dependency for Sphinx
- sphinx==3.5.4 # Generate ReadTheDocs output
- sphinx-autoapi==1.9.0 # Sphinx autodoc style documentation
- sphinx-autobuild==2021.3.14 # Build ReadTheDos live in browser
- sphinxcontrib-bibtex==2.2.0 # ReadTheDocs bibliography style
- sphinx_rtd_theme==0.5.2 # ReadTheDocs HTML theme files
52 changes: 52 additions & 0 deletions docs/environment_files/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# ======================================================================
# GCPy testing environment file.
# Intended to be used by the GCST for testing purposes.
#
# GCPy users should build the environment from "environment.yml",
# as this will specify package versions that are known to work.
# See: https://github.com/geoschem/gcpy/issues/284
# ======================================================================
name: testing
channels:
- conda-forge
- nodefaults
dependencies:
- awscli # Utilities for AWS cloud
- cartopy # Geospatial data processing
- cf_xarray # CF conventions for xarray
- dask # Parallel library; backend for xarray
- gridspec # Define Earth System Model grids
- ipython # Interactive Python (used by Jupyter)
- joblib # Parallelize python code
- jupyter # Jupyter Notebook
- matplotlib>=3.8 # Creates plots and visualizations
- netcdf4 # Python wrapper for netCDF
- netcdf-fortran # Python wrapper for netCDF-Fortran
- numpy # Optimized mathematical functions
- pandas # Tables/timeseries manipulation
- pip # Install packages from PyPi
- pylint # Python linter
- pyproj # Python map projections library
- python # Any python version prior to 3.10
- pypdf # PDF utilities (bookmarks, etc.)
- recommonmark # Dependency for Sphinx
- requests # HTTP library
- scipy # Scientific python package
- sparselt # Regridding earth system model data
- tabulate # Pretty-printing for column data
- tk # Tcl/tk library
- xarray # Read data from netCDF etc files
#
# NOTE: These packages are known to work, so peg these versions
#
- esmf==8.1.1 # Earth system modeling framework
- esmpy==8.1.1 # Python wrapper for ESMF
- xesmf==0.5.1 # Universal regridder
- docutils==0.16 # Convert text to other formats
- jinja2==3.0.3 # Dependency for Sphinx
- sphinx==3.5.4 # Generate ReadTheDocs output
- sphinx-autoapi==1.9.0 # Sphinx autodoc style documentation
- sphinx-autobuild==2021.3.14 # Build ReadTheDos live in browser
- sphinxcontrib-bibtex==2.2.0 # ReadTheDocs bibliography style
- sphinx_rtd_theme==0.5.2 # ReadTheDocs HTML theme files
6 changes: 3 additions & 3 deletions docs/source/Release_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ versions of GCPy on Github, PyPi, and conda-forge.
- :file:`setup.py`
- :file:`gcpy/_version.py`
- :file:`docs/source/conf.py`
- :file:`benchmark/run_benchmark.py`
- :file:`benchmark/modules/run_1yr_fullchem_benchmark.py`
- :file:`benchmark/modules/run_1yr_tt_benchmark.py`
- :file:`gcpy/benchmark/run_benchmark.py`
- :file:`gcpy/benchmark/modules/run_1yr_fullchem_benchmark.py`
- :file:`gcpy/benchmark/modules/run_1yr_tt_benchmark.py`
|br|

#. Update :file:`CHANGELOG.md` |br|
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'GEOS-Chem Support Team'

# The full version, including alpha/beta/rc tags
release = '1.4.1'
release = '1.4.2'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion gcpy/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '1.4.2'

__version__ = '1.4.1'
20 changes: 13 additions & 7 deletions gcpy/benchmark/modules/run_1yr_fullchem_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
https://github.com/ipython/ipython/issues/10627
This script corresponds with GCPy 1.4.0. Edit this version ID if releasing
This script corresponds with GCPy 1.4.2. Edit this version ID if releasing
a new version of GCPy.
"""

Expand Down Expand Up @@ -694,8 +694,9 @@ def gcc_vs_gcc_mass_table(mon):
for mon in range(bmk_n_months)
)
else:
results = []
for mon in range(bmk_n_months):
results = gcc_vs_gcc_mass_table(mon)
results.append(gcc_vs_gcc_mass_table(mon))

# ==================================================================
# GCC vs GCC operations budgets tables
Expand Down Expand Up @@ -741,8 +742,9 @@ def gcc_vs_gcc_ops_budg(mon):
for mon in range(bmk_n_months)
)
else:
results = []
for mon in range(bmk_n_months):
results = gcc_vs_gcc_ops_budg(mon)
results.append(gcc_vs_gcc_ops_budg(mon))

# ==================================================================
# GCC vs GCC aerosols budgets/burdens tables
Expand Down Expand Up @@ -1255,8 +1257,9 @@ def gchp_vs_gcc_mass_table(mon):
for mon in range(bmk_n_months)
)
else:
results = []
for mon in range(bmk_n_months):
results = gchp_vs_gcc_mass_table(mon)
results.append(gchp_vs_gcc_mass_table(mon))

# ==================================================================
# GCHP vs GCC operations budgets tables
Expand Down Expand Up @@ -1311,8 +1314,9 @@ def gchp_vs_gcc_ops_budg(mon):
for mon in range(bmk_n_months)
)
else:
results = []
for mon in range(bmk_n_months):
results = gchp_vs_gcc_ops_budg(mon)
results.append(gchp_vs_gcc_ops_budg(mon))

# ==================================================================
# GCHP vs GCC aerosol budgets and burdens tables
Expand Down Expand Up @@ -1863,8 +1867,9 @@ def gchp_vs_gchp_mass_table(mon):
for mon in range(bmk_n_months)
)
else:
results = []
for mon in range(bmk_n_months):
results = gchp_vs_gchp_mass_table(mon)
results.append(gchp_vs_gchp_mass_table(mon))

# ==================================================================
# GCHP vs GCHP operations budgets tables
Expand Down Expand Up @@ -1921,8 +1926,9 @@ def gchp_vs_gchp_ops_budg(mon):
for mon in range(bmk_n_months)
)
else:
results = []
for mon in range(bmk_n_months):
results = gchp_vs_gchp_ops_budg(mon)
results.append(gchp_vs_gchp_ops_budg(mon))

# ==================================================================
# GCHP vs GCHP aerosol budgets and burdens tables
Expand Down
Loading

0 comments on commit 4bd730f

Please sign in to comment.