diff --git a/src/gsp.py b/src/gsp.py index aa0bf70..28c7bce 100644 --- a/src/gsp.py +++ b/src/gsp.py @@ -8,7 +8,7 @@ from fastapi import APIRouter, Depends, Request, Security, status from fastapi.responses import Response from fastapi_auth0 import Auth0User -from nowcasting_datamodel.fake import make_fake_forecast, make_fake_forecasts +from nowcasting_datamodel.fake import make_fake_forecast, make_fake_forecasts, make_fake_gsp_yields from nowcasting_datamodel.models import Forecast, ForecastValue, ManyForecasts from sqlalchemy.orm.session import Session @@ -277,9 +277,9 @@ def get_truths_for_all_gsps( if is_fake: if gsp_ids is None: - gsp_ids = [int(gsp_id) for gsp_id in range(1, GSP_TOTAL)] + gsp_ids = [List[int(gsp_id)] for gsp_id in range(1, GSP_TOTAL)] - make_fake_forecasts(gsp_ids=gsp_ids, session=session) + make_fake_gsp_yields(gsp_ids=gsp_ids, session=session) logger.info(f"Get PV Live estimates values for all gsp id and regime {regime} for user {user}") @@ -315,7 +315,7 @@ def get_truths_for_a_specific_gsp_old_route( """Redirects old API route to new route /v0/solar/GB/gsp/{gsp_id}/pvlive""" if is_fake: - make_fake_forecast(gsp_id=gsp_id, session=session) + make_fake_gsp_yields(gsp_ids=List[gsp_id], session=session) return get_truths_for_a_specific_gsp( request=request, diff --git a/src/national.py b/src/national.py index 76a4d38..4331f77 100644 --- a/src/national.py +++ b/src/national.py @@ -10,7 +10,7 @@ from elexonpy.api_client import ApiClient from fastapi import APIRouter, Depends, HTTPException, Query, Request, Security from fastapi_auth0 import Auth0User -from nowcasting_datamodel.fake import make_fake_forecast +from nowcasting_datamodel.fake import make_fake_forecast, make_fake_gsp_yields from nowcasting_datamodel.read.read import get_latest_forecast_for_gsps from sqlalchemy.orm.session import Session @@ -215,7 +215,7 @@ def get_national_pvlive( logger.info(f"Get national PV Live estimates values " f"for regime {regime} for {user}") if is_fake: - make_fake_forecast(gsp_id=gsp_id, session=session) + make_fake_gsp_yields(gsp_ids=List[gsp_id], session=session) return get_truth_values_for_a_specific_gsp_from_database( session=session, gsp_id=gsp_id, regime=regime