Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/quartz_api/internal/backends/dataplatform/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

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

Expand All @@ -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:
Expand All @@ -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,
Expand All @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion src/quartz_api/internal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -148,13 +149,15 @@ 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

@abc.abstractmethod
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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down