Skip to content

Commit e34e6fa

Browse files
committed
replace resize with shorten
1 parent 6bc1c43 commit e34e6fa

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

PyStemmusScope/save.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ def _select_forcing_variables(forcing_dict: Dict, forcing_var: str, alma_var: st
5656
return data_array
5757

5858

59-
def _resize_data_array(data: xr.DataArray, time_steps: str)-> xr.DataArray:
60-
"""Resize data based on time_steps.
59+
def _shorten_data_array(data: xr.DataArray, time_steps: str)-> xr.DataArray:
60+
"""Shorten data based on time_steps.
6161
6262
Args:
63-
data(xr.DataArray): data to be resized.
64-
time_steps(str): number of time steps to resize.
63+
data(xr.DataArray): data to be shortend.
64+
time_steps(str): number of time steps to shorten.
6565
6666
Returns:
6767
xr.DataArray: subset of data with the lenght of time equal to time_steps.
@@ -286,7 +286,7 @@ def to_netcdf(config: Dict, cf_filename: str) -> str:
286286
)
287287

288288
# get time info
289-
time = _resize_data_array(forcing_dict["time"], time_steps)
289+
time = _shorten_data_array(forcing_dict["time"], time_steps)
290290

291291
# read convention file
292292
conventions = pd.read_csv(cf_filename)
@@ -300,7 +300,7 @@ def to_netcdf(config: Dict, cf_filename: str) -> str:
300300
if alma_name in var_names:
301301
# select data
302302
data_array = _select_forcing_variables(forcing_dict, var_names[alma_name], alma_name)
303-
data_array = _resize_data_array(data_array, time_steps)
303+
data_array = _shorten_data_array(data_array, time_steps)
304304

305305
# create data array
306306
elif alma_name in {"SoilTemp", "SoilMoist"}:

0 commit comments

Comments
 (0)