Skip to content

Commit ad49385

Browse files
committed
GCPy 1.7.0 release
This is the release commit of GCPy 1.7.0. Please see the CHANGELOG.md for a list of updates. Documentation for GCPy 1.7.0 is now available at gcpy.readthedocs.io. Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
2 parents d14a028 + 2c5c61e commit ad49385

File tree

78 files changed

+5137
-3623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+5137
-3623
lines changed

.github/workflows/build-gcpy-environment-py312.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
21+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
2222
steps:
2323
- name: Checkout the GCPy repository
2424
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
persist-credentials: false
28+
2529
- name: Create "gcpy_env" environment
2630
uses: mamba-org/setup-micromamba@v1
2731
with:
@@ -31,9 +35,11 @@ jobs:
3135
cache-environment: false
3236
generate-run-shell: true
3337
post-cleanup: 'all'
38+
3439
- name: Test if "import gcpy" works
3540
run: python -c "import gcpy"
3641
shell: micromamba-shell {0}
42+
3743
- name: Test if we can create a plot
3844
run: python -m gcpy.examples.plotting.create_test_plot
3945
shell: micromamba-shell {0}

.github/workflows/build-gcpy-environment-py313.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
#
33
# GitHub action to build the GCPy production environment
4-
# (for Python 3.12) with micromamba
4+
# (for Python 3.13) with micromamba
55
# See: https://github.com/marketplace/actions/setup-micromamba
66
#
77
name: build-gcpy-environment-py313
@@ -18,10 +18,14 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
21+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
2222
steps:
2323
- name: Checkout the GCPy repository
2424
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
persist-credentials: false
28+
2529
- name: Create "gcpy_env" environment
2630
uses: mamba-org/setup-micromamba@v1
2731
with:
@@ -31,9 +35,11 @@ jobs:
3135
cache-environment: false
3236
generate-run-shell: true
3337
post-cleanup: 'all'
38+
3439
- name: Test if "import gcpy" works
3540
run: python -c "import gcpy"
3641
shell: micromamba-shell {0}
42+
3743
- name: Test if we can create a plot
3844
run: python -m gcpy.examples.plotting.create_test_plot
3945
shell: micromamba-shell {0}

.github/workflows/build-rtd-environment.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
20+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
2121
steps:
2222
- name: Checkout the GCPy repository
2323
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
persist-credentials: false
27+
2428
- name: Create "rtd_env" environment
2529
uses: mamba-org/setup-micromamba@v1
2630
with:
@@ -30,6 +34,7 @@ jobs:
3034
cache-environment: false
3135
generate-run-shell: true
3236
post-cleanup: 'all'
37+
3338
- name: Get version numbers of packages
3439
run: |
3540
python --version

.github/workflows/codeql.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
steps:
4848
- name: Checkout repository
4949
uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
persist-credentials: false
5053

