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

Release v0.4.1 #477

Merged
merged 69 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
880ff18
start adding more unit tests
jlmaurer Dec 23, 2022
14aec09
a bunch of additions and move files to main test dir
jlmaurer Jan 10, 2023
ea35fb4
Add a maniftest.in for conda build
jhkennedy Jan 11, 2023
b2e36ce
update manifest
jhkennedy Jan 11, 2023
3c963c2
explicitely set include-pacakge-data=true, which should be true by de…
jhkennedy Jan 12, 2023
aee545a
absolute link instead of relative link for Utah HRRR archive
asjohnston-asf Jan 13, 2023
fc646e4
Merge pull request #468 from asjohnston-asf/patch-1
jlmaurer Jan 13, 2023
e0c459e
MANIFEST not working; try setuptools
jhkennedy Jan 18, 2023
d2fb66a
update changelog
jhkennedy Jan 18, 2023
26a4f1f
bump to latest actions; drop minconda for micromamba
jhkennedy Jan 18, 2023
84b1b32
fix build workflow
jhkennedy Jan 18, 2023
bf6b545
Merge pull request #467 from jhkennedy/conda-manifest
jhkennedy Jan 18, 2023
f819a82
Fix interpolation when passing lat/lon files and station file
bbuzz31 Jan 10, 2023
e927372
bug fix
bbuzz31 Jan 10, 2023
25aa177
update changelog
bbuzz31 Jan 10, 2023
5655b98
few updates to validators
bbuzz31 Jan 10, 2023
3522936
bug fix in validators
bbuzz31 Jan 10, 2023
c7324c6
undo flipping S/N of output cube
bbuzz31 Jan 11, 2023
884f2ec
implement rioxarray DEM interpolation
bbuzz31 Jan 13, 2023
9c878d5
fix introduced bugs
bbuzz31 Jan 14, 2023
545be7d
Clean up tests for new DEM interpolation
bbuzz31 Jan 14, 2023
4b6b1c8
undo local changes for intersect test
bbuzz31 Jan 15, 2023
46373a6
use '.' instead of os.getcwd or pytest fails
bbuzz31 Jan 15, 2023
567b7db
clean up tests
bbuzz31 Jan 16, 2023
070a021
correct write paths; support station file DEM
bbuzz31 Jan 16, 2023
edd1648
update changelog
bbuzz31 Jan 16, 2023
11d6016
consistently name files between aois
bbuzz31 Jan 17, 2023
dfc4e78
easily change weather model for different tests
bbuzz31 Jan 17, 2023
a038bfc
correct path for weather model plot
bbuzz31 Jan 17, 2023
905092e
GMAO test; update golden; clean up
bbuzz31 Jan 17, 2023
3673e55
always check for height levels
bbuzz31 Jan 17, 2023
a8a0e02
store nans in intersect if nan in target
bbuzz31 Jan 17, 2023
3161e93
typo
bbuzz31 Jan 17, 2023
251a5f1
remove local path from test
bbuzz31 Jan 18, 2023
679054d
Merge pull request #465 from bbuzz31/InterpolationFix
dbekaert Jan 18, 2023
8dab423
update gunw entrypoint to upload and download from s3
forrestfwilliams Jan 18, 2023
a4a573b
change model arg name to weather_model
forrestfwilliams Jan 18, 2023
9e70098
add weather_model options
forrestfwilliams Jan 18, 2023
d8beb99
fix argparse error
forrestfwilliams Jan 18, 2023
8694b4d
modify docker entrypoint for hyp3
forrestfwilliams Jan 18, 2023
56fd2bc
fix entrypoint errors
forrestfwilliams Jan 18, 2023
0292229
Update tools/RAiDER/cli/raider.py
jhkennedy Jan 18, 2023
679d3e7
Drop unused imports; clean up some comments/linting
jhkennedy Jan 18, 2023
2073194
don't use underscores in argument names
jhkennedy Jan 18, 2023
ea0c420
clean up file,bucket logic
jhkennedy Jan 18, 2023
bd74426
Add changelog entry
jhkennedy Jan 18, 2023
257e173
use RAiDER logger for in aws
jhkennedy Jan 18, 2023
d82b86c
Fix ContentType when uploading to S3
jhkennedy Jan 18, 2023
ca526a7
Unrestrict upload to s3
jhkennedy Jan 18, 2023
92a8844
Update docker instructions on README
jhkennedy Jan 18, 2023
9887152
provide short -f option for --file and fix tests
jhkennedy Jan 19, 2023
5e93946
Merge pull request #473 from forrestfwilliams/hyp3_integration
jhkennedy Jan 19, 2023
1c6d764
add warning for negative height levels
jlmaurer Jan 18, 2023
7212742
fix a typo in conda command in README
jlmaurer Jan 18, 2023
5e59c64
add catch for NaNs in the weather model and warning if negative heigh…
jlmaurer Jan 18, 2023
5273685
move some stuff to functions to clean up the main cube function
jlmaurer Jan 18, 2023
7edfe48
streamline a bit
jlmaurer Jan 19, 2023
2300c47
fix a few small issues and remove depracated tests
jlmaurer Jan 19, 2023
949e437
add unit tests for delay fcns
jlmaurer Jan 19, 2023
1d5e940
Update aws.py
jhkennedy Jan 19, 2023
ff435db
Merge pull request #474 from dbekaert/jhkennedy-patch-1
jhkennedy Jan 19, 2023
0136661
make sure that SCENARIO_DIR does not exist
jlmaurer Jan 19, 2023
c5958d4
fix which error should be raised when model does not exist
jlmaurer Jan 19, 2023
16bd2f6
Merge branch 'more_unittests_and_docstrings' into few_small_fixes
jlmaurer Jan 19, 2023
cde28b6
remove files that get regenerated from git and redundant files
jlmaurer Jan 20, 2023
d95f3cf
remove depracated code
jlmaurer Jan 22, 2023
0ce9e94
Merge pull request #475 from jlmaurer/few_small_fixes
jlmaurer Jan 22, 2023
119e9b2
Add notice of provisionality to GUNW workflow
jhkennedy Jan 23, 2023
43e0577
Merge pull request #478 from dbekaert/jhkennedy-patch-1
jhkennedy Jan 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ on:

