Skip to content

Commit

Permalink
Merge branch 'dev' into feature/update-model-vs-obs
Browse files Browse the repository at this point in the history
This merge brings the feature/update-model-vs-obs branch up-to-date
with the latest updates in dev.

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Nov 3, 2023
2 parents c50f46f + 2caafb9 commit fce497e
Show file tree
Hide file tree
Showing 35 changed files with 6,032 additions and 48,678 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main", "dev" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main", "dev" ]
schedule:
- cron: '21 14 * * 2'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
23 changes: 23 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pylint

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
27 changes: 27 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests

on:
schedule:
- cron: '32 22 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
25 changes: 12 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Added `ENCODING = "UTF-8"` to `gcpy/constants.py`
- Added statement `from dask.array import Array as DaskArray` in `gcpy plot.py`
- Added SLURM run script `gcpy/benchmark/benchmark_slurm.sh`
- Added `gcpy/plot/gcpy_plot_style` style sheet for title and label default settings
- Added `gcpy/gcpy_plot_style` style sheet for title and label default settings
- Added new cubed-sphere grid inquiry functions to `gcpy/cstools.py`
- Added functions `get_ilev_coord` and `get_lev_coord` to `gcpy/grid.py`
- Add `tk` package to `docs/environment_files/environment.yml`

### Changed
- Simplified the Github issues templates into two options: `new-feature-or-discussion.md` and `question-issue.md`
Expand Down Expand Up @@ -61,6 +65,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Now allow `plot_val` to be of type `dask.array.Array` in `plot.py` routines `six_plot` and `single_panel`
- Now add `if` statements to turn of `Parallel()` commands when `n_jobs==1`.
- Do not hardwire fontsize in `gcpy/plot.py`; get defaults from `gcpy_plot_style`
- `gcpy/plot.py` has been split up into smaller modules in the `gcpy/plot` folder
- Updated and cleaned up code in `gcpy/regrid.py`
- Example scripts`plot_single_level` and `plot_comparisons` can now accept command-line arguments
- Example scripts `plot_single_level.py`, `plot_comparisons.py`, `compare_diags.py` now handle GCHP restart files properly

### Fixed
- Generalized test for GCHP or GCClassic restart file in `regrid_restart_file.py`
Expand All @@ -69,6 +77,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Prevent plot panels from overlapping in six-panel plots
- Prevent colorbar tick labels from overlapping in dynamic-range ratio plots
- Updated `seaborn` plot style names to conform to the latest matplotlib
- Set `lev:positive` and/or `ilev:positive` properly in `regrid_restart_file.py` and `file_regrid.py`
- Prevent overwriting of `lev` coord in `file_regrid.py` at netCDF write time
- Fixed bug in option to allow different units when making comparison plots

### Removed
- Removed `gchp_is_pre_13_1` arguments & code from benchmarking routines
Expand All @@ -78,6 +89,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Removed `gcpy_test_dir` option from `examples/diagnostics/compare_diags.*`
- Removed `docs/environment_files/gchp_regridding.yml` environment file
- Removed `gcpy/gcpy/benchmark/plot_driver.sh`
- Made benchmark configuration files consistent

## [1.3.3] -- 2023-03-09
### Added
Expand Down Expand Up @@ -365,16 +377,3 @@ This is the first labeled version of GCPy. The primary functionality of GCPy is
- Support for plotting benchmark output for both GEOS-Chem Classic (lat/lon data) and GCHP (cubed-sphere data).

The first official release version of GCPy, v1.0.0, will correspond with the release of GEOS-Chem 13.0.0.


## [Unreleased]

### Added

### Changed

### Deprecated

### Fixed

### Removed
1 change: 1 addition & 0 deletions docs/environment_files/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies:
- 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
Expand Down
2 changes: 1 addition & 1 deletion gcpy/benchmark/benchmark_slurm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
export OMP_STACKSIZE=500m

# Turn on Python environment (edit for your setup)
mamba activate gcpy_140_env
mamba activate gcpy_env

# Specify a YAML file with benchmark options
# Uncomment the file that you wish:
Expand Down
14 changes: 7 additions & 7 deletions gcpy/benchmark/cloud/template.1hr_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
# customize in the following manner:
#
# (1) Edit the path variables so that they point to folders
# containing model data.
# (2) Edit the version strings for each benchmark simulation.
# containing model data
# (2) Edit the version strings for each benchmark simulation
# (3) Edit the switches that turn on/off creating of plots and
# tables, as well as other plotting options.
# tables as well as other plotting options
# (4) If necessary, edit labels for the dev and ref versions
#
# Note: When doing GCHP vs GCC comparisions gchp_dev will be compared
# to gcc_dev (not gcc_ref!). This ensures consistency in version names
# when doing GCHP vs GCC diff-of-diffs (mps, 6/27/19)
# when doing GCHP vs GCC diff-of-diffs.
# =====================================================================
#
# Configuration for 1-hour FullChemBenchmark
Expand Down Expand Up @@ -76,11 +76,11 @@ data:
is_pre_14.0: False
resolution: c24
#
# options: Customizes the benchmark plot output.
# options: Customizes the benchmark plot output
#
options:
#
# bmk_type: Specifies the type of benchmark.
# bmk_type: Specifies the type of benchmark
#
bmk_type: FullChemBenchmark
#
Expand All @@ -103,7 +103,7 @@ options:
run: False
dir: GCHP_GCC_diff_of_diffs
#
# outputs: Specifies the plots and tables to generate.
# outputs: Specifies the plots and tables to generate
#
outputs:
plot_conc: False
Expand Down
16 changes: 8 additions & 8 deletions gcpy/benchmark/cloud/template.1mo_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
# customize in the following manner:
#
# (1) Edit the path variables so that they point to folders
# containing model data.
# (2) Edit the version strings for each benchmark simulation.
# containing model data
# (2) Edit the version strings for each benchmark simulation
# (3) Edit the switches that turn on/off creating of plots and
# tables, as well as other plotting options.
# tables as well as other plotting options
# (4) If necessary, edit labels for the dev and ref versions
#
# Note: When doing GCHP vs GCC comparisions gchp_dev will be compared
# to gcc_dev (not gcc_ref!). This ensures consistency in version names
# when doing GCHP vs GCC diff-of-diffs (mps, 6/27/19)
# when doing GCHP vs GCC diff-of-diffs.
# =====================================================================
#
# Configuration for 1 month FullChemBenchmark
# Configuration for 1-month FullChemBenchmark
#
# paths:
# main_dir: High-level directory containing ref & dev rundirs
Expand Down Expand Up @@ -76,11 +76,11 @@ data:
is_pre_14.0: False
resolution: c24
#
# options: Customizes the benchmark plot output.
# options: Customizes the benchmark plot output
#
options:
#
# bmk_type: Specifies the type of benchmark.
# bmk_type: Specifies the type of benchmark
#
bmk_type: FullChemBenchmark
#
Expand All @@ -103,7 +103,7 @@ options:
run: False
dir: GCHP_GCC_diff_of_diffs
#
# outputs: Specifies the plots and tables to generate.
# outputs: Specifies the plots and tables to generate
#
outputs:
plot_conc: True
Expand Down
Loading

0 comments on commit fce497e

Please sign in to comment.