Skip to content

Commit

Permalink
Hotfix: Update test_forecast.py (#105)
Browse files Browse the repository at this point in the history
* Update test_forecast.py

hotfix: change hardcoded test date since for icon there are no data and this results in a mix of None type and floats, since gfs still give data for vis and the tests fail.

* chnage datetime selection in testfile to a relative formate of -2 days

* change relative test timestamp to now - 2 weeks, it could be more stable then -2days

---------

Co-authored-by: Jakob Elias Gebler <[email protected]>
  • Loading branch information
Hapyr and Jakob Elias Gebler authored Apr 15, 2024
1 parent ce68f31 commit a94bd1a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_forecast.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
from quartz_solar_forecast.forecast import run_forecast
from quartz_solar_forecast.pydantic_models import PVSite

from datetime import datetime, timedelta

def test_run_forecast():
# make input data
site = PVSite(latitude=51.75, longitude=-1.25, capacity_kwp=1.25)

ts = datetime.today() - timedelta(weeks=2)

# run model with icon and gfs nwp
predications_df_gfs = run_forecast(site=site, ts='2023-10-30', nwp_source="gfs")
predications_df_icon = run_forecast(site=site, ts='2023-10-30', nwp_source="icon")
predications_df_gfs = run_forecast(site=site, ts=ts, nwp_source="gfs")
predications_df_icon = run_forecast(site=site, ts=ts, nwp_source="icon")

print("\nPrediction based on GFS NWP\n")
print(predications_df_gfs)
Expand Down

0 comments on commit a94bd1a

Please sign in to comment.