From c6be272bce4659f3c228c512fa4e81b442a23b19 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 22 May 2026 16:34:51 -0500 Subject: [PATCH 1/2] ADD: GitHub Actions workflow running pytest on Python 3.10-3.13. Uses micromamba to provision a conda env from a new CI-specific file (continuous_integration/environment-ci.yml) that omits the python pin and the upstream cmac install so each matrix Python version is built fresh and tested against the in-tree code. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/tests.yml | 44 +++++++++++++++++++++++ continuous_integration/environment-ci.yml | 20 +++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/tests.yml create mode 100644 continuous_integration/environment-ci.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..48bb50f --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,44 @@ +name: Tests + +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + +jobs: + unit-tests: + name: pytest (Python ${{ matrix.python-version }}) + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13"] + + defaults: + run: + shell: bash -el {0} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up micromamba + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: continuous_integration/environment-ci.yml + environment-name: cmac_test_env + create-args: >- + python=${{ matrix.python-version }} + cache-environment: true + + - name: Install cmac + run: pip install --no-deps -e . + + - name: Run unit tests + run: pytest -v cmac/tests/ diff --git a/continuous_integration/environment-ci.yml b/continuous_integration/environment-ci.yml new file mode 100644 index 0000000..080ec91 --- /dev/null +++ b/continuous_integration/environment-ci.yml @@ -0,0 +1,20 @@ +name: cmac_test_env +channels: + - conda-forge + - defaults +dependencies: + - arm_pyart + - cartopy + - cmweather + - coincbc + - cython + - dask + - distributed + - matplotlib + - numpy + - pytest + - scikit-fuzzy + - wradlib + - pip + - pip: + - git+https://github.com/CSU-Radarmet/CSU_RadarTools.git From 866e7a7d692e1cea1d84d469f5df89811e28d4c4 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 22 May 2026 16:38:31 -0500 Subject: [PATCH 2/2] FIX: Correct stale xsapr_i5_ppi save_name assertion in test_config. The xsapr_i5_ppi default save_name in default_config.py is sgpxsaprcmacsecI5.c1, not sgpxsaprcmacsurI5.c1. The mismatch was masked until the new GitHub Actions workflow started running pytest. Co-Authored-By: Claude Opus 4.7 (1M context) --- cmac/tests/test_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmac/tests/test_config.py b/cmac/tests/test_config.py index c9b3a46..508b334 100644 --- a/cmac/tests/test_config.py +++ b/cmac/tests/test_config.py @@ -8,7 +8,7 @@ def test_get_cmac_values(): cmac_config = get_cmac_values('xsapr_i5_ppi') assert type(cmac_config) == dict - assert cmac_config['save_name'] == 'sgpxsaprcmacsurI5.c1' + assert cmac_config['save_name'] == 'sgpxsaprcmacsecI5.c1' assert cmac_config['site_alt'] == 328 assert cmac_config['ref_offset'] == 0.0 assert cmac_config['self_const'] == 60000.00