jobs:
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.7.0
with:
conda_env_name: RAiDER
python_version: '3.10'

call-docker-ghcr-workflow:
needs: call-version-info-workflow
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.7.0
with:
version_tag: ${{ needs.call-version-info-workflow.outputs.version_tag }}
release_branch: main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ on:

jobs:
call-changelog-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.7.0
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 3 additions & 5 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ jobs:
with:
fetch-depth: 0

- uses: conda-incubator/setup-miniconda@v2
- uses: mamba-org/provision-with-micromamba@v14
with:
mamba-version: "*"
python-version: '3.10'
activate-environment: RAiDER
environment-file: environment.yml
extra-specs: |
python=3.10

- name: install RAiDER
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeled-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ on:

jobs:
call-labeled-pr-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.7.0
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.7.0
with:
release_prefix: RAiDER
develop_branch: dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
call-bump-version-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.6.0
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.7.0
with:
user: dbekaert
email: bekaertdavid@gmail.com
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [0.4.1]
jhkennedy marked this conversation as resolved.
Show resolved Hide resolved

### New/Updated Features
+ Reorder target points for intersection
+ Use exact coordinates of DEM to interpolate heights to target lat/lons
+ Support DEM interpolation to station file
+ Implement end-to-end test for intersection of cube with lat/lon files
+ Implement end-to-end test for calculation at stations delay
+ Update AOI to store the output directory so DEM is written to right place
+ `calcDelaysGUNW` will optionally download a GUNW product from AWS S3, process it, and upload a new version of the GUNW product in-place with the tropospheric correction layers added so that RAiDER can be used in ARIA GUNW production via HyP3

