Skip to content

Commit

Permalink
unify read_area interface
Browse files Browse the repository at this point in the history
  • Loading branch information
OuyangWenyu committed Dec 17, 2023
1 parent 4bce185 commit 0a6c4ee
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions hydrodataset/caravan.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,6 @@ def _read_constant_cols_global(self, var_lst, gage_id_lst, is_return_dict):
data = pd.concat(attr)
return data.to_dict("index") if is_return_dict else data.values

def read_basin_area(self, object_ids) -> np.array:
return self.read_constant_cols(object_ids, ["area_calc"], is_return_dict=False)

def read_mean_prep(self, object_ids) -> np.array:
return self.read_constant_cols(object_ids, ["p_mean"], is_return_dict=False)

Expand Down
2 changes: 1 addition & 1 deletion hydrodataset/lamah.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def read_constant_cols(
out = temp[:, ind_var]
return (out, var_dict, f_dict) if is_return_dict else out

def read_basin_area(self, object_ids) -> np.array:
def read_area(self, object_ids) -> np.array:
return self.read_constant_cols(object_ids, ["area_calc"], is_return_dict=False)

def read_mean_prep(self, object_ids) -> np.array:
Expand Down
2 changes: 1 addition & 1 deletion hydrodataset/mopex.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def read_constant_cols(
out = temp[:, ind_var]
return (out, var_dict, f_dict) if is_return_dict else out

def read_basin_area(self, object_ids) -> np.array:
def read_area(self, object_ids) -> np.array:
return self.read_constant_cols(
object_ids, ["Drainage_Area_km2"], is_return_dict=False
)
Expand Down
2 changes: 1 addition & 1 deletion hydrodataset/multi_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ def get_other_cols(self) -> dict:
def read_other_cols(self, object_ids=None, other_cols=None, **kwargs):
pass

def read_basin_area(self, object_ids) -> np.array:
def read_area(self, object_ids) -> np.array:
return self.read_constant_cols(object_ids, ["area"], is_return_dict=False)

def read_mean_prep(self, object_ids) -> np.array:
Expand Down

0 comments on commit 0a6c4ee

Please sign in to comment.