Skip to content

Conversation

@damonrand
Copy link
Contributor

Summary

  • Adds support for separate flux and flows database schemas
  • flows.schema defaults to "flows" (plot meter tables)
  • flux.schema defaults to "flux" (meter readings function, BESS readings, market data)
  • For legacy databases where everything is in flows schema, set flux.schema = "flows"
  • Bumps version to 2.0.0

Test plan

  • Test with separate schemas (flux/flows)
  • Test with legacy single schema (flux.schema = "flows")

Damon Rand added 3 commits January 6, 2026 03:08
Breaking change: Environment configuration now requires a `flux` section
for database connections. See CHANGELOG.md for migration guide.

Core changes:
- Add flux_db_url parameter to report command for separate flux database
- Add configurable schema names (flows_schema, flux_schema) with defaults
- Route meter readings function to flux schema (get_meter_readings_5m)
- Route BESS readings to flux.mg_bess_readings_30m
- Route market data to flux.market_data
- Plot meter readings continue using flows schema tables

Files modified:
- src/skypro/commands/report/main.py - add flux_db_url and schema params
- src/skypro/commands/report/readings.py - route meter/BESS to flux
- src/skypro/commands/report/rates.py - add flux_schema for market data
- src/skypro/common/data/get_meter_readings.py - parameterized schema
- src/skypro/common/data/get_plot_meter_readings.py - parameterized schema
- src/skypro/common/data/get_bess_readings.py - parameterized schema
- src/skypro/common/data/get_timeseries.py - parameterized schema

Documentation:
- Add CHANGELOG.md documenting 1.2.0 and 2.0.0 changes
- Add CLAUDE.md with codebase documentation
- Update README.md with new env.json structure
- Add dbtests/ to .gitignore for database integration test outputs

Testing:
- Update integration test fixture env.json with flux section
- All 8 tests pass (unit + integration)

Version bump: 1.2.0 -> 2.0.0a1
- Changed version from 2.0.0a1 to 2.0.0
- Published to main PyPI
Move get_db_url and get_schema_name functions after all imports
to fix E402 "module level import not at top of file" errors.
@damonrand damonrand merged commit a25a74f into main Jan 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants