Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
f0b2fdc
Automatic ruff fixes
nate-kean Jul 11, 2024
6d00fbe
Eliminate star imports
nate-kean Jul 11, 2024
5883253
Eliminate comparisons to True or False
nate-kean Jul 11, 2024
f430f0a
Add ruff configuration
nate-kean Jul 15, 2024
de5e275
Remove unused variables
nate-kean Jul 15, 2024
a702131
Ignore D212
nate-kean Jul 16, 2024
d9d8cf7
Automatic ruff fixes based on new config
nate-kean Jul 16, 2024
f6322a4
More automatic fixes
nate-kean Jul 16, 2024
5e4efae
ruff format
nate-kean Jul 17, 2024
fe38b70
Add #672 to Unreleased
nate-kean Jul 17, 2024
089a769
Fix tautology
nate-kean Jul 18, 2024
934770d
Lint calcGUNW.py
nate-kean Jul 18, 2024
d34846b
Remove duplicate function test.__init__.py::update_yaml
nate-kean Jul 18, 2024
a0a9d3c
Lint prepFromGUNW.py
nate-kean Jul 19, 2024
085146c
ruff: ignore ANN101, D200, and D205
nate-kean Jul 19, 2024
e0fa378
Lint logger.py
nate-kean Jul 19, 2024
89d8def
Remove duplicate function test.write_yaml
nate-kean Jul 25, 2024
b5374eb
Remove ineffectual assignment
nate-kean Jul 25, 2024
5dc39c6
Formatting
nate-kean Jul 25, 2024
928e7c5
Partially lint utilFcns.py
nate-kean Jul 29, 2024
2eba291
Call raiderDelay as function for debugging
nate-kean Jul 29, 2024
6760f0c
Use pathlib.Path
nate-kean Jul 25, 2024
67fa426
Make default group when parameter is None
nate-kean Jul 29, 2024
b1ae306
Remove unnecessary removal of Nones
nate-kean Jul 29, 2024
5ecdf7d
Validate look direction
nate-kean Jul 29, 2024
a98b800
Allow yaml to dump tuples
nate-kean Jul 29, 2024
de9a36c
Add types
nate-kean Jul 29, 2024
b1a8844
Update test_validators.py
nate-kean Jul 29, 2024
b8b6bd8
Fix merge conflict
nate-kean Jul 29, 2024
b3d8011
Add type annotations
nate-kean Jul 29, 2024
6212c41
Fix merge conflict
nate-kean Jul 29, 2024
b0ad070
Add type annotations
nate-kean Jul 29, 2024
016df98
Fix merge conflict
nate-kean Jul 29, 2024
5fe4e0f
Type annotate RAiDER run configuration
nate-kean Jul 31, 2024
fd55756
Merge remote-tracking branch 'upstream/dev' into linting
nate-kean Jul 31, 2024
8147520
calcDelays: fix path to out file being lost
nate-kean Jul 31, 2024
0fd664b
Call calcDelays directly for debugging
nate-kean Jul 31, 2024
3cdc4fe
Formatting
nate-kean Jul 31, 2024
f3b1dbf
Add type annotations, use Path
nate-kean Jul 31, 2024
c9f9324
Fix merge conflict
nate-kean Jul 31, 2024
44abcbd
tropo_delay: default zref to toa, not _ZREF
nate-kean Aug 1, 2024
2ac79c8
Fix regression: cube_spacing_in_m missing from AOI
nate-kean Aug 1, 2024
d51f705
update test HRRR
royagrace Jul 12, 2024
ea5d55b
updated tmp path to test_download_UNR function
royagrace Jul 12, 2024
0712bf9
updated test_synthetic to delete any created files internally
royagrace Jul 16, 2024
4ef7476
Updated issue with creating files
royagrace Jul 17, 2024
fa56f94
updated changelog
royagrace Jul 18, 2024
55f5781
fixed temporary file path locations
royagrace Jul 28, 2024
bd64137
adding missing weathermodel file for test_intersect.py
royagrace Jul 28, 2024
4e7b657
formatted files with ruff
royagrace Jul 31, 2024
7f58065
Do not cast float argument to string
nate-kean Aug 1, 2024
eadf31b
Call calcDelays directly for debugging
nate-kean Aug 1, 2024
c849a91
Default cube_spacing_in_m to None
nate-kean Aug 1, 2024
c549548
Move rasterio typings to separate file
nate-kean Aug 1, 2024
74564c2
Use Path
nate-kean Aug 1, 2024
ba37429
Fix typo
nate-kean Aug 1, 2024
df3c493
Add type annotations
nate-kean Aug 1, 2024
7b0f8fe
Update __init__.py
nate-kean Aug 1, 2024
926fa91
Formatting
nate-kean Aug 1, 2024
cb938f7
Update docstring
nate-kean Aug 1, 2024
78a2f45
Fix bug from transition to Path
nate-kean Aug 1, 2024
0a7438e
Merge branch 'patch-credentials-tests' into linting
nate-kean Aug 1, 2024
39c4759
Update CHANGELOG.md for #672
nate-kean Aug 1, 2024
b1094d2
Merge branch 'dev' into patch-credentials-tests
nate-kean Aug 1, 2024
19a9d90
Give netrc empty string instead of None
nate-kean Aug 1, 2024
0bf14ab
Fix typo
nate-kean Aug 1, 2024
c1e89df
Merge branch 'patch-credentials-tests' of https://github.com/garlic-o…
nate-kean Aug 1, 2024
4001bda
Merge branch 'patch-credentials-tests' into linting
nate-kean Aug 1, 2024
62732f5
Update CHANGELOG.md for #679
nate-kean Aug 1, 2024
95c9822
Merge branch 'patch-credentials-tests' into linting
nate-kean Aug 1, 2024
35d09f6
Use Path
nate-kean Aug 1, 2024
4aae970
Update dem.py
nate-kean Aug 1, 2024
a2ea301
Add type annotations
nate-kean Aug 1, 2024
4792b1c
Add None check
nate-kean Aug 1, 2024
83e9596
Use Path
nate-kean Aug 1, 2024
8cc9722
Merge pull request #674 from royagrace/update_tests
jlmaurer Aug 5, 2024
077674f
Merge pull request #679 from garlic-os/patch-credentials-tests
jlmaurer Aug 5, 2024
9cf4208
Fix unmatched brackets error in Python 3.9
nate-kean Aug 5, 2024
db0a345
Do not raise if cleanup fails
nate-kean Aug 5, 2024
3ebaf1b
rio_open: always return profile
nate-kean Aug 5, 2024
27d06ba
Add type annotations
nate-kean Aug 5, 2024
10da509
Ensure readLL returns numpy arrays
nate-kean Aug 5, 2024
726b8da
Extract parsing CRS to function
nate-kean Aug 5, 2024
c0adcd2
rio_open: always return profile
nate-kean Aug 5, 2024
7374004
Merge branch 'dev' into linting
nate-kean Aug 5, 2024
6005d1e
Fix merge conflicts
nate-kean Aug 5, 2024
37684c7
Adapt for tmp_path
nate-kean Aug 5, 2024
e68f547
Delete mistakenly pushed test output
nate-kean Aug 5, 2024
db8de23
Fix unmatched brackets error in Python <=3.11
nate-kean Aug 5, 2024
14043dc
Don't use Self in Python <3.11
nate-kean Aug 5, 2024
b530460
Use getattr instead of eval
nate-kean Aug 6, 2024
1d184b5
Refactor to allow ruff to identify bare excepts
nate-kean Aug 6, 2024
173571d
Add ruff guide to CONTRIBUTING.md
nate-kean Aug 7, 2024
ec9c8cb
Normalize import aliases
nate-kean Aug 7, 2024
73bc0aa
Formatting
nate-kean Aug 7, 2024
a805368
Reorganize types.py files
nate-kean Aug 6, 2024
abd9914
Free overshadowed test test_check_weather_model_availability
nate-kean Aug 7, 2024
b94c1f9
Use Path, add type annotations
nate-kean Aug 7, 2024
0c0a6aa
Merge pull request #672 from garlic-os/linting
jlmaurer Aug 8, 2024
7c53b96
small tz fix
jlmaurer Sep 6, 2024
86d1018
fix template generation arguments
jlmaurer Sep 9, 2024
13b4e1d
update CHANGELOG
jlmaurer Sep 9, 2024
c79109a
Merge pull request #683 from jlmaurer/quick_tz_fix
bbuzzanga Sep 9, 2024
f7258be
ruff formatting three files
jlmaurer Aug 9, 2024
c9ae820
fix linting issues
jlmaurer Sep 6, 2024
92d8b15
Potential fix for checkContainment when bbox > world
jlmaurer Sep 10, 2024
a5c332c
fix some formatting issues
jlmaurer Sep 13, 2024
ad0cc48
Ruff formatting
jlmaurer Sep 13, 2024
36f5f2f
few more format fixes and changelog update
jlmaurer Sep 13, 2024
f79660f
quick commit
jlmaurer Oct 23, 2024
cfffa35
formatting changes to deal with version compatibility
jlmaurer Jan 11, 2025
90c6e17
test using microforge instead of micromamba
jlmaurer Jan 12, 2025
201dba7
test using miniforge instead of micromamba
jlmaurer Jan 12, 2025
3b17cca
Bump ASFHyP3/actions from 0.11.2 to 0.14.0
dependabot[bot] Jan 13, 2025
2e90144
fix DEM interpolator unit tests
jlmaurer Jan 15, 2025
3ae69c8
remove breakpoint
jlmaurer Jan 15, 2025
b235f62
fix a couple typos
jlmaurer Jan 15, 2025
6457335
Merge pull request #685 from jlmaurer/fix_check_containment
jlmaurer Jan 15, 2025
1fd248f
Merge pull request #698 from dbekaert/dependabot/github_actions/ASFHy…
jlmaurer Jan 16, 2025
a6a9ba7
updated utilFcns and affected files
royagrace Sep 13, 2024
f8ea76a
Fixed formatting and added types
royagrace Oct 2, 2024
7f8a72d
Fixed circular importing between llreader and utilFncs
royagrace Oct 3, 2024
f838ec8
updated changelog
royagrace Nov 23, 2024
8a869c2
fixed test that was generating file
royagrace Nov 23, 2024
07ce528
added tests to test_util.py
royagrace Nov 24, 2024
7fe5b7c
Added tests for utilFncs.py
royagrace Jan 12, 2025
08adbb2
updated changelog
royagrace Jan 12, 2025
6a4cb30
update path to Path
royagrace Jan 18, 2025
5961c97
changed Path.join to os.path.join
royagrace Jan 18, 2025
ad9b04b
Fix a few typos in the gnss ZTD downloader
jlmaurer Jan 21, 2025
cdb510d
Fix issue 693
jlmaurer Jan 21, 2025
f52122b
update changelog
jlmaurer Jan 21, 2025
c03749c
minor syntax updates
royagrace Jan 25, 2025
c129d77
try unlinking instead of pushdiring
royagrace Jan 26, 2025
e1b272b
fixed a few typos
royagrace Feb 2, 2025
76cbe58
Merge branch 'pr700' into test_update
royagrace Feb 3, 2025
b6f2a2e
fix gmao typo
royagrace Feb 3, 2025
eb3cb1f
Update CHANGELOG.md
jlmaurer Feb 3, 2025
8259b14
Merge pull request #701 from royagrace/test_update
jlmaurer Feb 3, 2025
3e084c6
exit successfully with no changes when run via hyp3 with weather_mode…
asjohnston-asf Feb 4, 2025
8a9af33
Merge pull request #702 from asjohnston-asf/hrrr-hyp3
cmarshak Feb 6, 2025
cfe1d51
Bump ASFHyP3/actions from 0.14.0 to 0.17.1
dependabot[bot] Feb 10, 2025
e4cbb8b
Update changelog for v0.5.4 release
asjohnston-asf Feb 14, 2025
1802322
Merge pull request #706 from asjohnston-asf/patch-3
jhkennedy Feb 19, 2025
68a5e67
Increase no_output_timout for CircleCI mamba env creation steps
jhkennedy Feb 19, 2025
191c679
pin herbie-data<2025.2.1
asjohnston-asf Feb 24, 2025
6d53c18
Merge remote-tracking branch 'trunk/jhkennedy-patch-1' into herbie-ve…
asjohnston-asf Feb 24, 2025
7139bc6
Merge pull request #709 from asjohnston-asf/herbie-version
jhkennedy Feb 25, 2025
d100caa
small typo fix
jlmaurer Feb 27, 2025
0f1a4c5
Merge pull request #711 from jlmaurer/small_fix
jlmaurer Feb 27, 2025
f59152b
Merge pull request #704 from dbekaert/dependabot/github_actions/ASFHy…
jlmaurer Feb 27, 2025
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
44 changes: 26 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,37 @@ jobs:
- checkout

