Skip to content

Commit

Permalink
1st experiment with make_fake_gsp_yields()
Browse files Browse the repository at this point in the history
  • Loading branch information
VikramsDataScience committed Dec 11, 2024
1 parent d0ee53c commit 32f456b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/gsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}")

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/national.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 32f456b

Please sign in to comment.