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 trace resolved truth data."""
|
|
|
|
from gibil.classes.env_loader import EnvLoader
|
|
from gibil.classes.weather.store import WeatherStore
|
|
from gibil.classes.weather.display import WeatherDisplay
|
|
from datetime import datetime, timezone
|
|
|
|
EnvLoader().load()
|
|
|
|
store = WeatherStore.from_env()
|
|
dataset = store.load_display_dataset()
|
|
|
|
print(f"\n=== DEBUG OUTPUT ===")
|
|
print(f"Forecast points: {len(dataset.forecast_points)}")
|
|
print(f"Resolved truth points: {len(dataset.resolved_truth)}")
|
|
|
|
print(f"\nResolved truth details:")
|
|
for i, point in enumerate(dataset.resolved_truth):
|
|
print(f" [{i}] resolved_at={point.resolved_at}, temp={point.temperature_c}, radiation={point.shortwave_radiation_w_m2}")
|
|
|
|
print(f"\nAPI payload:")
|
|
display = WeatherDisplay()
|
|
payload = display.data_payload(dataset)
|
|
import json
|
|
data = json.loads(payload)
|
|
print(f" Resolved truth in payload: {len(data['resolved_truth'])}")
|
|
for i, point in enumerate(data['resolved_truth']):
|
|
print(f" [{i}] resolved_at={point['resolved_at']}, temp={point['temperature_c']}")
|
|
|
|
print(f"\n=== END DEBUG ===\n")
|