- run:
name: Install micromamba
name: Install MiniForge
shell: /bin/bash -l
command: |
apt update --yes && apt-get upgrade --yes
apt install -y --no-install-recommends wget ca-certificates git

cd ${HOME}
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
eval "$(${HOME}/bin/micromamba shell hook -s posix)"
wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3.sh -b -p "${HOME}/conda"
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"

- run:
name: Create RAiDER environment
shell: /bin/bash -l
no_output_timeout: 30m
shell: /bin/bash -xl
command: |
eval "$(${HOME}/bin/micromamba shell hook -s posix)"
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"

PYTHON_VERSION="<< parameters.python-version >>"
sed -i "/python>=/c\ - python=${PYTHON_VERSION}" environment.yml
micromamba create -f environment.yml
mamba env create -f environment.yml

- run:
name: Install raider and check environment
shell: /bin/bash -l
shell: /bin/bash -xl
command: |
eval "$(${HOME}/bin/micromamba shell hook -s posix)"
micromamba activate RAiDER
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
mamba activate RAiDER

python -m pip install --no-deps .

Expand All @@ -50,31 +55,34 @@ jobs:

- run:
name: Setup data stores
shell: /bin/bash -l
shell: /bin/bash -xl
command: |
eval "$(${HOME}/bin/micromamba shell hook -s posix)"
micromamba activate RAiDER
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
mamba activate RAiDER

