-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #672 from garlic-os/linting
Linting RAiDER codebase
- Loading branch information
Showing
82 changed files
with
5,970 additions
and
4,759 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+789 KB
test/synthetic_test/weather_files_synth/ERA-5_2019_11_17_T20_51_58_5S_2S_41W_37W.nc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,21 @@ | ||
import os | ||
import subprocess | ||
import shutil | ||
import glob | ||
|
||
from test import TEST_DIR, WM, update_yaml, pushd | ||
from test import TEST_DIR, pushd | ||
|
||
import numpy as np | ||
import xarray as xr | ||
from RAiDER.cli.raider import calcDelays | ||
|
||
|
||
def test_scenario_1(tmp_path, data_for_hrrr_ztd, mocker): | ||
SCENARIO_DIR = TEST_DIR / "scenario_1" | ||
test_path = SCENARIO_DIR / 'raider_example_1.yaml' | ||
mocker.patch('RAiDER.processWM.prepareWeatherModel', | ||
side_effect=[str(data_for_hrrr_ztd)]) | ||
|
||
with pushd(tmp_path): | ||
dct_group = { | ||
"aoi_group": {"bounding_box": [36, 37, -92, -91]}, | ||
"date_group": {"date_start": "20200101"}, | ||
"time_group": {"time": "12:00:00", "interpolate_time": "none"}, | ||
"weather_model": "HRRR", | ||
"height_group": {"height_levels": [0, 50, 100, 500, 1000]}, | ||
"look_dir": "right", | ||
"runtime_group": {"output_directory": "test/scenario_1"}, | ||
} | ||
|
||
cfg = update_yaml(dct_group, os.path.join(tmp_path, "temp.yaml")) | ||
|
||
SCENARIO_DIR = os.path.join(tmp_path, TEST_DIR, "scenario_1") | ||
mocker.patch( | ||
"RAiDER.processWM.prepareWeatherModel", side_effect=[str(data_for_hrrr_ztd)] | ||
) | ||
calcDelays([os.path.join(tmp_path, "temp.yaml")]) | ||
calcDelays([str(test_path)]) | ||
new_data = xr.load_dataset('HRRR_tropo_20200101T120000_ztd.nc') | ||
|
||
new_data = xr.load_dataset( | ||
os.path.join( | ||
tmp_path, "test", "scenario_1", "HRRR_tropo_20200101T120000_ztd.nc" | ||
) | ||
) | ||
new_data1 = new_data.sel(x=-91.84, y=36.84, z=0, method="nearest") | ||
golden_data = 2.2622863, 0.0361021 # hydro|wet | ||
new_data1 = new_data.sel(x=-91.84, y=36.84, z=0, method='nearest') | ||
golden_data = 2.2622863, 0.0361021 # hydro|wet | ||
|
||
np.testing.assert_almost_equal(golden_data[0], new_data1["hydro"].data) | ||
np.testing.assert_almost_equal(golden_data[1], new_data1["wet"].data) | ||
np.testing.assert_almost_equal(golden_data[0], new_data1["hydro"].data) | ||
np.testing.assert_almost_equal(golden_data[1], new_data1["wet"].data) |
Oops, something went wrong.