Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
veenstrajelmer committed Oct 17, 2023
1 parent 28fdd83 commit a45de86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dfm_tools/hydrolib_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ def ForcingModel_to_plipointsDataset(forcingmodel:hcdfm.ForcingModel, npoints=No
ds = xr.concat(plipointsDataset_list, dim=dimn_point)

# prevent circular import #TODO: solve underlaying issue
from dfm_tools.interpolate_grid2bnd import maybe_convert_fews_to_dfmt
ds = maybe_convert_fews_to_dfmt(ds)
from dfm_tools.interpolate_grid2bnd import _maybe_convert_fews_to_dfmt
ds = _maybe_convert_fews_to_dfmt(ds)

return ds

Expand Down
6 changes: 3 additions & 3 deletions dfm_tools/interpolate_grid2bnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def interp_regularnc_to_plipoints(data_xr_reg, file_pli, nPoints=None, load=True
#load boundary file
polyfile_object = hcdfm.PolyFile(file_pli)

#check if polyobj names in plifile are unique
#check if polyobj names in plifile are unique #TODO: check this everywhere
polynames_pd = pd.Series([polyobj.metadata.name for polyobj in polyfile_object.objects])
if polynames_pd.duplicated().any():
raise ValueError(f'Duplicate polyobject names in polyfile {file_pli}, this is not allowed:\n{polynames_pd}')
Expand Down Expand Up @@ -519,7 +519,7 @@ def interp_hisnc_to_plipoints(data_xr_his, file_pli, kdtree_k=3, load=True):
return data_interp


def maybe_convert_fews_to_dfmt(ds):
def _maybe_convert_fews_to_dfmt(ds):
ncbnd_construct = get_ncbnd_construct()
dimn_point = ncbnd_construct['dimn_point']
varn_pointname = ncbnd_construct['varn_pointname']
Expand Down Expand Up @@ -571,7 +571,7 @@ def plipointsDataset_to_ForcingModel(plipointsDataset):
dimn_depth = ncbnd_construct['dimn_depth']
varn_pointname = ncbnd_construct['varn_pointname']

plipointsDataset = maybe_convert_fews_to_dfmt(plipointsDataset)
plipointsDataset = _maybe_convert_fews_to_dfmt(plipointsDataset)

quantity_list = list(plipointsDataset.data_vars)
npoints = len(plipointsDataset[dimn_point])
Expand Down

0 comments on commit a45de86

Please sign in to comment.