python -c 'from RAiDER.models.credentials import setup_from_env; setup_from_env()'

- run:
name: Run unit tests
shell: /bin/bash -l
shell: /bin/bash -xl
command: |
eval "$(${HOME}/bin/micromamba shell hook -s posix)"
micromamba activate RAiDER
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
mamba activate RAiDER

COV_OPTIONS=`python -c "import importlib;print(*(' --cov='+p for p in importlib.util.find_spec('RAiDER').submodule_search_locations))"`
pytest -m "not long" test/ ${COV_OPTIONS} --cov-report=

- run:
name: Report coverage
shell: /bin/bash -l
shell: /bin/bash -xl
command: |
PYTHON_VERSION="<< parameters.python-version >>"
if [ "${PYTHON_VERSION}" == "3.12" ]; then
eval "$(${HOME}/bin/micromamba shell hook -s posix)"
micromamba activate RAiDER
source "${HOME}/conda/etc/profile.d/conda.sh"
source "${HOME}/conda/etc/profile.d/mamba.sh"
mamba activate RAiDER

python -m pip install coveralls
python .circleci/fix_coverage_paths.py .coverage ${PWD}/tools/RAiDER/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ on:

jobs:
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.17.1
with:
python_version: '3.10'

call-docker-ghcr-workflow:
needs: call-version-info-workflow
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.17.1
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,4 +13,4 @@ on:

