-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from armenbod/feature/issue-43/default-time-to…
…-now-if-none run_forecast sets to current timestamp rounded 15min if optional ts = None
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pandas as pd | ||
from quartz_solar_forecast.forecast import run_forecast | ||
from quartz_solar_forecast.pydantic_models import PVSite | ||
|
||
|
||
def test_run_forecast_no_ts(): | ||
# make input data | ||
site = PVSite(latitude=51.75, longitude=-1.25, capacity_kwp=1.25) | ||
|
||
current_ts = pd.Timestamp.now().round("15min") | ||
|
||
# run model with no ts | ||
predications_df = run_forecast(site=site) | ||
|
||
# check current ts agrees with dataset | ||
assert predications_df.index.min() == current_ts | ||
|
||
print(predications_df) | ||
print(f"Current time: {current_ts}") | ||
print(f"Max: {predications_df['power_wh'].max()}") | ||
|