5154
# Initializes the CodeQL tools for scanning.
5255
- name: Initialize CodeQL
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Workflow to run linting checks on source
2+
name: Lint
3+
4+
# Controls when the workflow will run
5+
on:
6+
# Triggers the workflow on pushes to the "main", "dev", or "dev/** branches,
7+
# i.e., PR merges
8+
push:
9+
branches: [ "main", "dev", "dev/**" ]
10+
11+
# Triggers the workflow on pushes to open pull requests with code changes
12+
pull_request:
13+
paths:
14+
- '.github/workflows/*.yml'
15+
16+
# Allows you to run this workflow manually from the Actions tab
17+
# (usually leave it blank)
18+
workflow_dispatch:
19+
20+
# Allow the jobs to read the secret GitHub token
21+
permissions:
22+
contents: read
23+
24+
# Cancel jobs running if new commits are pushed
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
27+
cancel-in-progress: true
28+
29+
# Workflow run - one or more jobs that can run sequentially or in parallel
30+
jobs:
31+
32+
# This workflow contains a single job called "lint"
33+
lint:
34+
35+
# The type of runner that the job will run on
36+
runs-on: ubuntu-latest
37+
38+
# Don't quit the Action at the first
39+
strategy:
40+
fail-fast: false
41+
42+
# GitHub secret token
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
# Steps represent a sequence of tasks that will be
47+
# executed as part of the job
48+
steps:
49+
50+
# Checks-out your repository under $GITHUB_WORKSPACE,
51+
# so your job can access it
52+
- name: Checkout code
53+
with:
54+
persist-credentials: false
55+
uses: actions/checkout@v4
56+
57+
# Installs Python 3.x
58+
- name: Install Python
59+
uses: actions/setup-python@v5
60+
with:
61+
python-version: '3.x'
62+
63+
# Installs Python packages
64+
- name: Install dependencies
65+
run: |
66+
python -m pip install --upgrade pip
67+
python -m venv ci_venv
68+
. ci_venv/bin/activate
69+
pip install zizmor==0.9.2
70+
71+
# Apply GitHub Actions linter, zizmor
72+
- name: zizmor
73+
if: always()
74+
run: |
75+
cd ${{ github.workspace }}
76+
. ci_venv/bin/activate
77+
zizmor .github/workflows/*.yml
Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,51 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
1+
# This workflow will upload a Python Package using Twine when a
2+
# release is created. For more information see:
3+
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
34

45
# This workflow uses actions that are not certified by GitHub.
56
# They are provided by a third-party and are governed by
67
# separate terms of service, privacy policy, and support
78
# documentation.
89

9-
name: Upload GCPy to PyPI
10+
name: Publish GCPy to PyPI as geoschem-gcpy
1011

1112
on:
1213
release:
1314
types: [published]
1415

15-
permissions:
16-
contents: read
17-
1816
jobs:
17+
1918
deploy:
2019

20+
permissions:
21+
id-token: write
22+
contents: read
23+
2124
runs-on: ubuntu-latest
2225

2326
steps:
24-
- uses: actions/checkout@v4
25-
- name: Set up Python
26-
uses: actions/setup-python@v5
27-
with:
28-
python-version: '3.x'
29-
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install build
33-
- name: Build package
34-
run: python -m build
35-
- name: Publish package
36-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37-
with:
38-
user: __token__
39-
password: ${{ secrets.PYPI_KEY }}
27+
28+
- name: Checkout GCPy code
29+
uses: actions/checkout@v4
30+
with:
31+
persist-credentials: false
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: '3.x'
37+
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install build
42+
43+
- name: Build GCPy
44+
run: python -m build
45+
46+
# NOTE: We have defined https://github.com/geoschem/gcpy
47+
# as a Trusted Publisher for geoschem-gcpy at PyPI.org
48+
- name: Publish geoschem-gcpy
49+
uses: pypa/gh-action-pypi-publish@release/v1
50+
with:
51+
skip-existing: true

.release/changeVersionNumbers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function main() {
9696
# Replace version numbers in files
9797
replace "${pattern}" "\[${version}\] - ${date}" "${file}"
9898
[[ $? -ne 0 ]] && exitWithError "${file}"
99-
echo "GCClassic version updated to ${version} in ${file}"
99+
echo "GCPy version updated to ${version} in ${file}"
100100

101101
#========================================================================
102102
# Update version number in setup.py

CHANGELOG.md

Lines changed: 80 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,80 @@ All notable changes to GCPy will be documented in this file.
44

55
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).
66

7+
## [1.7.0] - 2026-01-29
8+
### Added
9+
- Added `gcpy/profile/vtune_plot_hotspots.py` to plot a bargraph of hotspots from Intel VTune reports
10+
- Added ReadTheDocs documentation for plotting hotspots from Intel VTune reports
11+
- Added "Lint" GitHub Action to check other actions for security issues
12+
- Added `gcpy_environment_py314.ym1` to specify the GCPy environment packages with Python 3.14
13+
- Added GitHub action `build-gcpy-environment-py314.yml` to test building the GCPy environment with Python 3.14
14+
- Added call to drop GC-Classic variables when regridding a GC-Classic restart file to cubed-sphere
15+
- Added `Ap` and `Bp` parameters for GCAP2 vertical grids
16+
- Added new constants for default lon/lat and stretched-grid settings in `gcpy/constants.py`
17+
- Added PyDoc headers in routines where they were missing
18+
- Added `examples/grids/display_gcclassic_grid_info.py` to display info about a GEOS-Chem Classic horizontal grid
19+
- Added functions `get_molwt_from_metadata` and `read_species_metadata` to `gcpy/util.py`
20+
- Added function `get_species_database_files` to `gcpy/benchmark/modules/benchmark_utils.py`
21+
- Added constant `SPECIES_DATABASE` to `gcpy/benchmark/modules/benchmark_utils.py`
22+
- Added manual garbage collection in `create_regridders`, `compare_single_level`, and `compare_zonal_mean` functions.
23+
- Added helpful tips to the `gcpy/benchmark/benchmark.slurm.sh` script
24+
- Added function `datetime64_to_str` to `gcpy/date_time.py`
25+
- Added keyword arguments `ref_hdr_label` and `dev_hdr_label` to `make_benchmark_mass_tables`
26+
- Added "HEMCO Examples" chapter to ReadTheDocs documentation
27+
28+
### Changed
29+
- Modified criteria for terminating read of log files in `benchmark_scrape_gcclassic_timers.py` to avoid being spoofed by output that is attached by Intel VTune
30+
- Moved `gprofng_text_to_data_units` to function `text_to_data_units` in `gcpy/plot/core.py` so that it can be used by `gprofng_functions` and `vtune_plot_hotspots`
31+
- Updated GitHub badges in `README.md` and `docs/source/index.rst`
32+
- Expanded possible stretched grid attribute names to include `STRETCH_FACTOR`, `TARGET_LAT`, and `TARGET_LON`
33+
- Changed regridding for plots to always compare stretched-grid to uniform CS grid on the uniform CS grid rather than whatever grid is ref
34+
- Updated PDF writing algorithm in `compare_single_level` and `compare_zonal_mean` to use `PdfReader` and `PdfWriter` instead of `PdfMerger`
35+
- Bumped `pypdf` from version 4.2.0 to 6.6.2 in `setup.py` and environment files
36+
- Moved `Ap` and `Bp` parameters that define vertical grids from `grid.py` to `vgrid_defs.py`
37+
- Replaced hardwired default lon/lat and stretched-grid settings with new constants from `gcpy/constants.py`
38+
- Modified code in several modules as directed by Pylint to better conform to the Python style guide
39+
- Renamed grid routines to use all lower-case letters in order to conform to Python snake-case convention
40+
- Remamed `vert_grid` class in `gcpy/grid.py` to `VertGrid` to conform to PascalCase naming convention
41+
- Replaced `hashlib.sha1` with `hashlib.sha256` in routine `sg_hash` in `gcpy/regrid.py`
42+
- Bumped `pip` to version 25.2 as suggested by Dependabot
43+
- Required passing template output file to offline restart regridding that has grid dimensions that do not match target restart grid
44+
- Changed offline restart regridding to preserve source restart file precision
45+
- Changed `mamba` to `conda` in `benchmarks/benchmark_slurm.sh`
46+
- Separated plot and table options for clarity in `benchmarks/config/*yml` and `benchmarks/cloud/*.yml`
47+
- Clarified the GCPy installation process in ReadTheDocs documentation
48+
- Updated the instructions in the "Create a Test Plot" example in ReadTheDocs documentation
49+
- Updated default GCPy Python environment to use Python 3.13 (instead of 3.12)
50+
- Benchmark routines now look for `species_database.yml` in the `Ref` and `Dev` run directories
51+
- Replaced `get_species_database_dir` with `get_species_database_files` in `gcpy/benchmark/modules/benchmark_funcs.py`
52+
- Updated `gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py` to look for GCHP timers in `allPEs.log` if not found in the log file
53+
- Updated routine `make_benchmark_aerosol_tables` to include all dust species in the aerosol burdens table
54+
- Optimized function `get_diff_of_diffs` (in `gcpy/util.py`) for performance
55+
- Optimized function `add_lumped_species_to_dataset` (in `gcpy/benchmark/modules/benchmark_utils.py`) for performance
56+
- Optimized the algorithm to generate `varlist` in `make_benchmark_conc_plots`. Also truncated datasets to only contain variables in `varlist`.
57+
- Updated `make_benchmark_aod_plots` to include column AOD plots for DSTbin1..DSTbin7 species
58+
- Updated `benchmark/modules/aod_species.py` with metadata for DSTbin1..DSTbin7 species
59+
- Updated `make_benchmark_mass_tables` and `create_global_mass_table` to allow Ref and Dev to have different dates if so chosen
60+
- Updated `run_benchmark.py` to generate mass tables at start and end of the simulation
61+
- Updated `run_1yr_fullchem_benchmark.py` and `run_1yr_tt_benchmark.py` to generate mass tables at the 1st day of each month from Jan 2019 thru Jan 2020
62+
- Updated `run_benchmark.py` to take the `AREA` field from the GCHP restart file at the end of the month when computing mass tables for 1hr/1mon benchmarks
63+
- Updated routine `convert_units` to reshape the area variable tomatch input data on the GCHP checkpoint grid
64+
65+
### Fixed
66+
- Fixed grid area calculation scripts of `grid_area` in `gcpy/gcpy/cstools.py`
67+
- Fixed various security issues in GitHub Actions workflows
68+
- Fixed colorbar bounds for case of comparing cubed-sphere grids
69+
- Fixed the restart regridding for stretched GCHP when target lat/lon is exactly 0.0 in `gcpy/regrid_restart_file.py`
70+
- Fixed computation of the global AOD benchmark table caused by hardwired species names
71+
- Fixed error in `create_benchmark_emissions_table` where all species were assumed to be in Ref and Dev even if they were not
72+
- Fixed error that caused the GCHP vs GCC diff-of-diffs AnnualMean plots to be computed as a difference of means instead of a mean of differences
73+
74+
### Removed
75+
- Removed `PdfMerger()` from `compare_single_level` and `compare_zonal_mean`, it has been removed in pypdf >= 5.0.0
76+
- Removed `.load()` statements from xarray Datasets to improve performance
77+
- Removed `paths:spcdb_dir` YAML tag in benchmark configuration files
78+
- Removed `st_Ox` from `benchmark_categories.yml`; this species is no longer used in TransportTracers simulations
79+
- Removed keyword argument `label` from `make_benchmark_mass_tables`
80+
781
## [1.6.2] - 2025-06-12
882
### Added
983
- Added `create_benchmark_sanity_check_table` routine to `gcpy/benchmark/benchmark_funcs.py` to test if variables are all zero or NaN
@@ -18,37 +92,25 @@ n
1892

1993
### Changed
2094
- Updated `gcpy_environment_py313.yml` to use `esmf==8.8.1` and `esmpy==8.8.1` to fix package inconsistency issues
95+
- Updated ReadTheDocs to instruct users to install Conda via the Miniforge distribution, as MambaForge is deprecated
96+
- Updated `geos-chem-shared-docs/editing_these_docs.rst` with instructions for using a Conda environment to build RTD doc
2197

2298
### Fixed
2399
- Fixed logic error in `compare_varnames` that caused 2D data variables to be flagged as 3D (esp. for GCHP vs GCC comparisons)
24100
- Replaced incorrect collection name `AOD` with `Aerosols` in the GCC vs. GCC 1-month AOD plots
25101
- Fix the logic of ravel_1D that creates orbit file for 1D GCHP diagnostic
26102

27-
## [1.6.2] - 2025-06-12
28-
### Changed
29-
- Bumped `requests` from 2.32.3 to 2.32.4 in environment files to fix a security issue flagged by Dependabot
30-
31-
### Fixed
32-
- Fix the logic of ravel_1D that creates orbit file for 1D GCHP diagnostic
103+
### Removed
104+
- Removed `gchp_is_pre_14.0` logical in calls to `get_filepaths` in benchmark modules
33105

34106
## [1.6.2] - 2025-06-12
35-
### Added
36-
- Added `create_benchmark_sanity_check_table` routine to `gcpy/benchmark/benchmark_funcs.py` to test if variables are all zero or NaN
37-
- Added a chapter on using code profiling tools in the ReadTheDocs documentatio
38-
n
39-
- Added code profiling scripts (in `gcpy/gcpy/profile`) to read and display output from gprofng and Intel VTune profilers
40-
- Added `check_gchp_emission_diags.py` example script and documentation
41-
- Added new benchmark functions `make_benchmark_collection_2d_var_plots` and `make_benchmark_collection_3d_var_plots` which can be used with any GEOS-Chem output collection
42-
- Added 1-month benchmark comparison plot options for `Budget`, `UVFlux`, and `StateMet` collections (2D and 3D vars separately) which are off by default
43-
- Added `export MPLBACKEND=agg` to `gcpy/benchmark/modules/benchmark_slurm.sh` to request a non-interactive MatPlotLib backend
44-
- Added `method` keyword argument to `make_regridder_*` routines in `regrid.py`, with default value `conservative`
45-
46107
### Changed
47-
- Updated `gcpy_environment_py313.yml` to use `esmf==8.8.1` and `esmpy==8.8.1` to fix package inconsistency issues
108+
- Bumped `requests` from 2.32.3 to 2.32.4 in environment files to fix a security issue flagged by Dependabot
48109

49110
### Fixed
50111
- Fixed logic error in `compare_varnames` that caused 2D data variables to be flagged as 3D (esp. for GCHP vs GCC comparisons)
51112
- Replaced incorrect collection name `AOD` with `Aerosols` in the GCC vs. GCC 1-month AOD plots
113+
- Fix the logic of ravel_1D that creates orbit file for 1D GCHP diagnostic
52114

53115
## [1.6.1] - 2025-03-24
54116
### Added

0 commit comments

Comments
 (0)