ArcticSnow / TopoPyScale

TopoPyScale: a Python library to perform simplistic climate downscaling at the hillslope scale
https://topopyscale.readthedocs.io
MIT License
39 stars 9 forks source link

pd.date_range deprecated arg "closed" #73

Closed joelfiddes closed 1 year ago

joelfiddes commented 1 year ago

Argument closed is deprecated in Version 1.4.1

affects at least:

File "/home/joel/src/TopoPyScale/TopoPyScale/solar_geom.py", line 43, in get_solar_geom times = pd.date_range(start_date, pd.to_datetime(end_date)+pd.to_timedelta('1D'), freq=tstep, tz='UTC', closed='left') File "/home/joel/anaconda3/envs/downscaling/lib/python3.9/site-packages/pandas/core/indexes/datetimes.py", line 945, in date_range dtarr = DatetimeArray._generate_range( TypeError: _generate_range() got an unexpected keyword argument 'closed'

working on it.....

joelfiddes commented 1 year ago

FutureWarning: Argument closed is deprecated in favor of `inclusive

joelfiddes commented 1 year ago

l43 solar_geom.py change:

times = pd.date_range(start_date, pd.to_datetime(end_date)+pd.to_timedelta('1D'), freq=tstep, tz='UTC', closed='left')

to

times = pd.date_range(start_date, pd.to_datetime(end_date)+pd.to_timedelta('1D'), freq=tstep, tz='UTC', inclusive='left')

2 occurances in this module

joelfiddes commented 1 year ago

also here topo_scale.py", line 141, in downscale_climate

joelfiddes commented 1 year ago

pushed changes

joelfiddes commented 1 year ago

pushed changes