c8e3016fd6
- Implement `sigen_daemon.py` to poll Sigenergy plant metrics and store snapshots. - Create `web_daemon.py` for serving a web interface with various endpoints. - Add debug scripts: - `debug_duplicates.py` to find duplicate target times in forecast data. - `debug_energy_forecast.py` to print baseline energy forecast curves. - `debug_oracle_evaluations.py` to run the oracle evaluator. - `debug_sigen.py` to inspect stored Sigenergy plant snapshots. - `debug_weather.py` to trace resolved truth data. - `modbus_test.py` for exploring Sigenergy plants or inverters over Modbus TCP. - Introduce `oracle_evaluator.py` for evaluating stored oracle predictions against actuals. - Add TCN training scripts in `tcn` directory for training usage sequence models.
32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""Debug script to find duplicate target times in forecast data."""
|
|
|
|
from gibil.classes.env_loader import EnvLoader
|
|
from gibil.classes.weather.store import WeatherStore
|
|
from collections import defaultdict
|
|
|
|
EnvLoader().load()
|
|
|
|
store = WeatherStore.from_env()
|
|
dataset = store.load_display_dataset()
|
|
|
|
# Group by (target_at, horizon_hours) to find duplicates
|
|
by_key = defaultdict(list)
|
|
for point in dataset.forecast_points:
|
|
key = (point.target_at, point.horizon_hours)
|
|
by_key[key].append(point)
|
|
|
|
# Find duplicates
|
|
duplicates = {k: v for k, v in by_key.items() if len(v) > 1}
|
|
|
|
print(f"\nTotal forecast points: {len(dataset.forecast_points)}")
|
|
print(f"Unique (target_at, horizon) pairs: {len(by_key)}")
|
|
print(f"Duplicate (target_at, horizon) pairs: {len(duplicates)}")
|
|
|
|
if duplicates:
|
|
print("\nFirst 3 duplicates:")
|
|
for (target_at, horizon), points in list(duplicates.items())[:3]:
|
|
print(f"\n target_at={target_at}, horizon={horizon}h ({len(points)} points):")
|
|
for i, p in enumerate(points):
|
|
print(f" [{i}] issued_at={p.issued_at}, temp={p.temperature_c}, source={p.source}")
|