jobs:
call-changelog-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.17.1
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.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.17.1
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.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.17.1
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.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.17.1
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,9 +6,24 @@ 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.5.4]
### Changed
* [701](https://github.com/dbekaert/RAiDER/pull/701) - Fixed a few path typos and handle some edge cases, add unit tests, lint project
* [672](https://github.com/dbekaert/RAiDER/pull/672) - Linted the project with `ruff`.
* [683](https://github.com/dbekaert/RAiDER/pull/683) - Fixed a naive datetime and added default template to template generation argument
* `prepFromGunw.check_weather_model_availability` now returns `False` for HRRR when outside the CONUS or AK coverage areas, rather than raising `ValueError`.
As a result, HRRR jobs run via HyP3 for GUNWs outside HRRR coverage will exit successfully without making any changes to the GUNW.

### Fixed
* [700](https://github.com/dbekaert/RAiDER/pull/700) - Fixed a few path typos and handle some edge cases
* [679](https://github.com/dbekaert/RAiDER/pull/679) - Fixed a bug causing test_updateTrue to falsely pass.
* [685](https://github.com/dbekaert/RAiDER/pull/679) - Fixed a global bbox bug in checkContainment
* Pinned to `herbie-data<2025.2.1` to address failing HRRR AK tests introduced with the 2025.2.1 release on 2025-02-18.

## [0.5.3]
### Fixed
* Updates dem-stitcher to 2.5.8 to ensure new (ARIA-managed) url for reading the Geoid EGM 2008. See this [issue](https://github.com/ACCESS-Cloud-Based-InSAR/dem-stitcher/issues/96).
* [674](https://github.com/dbekaert/RAiDER/pull/674#issue-2412467565) - Update tests to get rid of extra files created when running tests.

## [0.5.2]
### Changed
Expand Down
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ git commit -a -m "Put here the synthetic commit message"
git push my_user_name my_new_feature_branch
```

### Formatting and linting with [Ruff](https://docs.astral.sh/ruff/) ###

Format your code to follow the style of the project with:
```
ruff format
```
and check for linting problems with:
```
ruff check
```
Please ensure that any linting problems in your changes are resolved before
submitting a pull request.
> [!TIP]
> vscode users can [install the ruff extension](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff) to run the linter automatically in the
editor.

### Issue a pull request from GitHub UI ###
commit locally and push. To get a reasonable history, you may need to

Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ dependencies:
- h5netcdf
- h5py
- hyp3lib>=3,<4
- herbie-data
- herbie-data<2025.2.1
- isce3>=0.15.0
- jsonschema==3.2.0 # this is for ASF DAAC ingest schema validation
- lxml
- matplotlib
- netcdf4
- numpy
- numpy<2
- pandas
- progressbar
- pydap>3.2.2
Expand Down
25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,28 @@ multi_line_output = 5
default_section = "THIRDPARTY"

[tool.setuptools_scm]

[tool.ruff]
line-length = 120
src = ["tools", "test"]

[tool.ruff.format]
indent-style = "space"
quote-style = "single"

[tool.ruff.lint]
extend-select = [
"I", # isort: https://docs.astral.sh/ruff/rules/#isort-i
"UP", # pyupgrade: https://docs.astral.sh/ruff/rules/#pyupgrade-up
"D", # pydocstyle: https://docs.astral.sh/ruff/rules/#pydocstyle-d
"ANN", # annotations: https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"PTH", # use-pathlib-pth: https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
]
ignore = ["ANN101", "D200", "D205", "D212"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.lint.isort]
case-sensitive = true
lines-after-imports = 2
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# RESERVED. United States Government Sponsorship acknowledged.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import re
from pathlib import Path

import numpy as np
Expand Down
34 changes: 0 additions & 34 deletions test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import os
import pytest
import subprocess
import shutil
import string
import random
from contextlib import contextmanager
Expand Down Expand Up @@ -31,37 +28,6 @@ def pushd(dir):
os.chdir(prevdir)


def update_yaml(dct_cfg:dict, dst:str='temp.yaml'):
""" Write a new yaml file from a dictionary.

Updates parameters in the default 'template.yaml' file.
Each key:value pair will in 'dct_cfg' will overwrite that in the default
"""
import RAiDER, yaml

run_config_path = os.path.join(
os.path.dirname(RAiDER.__file__),
'cli',
'examples',
'template',
'template.yaml'
)

with open(run_config_path, 'r') as f:
try:
params = yaml.safe_load(f)
except yaml.YAMLError as exc:
print(exc)
raise ValueError(f'Something is wrong with the yaml file {run_config_path}')

params = {**params, **dct_cfg}

with open(dst, 'w') as fh:
yaml.safe_dump(params, fh, default_flow_style=False)

return dst


def makeLatLonGrid(bbox, reg, out_dir, spacing=0.1):
""" Make lat lons at a specified spacing """
S, N, W, E = bbox
Expand Down
4 changes: 2 additions & 2 deletions test/_scenario_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from RAiDER.delay import main
from RAiDER.utilFcns import rio_open
from RAiDER.checkArgs import makeDelayFileNames
from RAiDER.cli.validators import modelName2Module
from RAiDER.cli.validators import get_wm_by_name

SCENARIO_DIR = os.path.join(TEST_DIR, "scenario_1")
_RTOL = 1e-2
Expand Down Expand Up @@ -93,7 +93,7 @@ def core_test_tropo_delay(tmp_path, modelName):
if not os.path.exists(wmLoc):
os.mkdir(wmLoc)

_, model_obj = modelName2Module(modelName)
_, model_obj = get_wm_by_name(modelName)
wet_file, hydro_file = makeDelayFileNames(
time, Zenith, "envi", modelName, tmp_path
)
Expand Down
4 changes: 2 additions & 2 deletions test/_scenario_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from RAiDER.delay import main
from RAiDER.losreader import Zenith
from RAiDER.cli.validators import modelName2Module
from RAiDER.cli.validators import get_wm_by_name

SCENARIO_DIR = os.path.join(TEST_DIR, "scenario_2")
_RTOL = 1e-2
Expand All @@ -34,7 +34,7 @@ def test_computeDelay(tmp_path):
lats = stats['Lat'].values
lons = stats['Lon'].values

_, model_obj = modelName2Module('ERA5')
_, model_obj = get_wm_by_name('ERA5')

with pushd(tmp_path):

Expand Down
2 changes: 2 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def factory(location: str = 'california-t71') -> Path:
file_name = 'S1-GUNW-D-R-071-tops-20200130_20200124-135156-34956N_32979N-PP-913f-v2_0_4.nc'
elif location == 'alaska':
file_name = 'S1-GUNW-D-R-059-tops-20230320_20220418-180300-00179W_00051N-PP-c92e-v2_0_6.nc'
elif location == 'philippines':
file_name = 'S1-GUNW-D-R-032-tops-20200220_20200214-214625-00120E_00014N-PP-b785-v3_0_1.nc'
else:
raise NotImplementedError
return TEST_DIR / 'gunw_test_data' / file_name
Expand Down
10 changes: 5 additions & 5 deletions test/credentials/test_envVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@ def test_envVars(
rc_path = rc_path.expanduser()
rc_path.unlink(missing_ok=True)

# Give the rc file mock contents
rc_path.write_text(template.format(uid=random_string(), key=random_string()))

test_uid = random_string()
test_key = random_string()

with monkeypatch.context() as mp:
mp.setenv(env_var_name_uid, test_uid)
mp.setenv(env_var_name_key, test_key)
credentials.check_api(model_name, None, None, './', update_rc_file=False)
credentials.check_api(model_name, None, None, './', update_rc_file=True)

expected_content = template.format(uid=test_uid, key=test_key)
actual_content = rc_path.read_text()
rc_path.unlink()

assert (
expected_content == actual_content,
f'{rc_path} was not updated correctly'
)
assert expected_content == actual_content, f'{rc_path} was not created correctly'
11 changes: 6 additions & 5 deletions test/credentials/test_updateTrue.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,16 @@ def test_updateTrue(model_name, template):
return
rc_path = Path('./') / (hidden_ext + rc_filename)

# Give the rc file mock contents
rc_path.write_text(template.format(uid=random_string(), key=random_string()))

# Use check_api to update the rc file
test_uid = random_string()
test_key = random_string()
credentials.check_api(model_name, test_uid, test_key, './', update_rc_file=True)

# Check that the rc file was properly updated
expected_content = template.format(uid=test_uid, key=test_key)
actual_content = rc_path.read_text()
rc_path.unlink()

assert (
expected_content == actual_content,
f'{rc_path} was not updated correctly'
)
assert expected_content == actual_content, f'{rc_path} was not updated correctly'
Binary file not shown.
4 changes: 0 additions & 4 deletions test/scenario_1/raider_example_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@
height_group:
height_levels: 0 50 100 500 1000 # Return only these specific height levels
los_group: # absent other options ZTD is calculated
runtime_group:
output_directory: test/scenario_1


Binary file not shown.
Loading