File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -7,22 +7,21 @@ def test_run_forecast_no_ts():
7
7
# make input data
8
8
site = PVSite (latitude = 51.75 , longitude = - 1.25 , capacity_kwp = 1.25 )
9
9
10
- current_ts = pd .Timestamp .now ().round ("15min" )
11
- current_hr = pd .Timestamp .now ().round (freq = 'h' )
10
+ current_ts = pd .Timestamp .now ()
12
11
13
12
# 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" )
15
14
# 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 )
17
16
18
17
print (predications_df )
19
18
print (f"Current time: { current_ts } " )
20
19
print (f"Max: { predications_df ['power_kw' ].max ()} " )
21
20
22
21
# 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" )
24
23
# 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 )
26
25
27
26
print (predications_df )
28
27
print (f"Current time: { current_ts } " )
You can’t perform that action at this time.
0 commit comments