diff --git a/quartz_solar_forecast/forecast.py b/quartz_solar_forecast/forecast.py index 9e32c0e7..5a6e1fd6 100644 --- a/quartz_solar_forecast/forecast.py +++ b/quartz_solar_forecast/forecast.py @@ -25,8 +25,8 @@ def run_forecast(site: PVSite, ts: datetime | str = None, nwp_source: str = "ico if isinstance(ts, str): ts = datetime.fromisoformat(ts) - # make pv and nwp data from GFS - nwp_xr = get_nwp(site=site, ts=ts) + # make pv and nwp data from nwp_source + nwp_xr = get_nwp(site=site, ts=ts, nwp_source=nwp_source) pv_xr = make_pv_data(site=site, ts=ts) # load and run models diff --git a/tests/test_forecast.py b/tests/test_forecast.py index 4d0d1e06..1316c284 100644 --- a/tests/test_forecast.py +++ b/tests/test_forecast.py @@ -6,9 +6,14 @@ def test_run_forecast(): # make input data site = PVSite(latitude=51.75, longitude=-1.25, capacity_kwp=1.25) - # run model - predications_df = run_forecast(site=site, ts='2023-10-30') + # 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") - print(predications_df) - print(f"Max: {predications_df['power_wh'].max()}") + print("\nPrediction based on GFS NWP\n") + print(predications_df_gfs) + print(f"Max: {predications_df_gfs['power_wh'].max()}") + print("\nPrediction based on ICON NWP\n") + print(predications_df_icon) + print(f"Max: {predications_df_icon['power_wh'].max()}")