Skip to content

Commit 27b125a

Browse files
committed
address pandas4 deprecation warnings
1 parent add5b06 commit 27b125a

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

pvlib/iotools/bsrn.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def _parse_bsrn(fbuf, logical_records=('0100',)):
322322
LR_0100 = LR_0100.reindex(sorted(LR_0100.columns), axis='columns')
323323
LR_0100.columns = BSRN_LR0100_COLUMNS
324324
# Set datetime index
325-
LR_0100.index = (start_date+pd.to_timedelta(LR_0100['day']-1, unit='d')
325+
LR_0100.index = (start_date+pd.to_timedelta(LR_0100['day']-1, unit='D')
326326
+ pd.to_timedelta(LR_0100['minute'], unit='minutes'))
327327
# Drop empty, minute, and day columns
328328
LR_0100 = LR_0100.drop(columns=['empty', 'day', 'minute'])
@@ -336,7 +336,7 @@ def _parse_bsrn(fbuf, logical_records=('0100',)):
336336
na_values=[-999.0, -99.9],
337337
colspecs=BSRN_LR0300_COL_SPECS,
338338
names=BSRN_LR0300_COLUMNS)
339-
LR_0300.index = (start_date+pd.to_timedelta(LR_0300['day']-1, unit='d')
339+
LR_0300.index = (start_date+pd.to_timedelta(LR_0300['day']-1, unit='D')
340340
+ pd.to_timedelta(LR_0300['minute'], unit='minutes'))
341341
LR_0300 = LR_0300.drop(columns=['day', 'minute']).astype(float)
342342
dfs.append(LR_0300)
@@ -353,13 +353,13 @@ def _parse_bsrn(fbuf, logical_records=('0100',)):
353353
# Sort columns to match original order and assign column names
354354
LR_0500 = LR_0500.reindex(sorted(LR_0500.columns), axis='columns')
355355
LR_0500.columns = BSRN_LR0500_COLUMNS
356-
LR_0500.index = (start_date+pd.to_timedelta(LR_0500['day']-1, unit='d')
356+
LR_0500.index = (start_date+pd.to_timedelta(LR_0500['day']-1, unit='D')
357357
+ pd.to_timedelta(LR_0500['minute'], unit='minutes'))
358358
LR_0500 = LR_0500.drop(columns=['empty', 'day', 'minute'])
359359
dfs.append(LR_0500)
360360

361361
if len(dfs):
362-
data = pd.concat(dfs, axis='columns')
362+
data = pd.concat(dfs, axis='columns', sort=False)
363363
else:
364364
data = _empty_dataframe_from_logical_records(logical_records)
365365
metadata = {}

pvlib/iotools/solrad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def get_solrad(station, start, end,
195195
end = pd.to_datetime(end)
196196

197197
# Generate list of filenames
198-
dates = pd.date_range(start.floor('d'), end, freq='d')
198+
dates = pd.date_range(start.floor('D'), end, freq='D')
199199
station = station.lower()
200200
filenames = [
201201
f"{station}/{d.year}/{station}{d.strftime('%y')}{d.dayofyear:03}.dat"

0 commit comments

Comments
 (0)