Skip to content

Commit

Permalink
Merge PR geoschem#251 (Update gcpy_env environment to install with Ma…
Browse files Browse the repository at this point in the history
…mbaForge)

This merge brings PR geoschem#251 (Update gcpy_env environment to install with
MambaForge and to use latest package versions; Update scripts accordingly,
by @yantosca) into the GCPy 1.4.0 development stream.

This updates the docs/environments/environment.yml file to use more
modern package versions, thus eliminating the dependence on Conda 4.12,
and allowing installation with MambaForge.  Several updates were also
made to gcpy/util.py and gcpy/plot.py due to changes in Python packages.

Furthermore, we have now abstracted some code out of the six_plot routine
in gcpy/plot.py into separate functions. This should make the code
easier to maintain and understand.

See geoschem#251 for more information.

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Aug 17, 2023
2 parents 4039c5c + 9ad90a6 commit d041e29
Show file tree
Hide file tree
Showing 6 changed files with 1,163 additions and 794 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Added new routine `verify_variable_type` function in `gcpy/util.py`
- Added new routine `format_number_for_table` in `util.py`
- Added BrSALA and BrSALC to `emission_species.yml`
- Added `ENCODING = "UTF-8"` to `gcpy/constants.py`

### Changed
- Simplified the Github issues templates into two options: `new-feature-or-discussion.md` and `question-issue.md`
- The GitHub PR template is now named `./github/PULL_REQUEST_TEMPLATE.md`
- Now specify package `requests-2.31.0` in `environment.py` (fixes a security issue)
- Updated badge links in `README.md`
- Construct ops budget table filename without using the `label` argument
- Updated species_database.yml for consistency with GEOS-Chem 14.2.0
Expand All @@ -39,7 +39,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Routine `print_totals` now prints small and/or large numbers in scientific notation
- Truncate names in benchmark & emissions tables to improve readability
- Add TransportTracers species names to `gcpy/emissions_*.yml` files
- Updated `docs/environment_files/environment.yml` to install `pyproj==3.6.0` via pip
- Updated `docs/environment_files/environment.yml` for MambaForge (also added `gridspec`)
- Now use `pypdf` instead of `PyPDF2` in `plot.py` and `util.py`
- Added coding suggestions made by `pylint` where possible
- Abstracted and never-nested code from `six_plot` into functions (in `plot.py`)

### Fixed
- Generalized test for GCHP or GCClassic restart file in `regrid_restart_file.py`
Expand All @@ -52,6 +55,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Removed `benchmark_emission_totals.ipynb`, this is obsolete
- Replaced `gcpy/benchmark/README` with `README.md`
- Removed `gcpy_test_dir` option from `examples/diagnostics/compare_diags.*`
- Removed `docs/environment_files/gchp_regridding.yml` environment file

## [1.3.3] -- 2023-03-09
### Added
Expand Down
86 changes: 51 additions & 35 deletions docs/environment_files/environment.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,58 @@
# ======================================================================
# 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)
# ======================================================================
name: gcpy_env
channels:
- conda-forge
- defaults
- nodefaults
dependencies:
- cartopy=0.19.0.post1 # Geospatial data processing
- 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
- 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
- netcdf4==1.6.0 # Python wrapper for netCDF
- netcdf-fortran==4.5.4 # Python wrapper for netCDF-Fortran
- python==3.9.6 # Python version 3.9.6
- pip==21.2.1 # Install packages from PyPi
- sparselt>=0.1.3 # Regridding earth system model data
- xesmf==0.5.1 # Universal regridder
- pip:
- awscli>=1.22.83 # Utilities for AWS cloud
- cf_xarray==0.7.4 # CF conventions for xarray
- dask==2021.7.1 # Parallel library; backend for xarray
- docutils==0.16 # Convert text to other formats
- h5netcdf==0.11.0 # Python interface to netCDF4/HDF5
- h5py==3.3.0 # Python interface to HDF5
- matplotlib==3.4.2 # Creates plots and visualizations
- ipython==8.11.0 # Interactive Python (used by Jupyter)
- jinja2==3.0.3 # Dependency for Sphinx
- joblib==1.0.1 # Parallelize python code
- jupyter==1.0.0 # Jupyter Notebook
- numpy==1.21.1 # Optimized mathematical functions
- pandas==1.3.1 # Tables/timeseries manipulation
- pycodestyle==2.9.1 # Python style checker (formerly PEP8)
- pyproj==3.6.0 # Python map projections library
- pylint==2.15.3 # Python linter
- pypdf2==1.26.0 # PDF utilities (bookmarks, etc.)
- recommonmark==0.7.1 # Dependency for Sphinx
- requests==2.26.0 # HTTP library
- scipy==1.7.0 # Scientific python package
- 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
- tabulate==0.8.9 # Pretty-printing for column data
- xarray==0.17.0 # Read data from netCDF etc files
#
# 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
12 changes: 0 additions & 12 deletions docs/environment_files/gchp_regridding.yml

This file was deleted.

5 changes: 5 additions & 0 deletions gcpy/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,8 @@
TABLE_WIDTH = 105
COL_WIDTH = 20

# ======================================================================
# Default encoding for file I/O
# ======================================================================
ENCODING = "UTF-8"

Loading

0 comments on commit d041e29

Please sign in to comment.