Skip to content

Commit

Permalink
Merge pull request #102 from openclimatefix/issue/speed-up-gsp-read
Browse files Browse the repository at this point in the history
Issue/speed up gsp read
  • Loading branch information
peterdudfield authored Jul 30, 2024
2 parents 44621f1 + b77b99c commit 79f561a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pvnet_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ def app(
db_connection = DatabaseConnection(url=os.getenv("DB_URL"), base=Base_Forecast, echo=False)
with db_connection.get_session() as session:
#  Pandas series of most recent GSP capacities
gsp_capacities = get_latest_gsp_capacities(session, gsp_ids)
now_minis_two_days = pd.Timestamp.now(tz="UTC") - timedelta(days=2)
gsp_capacities = get_latest_gsp_capacities(
session=session, gsp_ids=gsp_ids, datetime_utc=now_minis_two_days
)

# National capacity is needed if using summation model
national_capacity = get_latest_gsp_capacities(session, [0])[0]
Expand Down

0 comments on commit 79f561a

Please sign in to comment.