From ec7c15d770563397e3e1db8c6a000d20989f1a56 Mon Sep 17 00:00:00 2001 From: Peter Dudfield Date: Thu, 4 Dec 2025 17:09:23 +0000 Subject: [PATCH] add model name and observer name --- src/quartz_api/internal/backends/dataplatform/client.py | 9 ++++++++- src/quartz_api/internal/models.py | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/quartz_api/internal/backends/dataplatform/client.py b/src/quartz_api/internal/backends/dataplatform/client.py index d4108ba..2e95868 100644 --- a/src/quartz_api/internal/backends/dataplatform/client.py +++ b/src/quartz_api/internal/backends/dataplatform/client.py @@ -32,6 +32,7 @@ async def get_predicted_solar_power_production_for_location( forecast_horizon: ForecastHorizon = ForecastHorizon.latest, forecast_horizon_minutes: int | None = None, smooth_flag: bool = True, + model_name: str | None = None, ) -> list[internal.PredictedPower]: values = await self._get_predicted_power_production_for_location( location=location, @@ -65,11 +66,13 @@ async def get_predicted_wind_power_production_for_location( async def get_actual_solar_power_production_for_location( self, location: str, + observer_name: str | None = None, ) -> list[internal.ActualPower]: values = await self._get_actual_power_production_for_location( location, dp.EnergySource.SOLAR, oauth_id=None, + observer_name=observer_name, ) return values @@ -155,11 +158,13 @@ async def get_site_generation( self, site_uuid: str, authdata: dict[str, str], + observer_name: str | None = None, ) -> list[internal.ActualPower]: generation = await self._get_actual_power_production_for_location( site_uuid, dp.EnergySource.SOLAR, authdata["sub"], + observer_name=observer_name, ) return generation @@ -182,6 +187,7 @@ async def _get_actual_power_production_for_location( location: str, energy_source: dp.EnergySource, oauth_id: str | None, + observer_name: str | None = "ruvnl", ) -> list[internal.ActualPower]: """Local function to retrieve actual values regardless of energy type.""" if oauth_id is not None: @@ -195,7 +201,7 @@ async def _get_actual_power_production_for_location( start, end = get_window() req = dp.GetObservationsAsTimeseriesRequest( location_uuid=location, - observer_name="ruvnl", + observer_name=observer_name, energy_source=energy_source, time_window=dp.TimeWindow( start_timestamp_utc=start, @@ -221,6 +227,7 @@ async def _get_predicted_power_production_for_location( forecast_horizon: ForecastHorizon = ForecastHorizon.latest, forecast_horizon_minutes: int | None = None, smooth_flag: bool = True, # noqa: ARG002 + model_name: str | None = None, # noqa: ARG002 ) -> list[internal.PredictedPower]: """Local function to retrieve predicted values regardless of energy type.""" if oauth_id is not None: diff --git a/src/quartz_api/internal/models.py b/src/quartz_api/internal/models.py index d2f87f0..d792946 100644 --- a/src/quartz_api/internal/models.py +++ b/src/quartz_api/internal/models.py @@ -140,6 +140,7 @@ async def get_predicted_solar_power_production_for_location( forecast_horizon: ForecastHorizon = ForecastHorizon.latest, forecast_horizon_minutes: int | None = None, smooth_flag: bool = True, + model_name: str | None = None, ) -> list[PredictedPower]: """Returns a list of predicted solar power production for a given location. @@ -148,6 +149,7 @@ async def get_predicted_solar_power_production_for_location( forecast_horizon: The forecast horizon to use. forecast_horizon_minutes: The forecast horizon in minutes to use. smooth_flag: Whether to smooth the forecast data. + model_name: The name of the model to use. """ pass @@ -155,6 +157,7 @@ async def get_predicted_solar_power_production_for_location( async def get_actual_solar_power_production_for_location( self, location: str, + observer_name: str | None = None, ) -> list[ActualPower]: """Returns a list of actual solar power production for a given location.""" pass @@ -174,6 +177,7 @@ async def get_predicted_wind_power_production_for_location( async def get_actual_wind_power_production_for_location( self, location: str, + observer_name: str | None = None, ) -> list[ActualPower]: """Returns a list of actual wind power production for a given location.""" pass @@ -219,7 +223,7 @@ async def get_site_forecast( @abc.abstractmethod async def get_site_generation( - self, site_uuid: str, authdata: dict[str, str], + self, site_uuid: str, authdata: dict[str, str], observer_name: str | None = None, ) -> list[ActualPower]: """Get the generation for a site.""" pass