Add new daemons and debug scripts for Sigenergy and Oracle functionalities
- 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.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#!/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")
|
||||
Reference in New Issue
Block a user