From 2048d27f863adc7fbdf65b67403905f51a1c044d Mon Sep 17 00:00:00 2001 From: braddf Date: Wed, 18 Dec 2024 16:36:45 +0000 Subject: [PATCH] remove comments and unneeded code from PR --- .../gsp-pv-remix-chart/use-get-gsp-data.ts | 5 --- .../components/charts/pv-remix-chart.tsx | 1 - .../nowcasting-app/components/helpers/data.ts | 1 - .../components/map/pvLatestMap.tsx | 34 +------------------ 4 files changed, 1 insertion(+), 40 deletions(-) diff --git a/apps/nowcasting-app/components/charts/gsp-pv-remix-chart/use-get-gsp-data.ts b/apps/nowcasting-app/components/charts/gsp-pv-remix-chart/use-get-gsp-data.ts index ce0823fc..7cf34ad3 100644 --- a/apps/nowcasting-app/components/charts/gsp-pv-remix-chart/use-get-gsp-data.ts +++ b/apps/nowcasting-app/components/charts/gsp-pv-remix-chart/use-get-gsp-data.ts @@ -71,11 +71,9 @@ const useGetGspData = (gspId: number | string) => { gspIds = nationalGspZone[gspId as keyof typeof nationalGspZone] || []; } - // TODO add check for gspIds before making the api call const { data: pvRealDataInRaw, error: pvRealInDayError } = useLoadDataFromApi< components["schemas"]["GSPYieldGroupByDatetime"][] >( - // `${API_PREFIX}/solar/GB/gsp/pvlive/${gspId}?regime=in-day` `${API_PREFIX}/solar/GB/gsp/pvlive/all?regime=in-day&gsp_ids=${encodeURIComponent( gspIds.join(",") )}&compact=true` @@ -85,18 +83,15 @@ const useGetGspData = (gspId: number | string) => { const { data: pvRealDataAfterRaw, error: pvRealDayAfterError } = useLoadDataFromApi< components["schemas"]["GSPYieldGroupByDatetime"][] >( - // `${API_PREFIX}/solar/GB/gsp/pvlive/${gspId}?regime=day-after` `${API_PREFIX}/solar/GB/gsp/pvlive/all?regime=day-after&gsp_ids=${encodeURIComponent( gspIds.join(",") )}&compact=true` ); const pvRealDataAfter = aggregateTruthData(pvRealDataAfterRaw, gspIds, "solarGenerationKw"); - //add new useSWR for gspChartData const { data: gspForecastDataOneGSPRaw, error: gspForecastDataOneGSPError } = useLoadDataFromApi< components["schemas"]["OneDatetimeManyForecastValues"][] >( - // `${API_PREFIX}/solar/GB/gsp/${gspId}/forecast`, `${API_PREFIX}/solar/GB/gsp/forecast/all/?gsp_ids=${encodeURIComponent( gspIds.join(",") )}&compact=true&historic=true`, diff --git a/apps/nowcasting-app/components/charts/pv-remix-chart.tsx b/apps/nowcasting-app/components/charts/pv-remix-chart.tsx index 0ed6e751..d8f19783 100644 --- a/apps/nowcasting-app/components/charts/pv-remix-chart.tsx +++ b/apps/nowcasting-app/components/charts/pv-remix-chart.tsx @@ -105,7 +105,6 @@ const PvRemixChart: FC<{ timeOfInterest={selectedTime} setTimeOfInterest={setSelectedTime} data={chartData} - // yMax={allGspSystemData?.[0].installedCapacityMw || MAX_NATIONAL_GENERATION_MW} yMax={MAX_NATIONAL_GENERATION_MW} visibleLines={visibleLines} /> diff --git a/apps/nowcasting-app/components/helpers/data.ts b/apps/nowcasting-app/components/helpers/data.ts index 4f60ca1c..5ee9d9c5 100644 --- a/apps/nowcasting-app/components/helpers/data.ts +++ b/apps/nowcasting-app/components/helpers/data.ts @@ -136,7 +136,6 @@ const mapGspFeatures: ( }); }; -// TODO BRAD: map/aggregate all the GSP data to the zone level const mapZoneFeatures: ( features: Feature[], gspZoneGroupings: GspZoneGroupings, diff --git a/apps/nowcasting-app/components/map/pvLatestMap.tsx b/apps/nowcasting-app/components/map/pvLatestMap.tsx index 58815ad6..e7a5f773 100644 --- a/apps/nowcasting-app/components/map/pvLatestMap.tsx +++ b/apps/nowcasting-app/components/map/pvLatestMap.tsx @@ -137,34 +137,6 @@ const PvLatestMap: React.FC = ({ nationalAggregationLevel ]); - // generatedGeoJsonForecastData.forecastGeoJson.features.forEach((feature) => { - // if (feature.geometry.type === "MultiPolygon") { - // console.log("## MultiPolygon feature", feature); - // turfFeatures.push(turf.multiPolygon(feature.geometry.coordinates)); - // } else { - // console.log("NOT MultiPolygon"); - // } - // }); - // console.log("## turfFeatures", turfFeatures); - // const featColl = turf.featureCollection(turfFeatures); - // console.log("## featColl", featColl); - // const union = featColl.features.slice(1).reduce((acc, feature) => { - // console.log("## acc", acc); - // console.log("## feature", feature); - // return turf.union(turf.featureCollection([turf.truncate(acc), turf.truncate(feature)])); - // }, featColl.features[0]); - - // if (generatedGeoJsonForecastData.forecastGeoJson.features[0].type === "Feature") { - // const union = turf.union( - // turf.featureCollection(generatedGeoJsonForecastData.forecastGeoJson.features) - // ); - // } - - // const aggregatedGeoJsonForecastData = useMemo(() => { - // console.log("## aggregatedGeoJsonForecastData", generatedGeoJsonForecastData); - // return generatedGeoJsonForecastData.forecastGeoJson; - // }, [generatedGeoJsonForecastData.forecastGeoJson]); - // Create a popup, but don't add it to the map yet. const popup = useMemo(() => { return new mapboxgl.Popup({ @@ -288,9 +260,7 @@ const PvLatestMap: React.FC = ({
${properties?.gspDisplayName || ""}
-
${properties?.gsp_id || ""} ${ - properties?.GSPs || "" - }
+
${properties?.GSPs || ""}
@@ -405,8 +375,6 @@ const PvLatestMap: React.FC = ({ // } }; - // return
Hello
; - return (
{forecastError ? (