Skip to content

Commit

Permalink
fixed a few typos
Browse files Browse the repository at this point in the history
  • Loading branch information
royagrace committed Feb 2, 2025
1 parent c129d77 commit e1b272b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[Unreleased]
### Changed
* Added unit tests for utilFncs.py
* [701](https://github.com/dbekaert/RAiDER/pull/701) - Fixed a few path typos and handle some edge cases
* [697](https://github.com/dbekaert/RAiDER/pull/697) - Added unit tests for utilFncs.py
* [686](https://github.com/dbekaert/RAiDER/pull/686) - Linted the project with `ruff`.
* [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
Expand Down
2 changes: 1 addition & 1 deletion test/test_intersect.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_gnss_intersect(tmp_path, wm):
## run raider and intersect
calcDelays([str(cfg)])

gold = {"ERA5": 2.34514, "GMAO": np.nan, "HRRR": np.nan}
gold = {"ERA5": 2.34514, "GMAO": 2.34514, "HRRR": np.nan} # gmao is fake
df = pd.read_csv(
os.path.join(outdir, f'{wm}_Delay_{date}T{time.replace(":", "")}_ztd.csv')
)
Expand Down
6 changes: 2 additions & 4 deletions test/test_synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from RAiDER.losreader import Raytracing, build_ray
from RAiDER.models.weatherModel import make_weather_model_filename
from RAiDER.utilFcns import lla2ecef, write_yaml
from test import ORB_DIR, WM_DIR, pushd
from test import ORB_DIR, TEST_DIR, WM_DIR, pushd


def update_model(wm_file: str, wm_eq_type: str, wm_dir: str = "weather_files_synth"):
Expand Down Expand Up @@ -232,7 +232,7 @@ def test_hydrostatic_eq(tmp_path, region, mod="ERA-5"):
significantly different = 6 decimal places
"""
## setup the config files
SAobj = StudyArea(region, mod, WM_DIR)
SAobj = StudyArea(region, mod, TEST_DIR)
dct_cfg = SAobj.make_config_dict()
dct_cfg["runtime_group"]["weather_model_directory"] = SAobj.wm_dir_synth
dct_cfg["download_only"] = False
Expand All @@ -251,8 +251,6 @@ def test_hydrostatic_eq(tmp_path, region, mod="ERA-5"):
da = ds["hydro"]
ds.close()
del ds
out_name.unlink()
'temp.yaml'.unlink()

# now build the rays at the unbuffered wm nodes
max_tropo_height = SAobj.wmObj._zlevels[-1] - 1
Expand Down
4 changes: 4 additions & 0 deletions tools/RAiDER/cli/raider.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ def calcDelays(iargs: Optional[Sequence[str]]=None) -> list[Path]:
if dl_only:
continue

if len(wfiles) == 0:
logger.error('No weather model data was successfully processed.')
raise NoWeatherModelData()

# Get the weather model file
weather_model_file = getWeatherFile(wfiles, times, t, model._Name, interp_method)
if weather_model_file is None:
Expand Down
2 changes: 1 addition & 1 deletion tools/RAiDER/delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# RESERVED. United States Government Sponsorship acknowledged.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""RAiDER tropospheric delay calculation
"""RAiDER tropospheric delay calculation.
This module provides the main RAiDER functionality for calculating
tropospheric wet and hydrostatic delays from a weather model. Weather
Expand Down
2 changes: 1 addition & 1 deletion tools/RAiDER/models/gmao.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _fetch(self, out) -> None:
lon_min_ind = int((self._ll_bounds[2] - (-180.0)) / self._lon_res)
lon_max_ind = int((self._ll_bounds[3] - (-180.0)) / self._lon_res)

T0 = dt.datetime(2017, 12, 1, 0, 0, 0)
T0 = dt.datetime(2017, 12, 1, 0, 0, 0).replace(tzinfo=dt.timezone(offset=dt.timedelta()))
# round time to nearest third hour
corrected_DT = round_date(acqTime, dt.timedelta(hours=self._time_res))
if not corrected_DT == acqTime:
Expand Down
5 changes: 3 additions & 2 deletions tools/RAiDER/models/weatherModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def set_wmLoc(self, weather_model_directory: str) -> None:
"""Set the path to the directory with the weather model files."""
self._wmLoc = weather_model_directory


def load(self, *args: tuple, _zlevels: Union[np.ndarray, list]=None, **kwargs: dict) -> None:
"""
Calls the load_weather method. Each model class should define a load_weather
Expand All @@ -240,7 +241,7 @@ def load(self, *args: tuple, _zlevels: Union[np.ndarray, list]=None, **kwargs: d
path_wm_raw = make_raw_weather_data_filename(outLoc, self.Model(), self.getTime())
self._out_name = self.out_file(outLoc)

if Path.exists(self._out_name):
if Path.exists(Path(self._out_name)):
return self._out_name
else:
# Load the weather just for the query points
Expand Down Expand Up @@ -430,7 +431,7 @@ def bbox(self) -> Union[list, tuple, np.ndarray]:
"""
if self._bbox is None:
path_weather_model = self.out_file(self.get_wmLoc())
if not Path.exists(path_weather_model):
if not Path.exists(Path(path_weather_model)):
raise ValueError('Need to save cropped weather model as netcdf')

with xr.load_dataset(path_weather_model) as ds:
Expand Down

0 comments on commit e1b272b

Please sign in to comment.