Skip to content

Commit

Permalink
fix importer to support DAP links as inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
huard committed Apr 8, 2021
1 parent cb4ec8d commit e7ad17e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ravenpy/models/importers.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,13 +775,13 @@ def _check_gridcell_in_proximity_of_shape(

class NcDataImporter:
def __init__(self, fns):
self.fns = map(Path, fns)
self.fns = fns
self.attrs = {}
self._extract_nc_attrs(self.fns)

def _extract_nc_attrs(self, fns):
for fn in fns:
if ".nc" in fn.suffix:
if ".nc" in Path(fn).suffix:
with xr.open_dataset(fn) as ds:
# Check if any alternate variable name is in the file.
for var, alt_names in rv.alternate_nc_names.items():
Expand Down
5 changes: 1 addition & 4 deletions tests/test_emulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,7 @@ def test_dap(self):
end_date=dt.datetime(2002, 1, 1),
run_name="test",
name="Salmon",
area="4250.6",
elevation="843.0",
latitude=54.4848,
longitude=-123.3659,
hrus=(GR4JCN.LandHRU(**salmon_land_hru_1),),
params=model.params(0.529, -3.396, 407.29, 1.072, 16.9, 0.947),
)

Expand Down

0 comments on commit e7ad17e

Please sign in to comment.