mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
debugging solar api
This commit is contained in:
parent
cb993024bb
commit
01c688da23
2 changed files with 22 additions and 5 deletions
|
|
@ -258,7 +258,7 @@ class GoogleSolarApi:
|
||||||
|
|
||||||
# Remove any north facing roof segments
|
# Remove any north facing roof segments
|
||||||
panel_performance = []
|
panel_performance = []
|
||||||
for config in self.insights_data["solarPotential"]["solarPanelConfigs"]:
|
for config in self.insights_data["solarPotential"].get("solarPanelConfigs", []):
|
||||||
roof_segment_summaries = config["roofSegmentSummaries"]
|
roof_segment_summaries = config["roofSegmentSummaries"]
|
||||||
# Filter on just the segments in self.roof_segment_indexes
|
# Filter on just the segments in self.roof_segment_indexes
|
||||||
roof_segment_summaries = [
|
roof_segment_summaries = [
|
||||||
|
|
@ -310,7 +310,25 @@ class GoogleSolarApi:
|
||||||
)
|
)
|
||||||
|
|
||||||
panel_performance = pd.DataFrame(panel_performance)
|
panel_performance = pd.DataFrame(panel_performance)
|
||||||
# We can have duplicate configurations
|
|
||||||
|
if panel_performance.empty:
|
||||||
|
self.panel_performance = pd.DataFrame(
|
||||||
|
columns=[
|
||||||
|
"n_panels",
|
||||||
|
"yearly_dc_energy",
|
||||||
|
"total_cost",
|
||||||
|
"panneled_roof_area",
|
||||||
|
"array_wattage",
|
||||||
|
"initial_ac_kwh_per_year",
|
||||||
|
"lifetime_ac_kwh",
|
||||||
|
"roi",
|
||||||
|
"expected_payback_years",
|
||||||
|
"lifetime_dc_kwh"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
# We can have duplicate configurations
|
||||||
panel_performance = panel_performance.drop_duplicates()
|
panel_performance = panel_performance.drop_duplicates()
|
||||||
# If we look at the building level, we don't include any projects fewer than 10 panels, otherwise the
|
# If we look at the building level, we don't include any projects fewer than 10 panels, otherwise the
|
||||||
# minimum is 4
|
# minimum is 4
|
||||||
|
|
|
||||||
|
|
@ -472,8 +472,6 @@ async def trigger_plan(body: PlanTriggerRequest):
|
||||||
materials = get_materials(session)
|
materials = get_materials(session)
|
||||||
cleaned = get_cleaned()
|
cleaned = get_cleaned()
|
||||||
|
|
||||||
solar_api_client = GoogleSolarApi(api_key=get_settings().GOOGLE_SOLAR_API_KEY)
|
|
||||||
|
|
||||||
dataset_version = "2024-07-08"
|
dataset_version = "2024-07-08"
|
||||||
energy_consumption_client = EnergyConsumptionModel(
|
energy_consumption_client = EnergyConsumptionModel(
|
||||||
model_paths={
|
model_paths={
|
||||||
|
|
@ -588,6 +586,7 @@ async def trigger_plan(body: PlanTriggerRequest):
|
||||||
energy_consumption = sum(
|
energy_consumption = sum(
|
||||||
[entry['energy_consumption'] for entry in building_ids if entry['building_id'] == building_id]
|
[entry['energy_consumption'] for entry in building_ids if entry['building_id'] == building_id]
|
||||||
)
|
)
|
||||||
|
solar_api_client = GoogleSolarApi(api_key=get_settings().GOOGLE_SOLAR_API_KEY)
|
||||||
solar_api_client.get(
|
solar_api_client.get(
|
||||||
longitude=coordinates["longitude"],
|
longitude=coordinates["longitude"],
|
||||||
latitude=coordinates["latitude"],
|
latitude=coordinates["latitude"],
|
||||||
|
|
@ -629,7 +628,7 @@ async def trigger_plan(body: PlanTriggerRequest):
|
||||||
# We check if we have a solar non-invasive recommendation
|
# We check if we have a solar non-invasive recommendation
|
||||||
if [r for r in property_instance.non_invasive_recommendations if r["type"] == "solar_pv"]:
|
if [r for r in property_instance.non_invasive_recommendations if r["type"] == "solar_pv"]:
|
||||||
continue
|
continue
|
||||||
|
solar_api_client = GoogleSolarApi(api_key=get_settings().GOOGLE_SOLAR_API_KEY)
|
||||||
solar_api_client.get(
|
solar_api_client.get(
|
||||||
longitude=unit["longitude"],
|
longitude=unit["longitude"],
|
||||||
latitude=unit["latitude"],
|
latitude=unit["latitude"],
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue