Skip to content

Caiso integration#5

Open
elmartinj wants to merge 9 commits into
TimeCopilot:mainfrom
elmartinj:caiso-integration
Open

Caiso integration#5
elmartinj wants to merge 9 commits into
TimeCopilot:mainfrom
elmartinj:caiso-integration

Conversation

@elmartinj

@elmartinj elmartinj commented Jun 11, 2026

Copy link
Copy Markdown

Caiso integration is identical to current CENACE's development state.

It is important to note that the OASIS API will only provide 39 months of history, prior data is available but would involve redesign of extraction and data flow structure.

General diagram of workflow is as follows:

CAISO OASIS API

src/data/caiso/extract/core.py
Downloads DAM LMP ZIP files in date chunks
Saves raw files under data/caiso/raw/
...
src/data/caiso/transform/core.py
Filters total LMP rows
Converts data to: unique_id | ds | y
Saves data/caiso/processed/caiso.csv
...
src/data/caiso/aggregate/core.py
Creates daily Parquet partitions under:
data/caiso/processed-events/hourly/
...
src/data/caiso/utils/caiso_data.py
Loads training windows and actuals from partitioned data
...
src/forecast/caiso/core.py
Runs the existing Impermanent forecasting flow
...
src/evaluation/caiso/core.py
Evaluates forecasts using the existing Impermanent metrics

src/data/caiso/config.py contains the selected CAISO nodes, market configuration, start date and local storage paths.

For future S3 deployment
The current implementation uses local paths, but the pipeline stages are already separated cleanly enough for S3 deployment:

OASIS

  • s3://bucket/caiso/raw/
  • transformation job
  • s3://bucket/caiso/processed/
  • daily Parquet partitions
  • forecast and evaluation jobs

The main change will be replacing direct Path and local filesystem operations with a storage abstraction supporting both local and S3 locations. Extraction, transformation, forecasting and evaluation logic should remain unchanged.

@elmartinj

Copy link
Copy Markdown
Author

Update: added S3/Modal deployment support for CAISO.

This ports the deployment pattern validated in the CENACE PR:

  • CAISO data root can be overridden with CAISO_DATA_ROOT.
  • Hourly parquet writes now use local temp files before copying to S3-mounted paths.
  • Forecast and evaluation writes use the same S3-safe temp-copy pattern than the CENACE implementation in its cousin PR.
  • Added CAISO pipeline runner for date ranges.
  • Added Modal app for CAISO data updates.
  • Added split Modal forecast/evaluation runner.
  • Added Makefile targets:
    • update-caiso-data
    • update-caiso-forecast
    • update-caiso-evaluate
  • Added CAISO OASIS error detection for ZIPs that contain XML error responses instead of data.

Validation:

  • pre-commit passed: ruff, ruff-format, mypy, toml-sort-fix.
  • Modal data smoke passed:
    make update-caiso-data START=2025-01-01 END=2025-01-03
  • Successfully wrote S3 hourly partitions under:
    s3://impermanent-benchmark/v0.1.0/caiso/processed-events/hourly/
  • Modal forecast smoke passed:
    make update-caiso-forecast CUTOFF=2025-01-03T00:00:00
  • Modal evaluation smoke passed:
    make update-caiso-evaluate CUTOFF=2025-01-03T00:00:00
  • Forecasts and metrics were written for all 5 CPU benchmark models.

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.

1 participant