Skip to content

Commit df662f3

Browse files
committed
update forecast test with no ts
1 parent 8ea97ba commit df662f3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/unit/test_forecast_no_ts.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,21 @@ def test_run_forecast_no_ts():
77
# make input data
88
site = PVSite(latitude=51.75, longitude=-1.25, capacity_kwp=1.25)
99

10-
current_ts = pd.Timestamp.now().round("15min")
11-
current_hr = pd.Timestamp.now().round(freq='h')
10+
current_ts = pd.Timestamp.now()
1211

1312
# run gradient boosting model with no ts
14-
predications_df = run_forecast(site=site, model="gb", ts=current_ts)
13+
predications_df = run_forecast(site=site, model="gb")
1514
# check current ts agrees with dataset
16-
assert predications_df.index.min() == current_ts
15+
assert predications_df.index.min() >= current_ts - pd.Timedelta(hours=1)
1716

1817
print(predications_df)
1918
print(f"Current time: {current_ts}")
2019
print(f"Max: {predications_df['power_kw'].max()}")
2120

2221
# run xgb model with no ts
23-
predications_df = run_forecast(site=site, model="xgb", ts=current_ts)
22+
predications_df = run_forecast(site=site, model="xgb")
2423
# check current ts agrees with dataset
25-
assert predications_df.index.min() == current_hr
24+
assert predications_df.index.min() >= current_ts - pd.Timedelta(hours=1)
2625

2726
print(predications_df)
2827
print(f"Current time: {current_ts}")

0 commit comments

Comments
 (0)