Skip to content

Commit dd5da37

Browse files
committed
add more debugging
1 parent d38e753 commit dd5da37

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

solar_consumer/save/save_data_platform.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,23 @@ async def save_generation_to_data_platform(
389389
# NL was previously ignoring these exceptions
390390
await _execute_async_tasks(tasks, ignore_exceptions=False)
391391

392+
for lid, t, new_cap in zip(
393+
updates_df["location_uuid"],
394+
updates_df["target_datetime_utc"],
395+
updates_df["new_effective_capacity_watts"],
396+
):
397+
pivot_time = datetime.datetime(2025, 1, 2, tzinfo=datetime.timezone.utc)
398+
get_location_request = dp.GetLocationRequest(
399+
location_uuid=lid,
400+
energy_source=dp.EnergySource.SOLAR,
401+
pivot_timestamp_utc=pivot_time
402+
)
403+
get_location_request = await client.get_location(get_location_request)
404+
logging.info(f"DEBUG: get_location_request for {lid} returned {get_location_request}")
405+
logging.info(f"DEBUG: get_location_request effective_capacity_watts for {lid} is {get_location_request.effective_capacity_watts}")
406+
logging.info(f"DEBUG: expected new_cap for {lid} is {new_cap}")
407+
assert get_location_request.effective_capacity_watts == new_cap
408+
392409
# 3. Generate the CreateObservationRequest objects from the DataFrame.
393410
observations_by_loc: dict[str, list[dp.CreateObservationsRequestValue]] = defaultdict(list)
394411
for lid, t, val in zip(

0 commit comments

Comments
 (0)