Skip to content

Commit

Permalink
remove comments and unneeded code from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
braddf committed Dec 18, 2024
1 parent b824ff5 commit 2048d27
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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`,
Expand Down
1 change: 0 additions & 1 deletion apps/nowcasting-app/components/charts/pv-remix-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
Expand Down
1 change: 0 additions & 1 deletion apps/nowcasting-app/components/helpers/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ const mapGspFeatures: (
});
};

// TODO BRAD: map/aggregate all the GSP data to the zone level
const mapZoneFeatures: (
features: Feature[],
gspZoneGroupings: GspZoneGroupings,
Expand Down
34 changes: 1 addition & 33 deletions apps/nowcasting-app/components/map/pvLatestMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,34 +137,6 @@ const PvLatestMap: React.FC<PvLatestMapProps> = ({
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({
Expand Down Expand Up @@ -288,9 +260,7 @@ const PvLatestMap: React.FC<PvLatestMapProps> = ({
<div class="flex justify-between gap-3 items-center mb-1">
<!-- TODO – remove gsp_id when done testing zones -->
<div class="text-sm font-semibold">${properties?.gspDisplayName || ""}</div>
<div class="text-xs text-mapbox-black-300">${properties?.gsp_id || ""} ${
properties?.GSPs || ""
}</div>
<div class="text-xs text-mapbox-black-300">${properties?.GSPs || ""}</div>
</div>
<div class="flex justify-between items-center">
Expand Down Expand Up @@ -405,8 +375,6 @@ const PvLatestMap: React.FC<PvLatestMapProps> = ({
// }
};

// return <div>Hello</div>;

return (
<div className={`pv-map relative h-full w-full ${className}`}>
{forecastError ? (
Expand Down

0 comments on commit 2048d27

Please sign in to comment.