Skip to content

Commit

Permalink
add adjust to gsp for getting specific forecast
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Sep 26, 2023
1 parent c996960 commit 55771b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gsp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Get GSP boundary data from eso """
from typing import List, Optional, Union

import os
import structlog
from fastapi import APIRouter, Depends, Request, Security, status
from fastapi.responses import Response
Expand Down Expand Up @@ -29,6 +30,7 @@


logger = structlog.stdlib.get_logger()
adjust_limit = float(os.getenv("ADJUST_MW_LIMIT", 0.0))


router = APIRouter()
Expand Down Expand Up @@ -183,6 +185,11 @@ def get_forecasts_for_a_specific_gsp(
creation_utc_limit=creation_limit_utc,
)

if gsp_id == 0:
forecast_values_for_specific_gsp = [
f.adjust(limit=adjust_limit) for f in forecast_values_for_specific_gsp
]

logger.debug("Got forecast values for a specific gsp.")

return forecast_values_for_specific_gsp
Expand Down

0 comments on commit 55771b7

Please sign in to comment.