Skip to content

Commit

Permalink
update comments re N-hour chart aggregations
Browse files Browse the repository at this point in the history
  • Loading branch information
braddf committed Dec 18, 2024
1 parent 7b53ad6 commit b824ff5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ const GspPvRemixChart: FC<{
gspForecastDataOneGSP,
gspNHourData
} = useGetGspData(gspId);
// TODO – temp reset; if aggregation is zones, make sure data is all set
if ([NationalAggregation.DNO, NationalAggregation.zone].includes(nationalAggregationLevel)) {
gspNHourData = [];
}
// const gspData = fcAll?.forecasts.find((fc) => fc.location.gspId === gspId);
const gspInstalledCapacity = gspLocationInfo?.[0]?.installedCapacityMw;
const gspName = gspLocationInfo?.[0]?.regionName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,16 @@ const useGetGspData = (gspId: number | string) => {
];
}

// TODO: nHour with aggregation
// TODO: nHour with aggregation when /forecast/all API endpoint has new forecast_horizon_minutes param
const nMinuteForecast = nHourForecast * 60;
const { data: gspNHourData, error: pvNHourError } = useLoadDataFromApi<ForecastData>(
show4hView
const { data: gspNHourDataRaw, error: pvNHourError } = useLoadDataFromApi<
components["schemas"]["ForecastValue"][]
>(
show4hView && !isZoneAggregation
? `${API_PREFIX}/solar/GB/gsp/${gspId}/forecast?forecast_horizon_minutes=${nMinuteForecast}&historic=true&only_forecast_values=true`
: null
);
let gspNHourData = gspNHourDataRaw || [];

return {
errors: [
Expand All @@ -144,7 +147,7 @@ const useGetGspData = (gspId: number | string) => {
gspLocationError,
pvNHourError
].filter((e) => !!e),
gspNHourData: gspNHourData,
gspNHourData,
pvRealDataIn,
pvRealDataAfter,
gspForecastDataOneGSP,
Expand Down

0 comments on commit b824ff5

Please sign in to comment.