### Fixed
+ Package data is more explicitly handled so that it is included in the conda-forge build; see [#467](https://github.com/dbekaert/RAiDER/pull/467)

## [0.4.0]

Adding of new GUNW support to RAiDER. This is an interface delivery allowing for subsequent integration into HYP3 (input/output parsing is not expected to change; computed data is not yet verified).
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.profile && \

RUN python -m pip install --no-cache-dir /RAiDER/

ENTRYPOINT ["/usr/bin/bash"]
CMD ["-l"]
ENTRYPOINT ["/RAiDER/tools/RAiDER/etc/entrypoint.sh"]
CMD ["--help"]
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ or the current development version:
docker pull ghcr.io/dbekaert/raider:test
```

To run the container and jump into a bash shell inside:
To run `raider.py` inside the container:
```
docker run -it --rm ghcr.io/dbekaert/raider:latest
```
Expand All @@ -68,6 +68,11 @@ To mount your current directory inside the container so that files will be writt
docker run -it -v ${PWD}:/home/raider/work --rm ghcr.io/dbekaert/raider:latest
cd work
```
To jump into a `bash` shell inside the container:
```
docker run -it --rm --entrypoint /bin/bash ghcr.io/dbekaert/raider:latest -l
```

For more docker run options, see: <https://docs.docker.com/engine/reference/run/>.


Expand Down Expand Up @@ -98,7 +103,7 @@ For development, we recommend installing directly from source.
```
git clone https://github.com/dbekaert/RAiDER.git
cd RAiDER
conda create -f environment.yml
conda env create -f environment.yml
conda activate RAiDER
python -m pip install -e .
```
Expand Down
2 changes: 1 addition & 1 deletion docs/WeatherModels.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ERA-5/ERA-I products require access to the ESA Copernicus servers. GMAO and MERR
------

## 2. NOAA weather models (HRRR)
High-resolution rapid refresh (HRRR) weather model data products are generated by __[NOAA](https://rapidrefresh.noaa.gov/hrrr/)__ for the coninental US (CONUS) but not archived beyond three days. However, a public __[archive](home.chpc.utah.edu/~u0553130/Brian_Blaylock/hrrr_FAQ.html)__ is available at the University of Utah. This archive does not require a license agreement. This model has the highest spatial resolution available in RAiDER, with a horizontal grid spacing of about 3 km, and is provided in a Lambert conformal conic projection.
High-resolution rapid refresh (HRRR) weather model data products are generated by __[NOAA](https://rapidrefresh.noaa.gov/hrrr/)__ for the coninental US (CONUS) but not archived beyond three days. However, a public __[archive](https://home.chpc.utah.edu/~u0553130/Brian_Blaylock/hrrr_FAQ.html)__ is available at the University of Utah. This archive does not require a license agreement. This model has the highest spatial resolution available in RAiDER, with a horizontal grid spacing of about 3 km, and is provided in a Lambert conformal conic projection.

------

Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
- python>=3.8
- pip
# For running
- boto3
- cdsapi
- cfgrib
- cmake
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ repository = "https://github.com/dbekaert/RAiDER"
"generateGACOSVRT.py" = "RAiDER.models.generateGACOSVRT:main"

[tool.setuptools]
include-package-data = true
zip-safe = false

[tool.setuptools.packages.find]
where = ["tools"]

[tool.setuptools.package-data]
"*" = ["*.yml", "*.yaml"]

[tool.isort]
known_first_party = "RAiDER"
multi_line_output = 5
Expand Down
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
markers =
long: mark a test as a long
1 change: 1 addition & 0 deletions test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ def pushd(dir):
TEST_DIR = test_dir.absolute()
DATA_DIR = os.path.join(TEST_DIR, "data")
GEOM_DIR = os.path.join(TEST_DIR, 'test_geom')
WM = 'GMAO'
1 change: 1 addition & 0 deletions test/_entrypoints.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


def test_raider__main__2(script_runner):
ret = script_runner.run('generateGACOSVRT.py')
assert ret.success
Expand Down
118 changes: 0 additions & 118 deletions test/cli/_argument_parsers.py

This file was deleted.

24 changes: 14 additions & 10 deletions test/test_GUNW.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
import glob
import os
import shutil
import numpy as np
import pytest
import shutil
import subprocess
import xarray as xr

import numpy as np
import rasterio as rio
import xarray as xr

from test import TEST_DIR

WM = 'GMAO'

def test_GUNW():
## eventually to be implemented
# home = os.path.expanduser('~')
# netrc = os.path.join(home, '.netrc')
#
#
# ## make netrc
# if not os.path.exists(netrc):
# name, passw = os.getenv('URSname'), os.getenv('URSpass')
# cmd = f'echo "machine urs.earthdata.nasa.gov login {name} password {passw}" > ~/.netrc'
# subprocess.run(cmd.split())
#
#
# cmd = f'chmod 600 {netrc}'
# subprocess.run(cmd.split())
#
#
SCENARIO_DIR = os.path.join(TEST_DIR, "GUNW")
os.makedirs(SCENARIO_DIR, exist_ok=True)
GUNW = 'S1-GUNW-D-R-071-tops-20200130_20200124-135156-34956N_32979N-PP-913f-v2_0_4.nc'
Expand All @@ -36,7 +37,7 @@ def test_GUNW():
# proc = subprocess.run(cmd.split(), stdout=subprocess.PIPE, universal_newlines=True)
# assert np.isclose(proc.returncode, 0)

cmd = f'raider.py ++process calcDelaysGUNW {updated_GUNW} -m GMAO -o {SCENARIO_DIR}'
cmd = f'raider.py ++process calcDelaysGUNW -f {updated_GUNW} -m {WM} -o {SCENARIO_DIR}'
proc = subprocess.run(cmd.split(), stdout=subprocess.PIPE, universal_newlines=True)
assert np.isclose(proc.returncode, 0)

Expand All @@ -45,7 +46,9 @@ def test_GUNW():
transform = (0.1, 0.0, -119.35, 0, -0.1, 35.05)
group = 'science/grids/corrections/external/troposphere'
for v in 'troposphereWet troposphereHydrostatic'.split():
ds = rio.open(f'netcdf:{updated_GUNW}:{group}/{v}')
with rio.open(f'netcdf:{updated_GUNW}:{group}/{v}') as ds:
ds.crs.to_epsg()
assert np.isclose(ds.crs.to_epsg(), epsg), 'CRS incorrect'
assert ds.transform.almost_equals(transform), 'Affine Transform incorrect'

Expand All @@ -56,9 +59,10 @@ def test_GUNW():

crs = rio.crs.CRS.from_wkt(ds['crs'].crs_wkt)
assert np.isclose(crs.to_epsg(), epsg), 'CRS incorrect'


# Clean up files
shutil.rmtree(SCENARIO_DIR)
os.remove('GUNW_20200130-20200124.yaml')
return
[os.remove(f) for f in glob.glob(f'{WM}*')]
return
Loading