Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 8 commits into from
Nov 15, 2024
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
Loading