Skip to content

Commit

Permalink
fix for special accumulation case where MASSDEN 0h field ends in '_1' (
Browse files Browse the repository at this point in the history
…#247)

* fix for special accumulation case where MASSDEN 0h field ends in '_1'

* add whitespace to pass pylint test.

* Update micromamba with guidance from migration link

https://github.com/mamba-org/provision-with-micromamba#migration-to-setup-micromamba%60

* Try completely new syntax with the micromamba migration

* Use micromamba changes from graphics_test in hrrr_maps_tests

Craig added changes that Christina made for new micromamba syntax in graphics_tests here as well.

* more changes to hrrr_maps_tests from graphics_tests

more changes to hrrr_maps_tests from graphics_tests, missed in last commit

* one more hrrr_maps_test change

another change from the graphics_tests side that needed to be brought over to hrrr_maps_tests.

* more small edits to hrrr_maps_tests script

taking out some bad syntax

---------

Co-authored-by: Christina Holt <[email protected]>
  • Loading branch information
cshartsough and christinaholtNOAA authored Nov 15, 2024
1 parent 4fb9ddf commit f4ca05f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/graphics_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,15 @@ jobs:
uses: actions/checkout@v2
with:
lfs: true
- name: Install Micromamba with no environment
uses: mamba-org/provision-with-micromamba@main
- name: Install Micromamba with pygraf environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
channel-priority: flexible
environment-file: environment.yml
cache-downloads: true
cache-env: true
- name: Install pygraf environment
run: micromamba create -n pygraf -y -f /home/runner/work/pygraf/pygraf/environment.yml
cache-environment: true
- name: Lint code
run: |
micromamba activate pygraf
find . -type f -name "*.py" | xargs pylint
run: find . -type f -name "*.py" | xargs pylint
shell: bash -el {0}
- name: Test code
run: |
micromamba activate pygraf
python -m pytest --nat-file tests/data/wrfnat_hrconus_07.grib2 --prs-file tests/data/wrfprs_hrconus_07.grib2 --ignore=tests/test_hrrr_maps.py
run: python -m pytest --nat-file tests/data/wrfnat_hrconus_07.grib2 --prs-file tests/data/wrfprs_hrconus_07.grib2 --ignore=tests/test_hrrr_maps.py
shell: bash -el {0}
15 changes: 5 additions & 10 deletions .github/workflows/hrrr_maps_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,14 @@ jobs:
https://noaa-hrrr-bdp-pds.s3.amazonaws.com/hrrr.20230315/conus/hrrr.t00z.wrfprsf12.grib2
EOF
ls
- name: Install Micromamba with no environment
uses: mamba-org/provision-with-micromamba@main
- name: Install Micromamba with pygraf environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
channel-priority: flexible
environment-file: environment.yml
cache-downloads: true
cache-env: true
- name: Install pygraf environment
run: micromamba create -n pygraf -y -f /home/runner/work/pygraf/pygraf/environment.yml
- name: Test code
run: |
micromamba activate pygraf
export GITHUB_WORKSPACE=$(pwd)
export $data_loc
export $output_loc
python -m pytest tests/test_hrrr_maps.py
python -m pytest tests/test_hrrr_maps.py
shell: bash -el {0}
4 changes: 4 additions & 0 deletions adb_graphics/datahandler/gribfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def free_fcst_names(self, ds, fcst_type):
if suffix in special_suffixes and needs_renaming:
new_suffix = f'{suffix}1h' if 'global' not in self.model else f'{suffix}6h'
ret[var] = var.replace(suffix, new_suffix)
# MASSDEN is a special case when ending in "avg_1'"
if var.split('_')[0] == 'MASSDEN' and var.split('_')[-2] == 'avg':
print(f'Special change to MASSDEN avg_1 name to avg1h_1')
ret[var] = var.replace('avg', 'avg1h')
else:
# Only rename these variables at late hours
odd_variables = [
Expand Down

0 comments on commit f4ca05f

Please sign in to comment.