Skip to content

Merge unstable into main: extension framework, extensions, and fixes - #369

Open
jdecarolis wants to merge 80 commits into
mainfrom
merge-unstable-into-main
Open

Merge unstable into main: extension framework, extensions, and fixes#369
jdecarolis wants to merge 80 commits into
mainfrom
merge-unstable-into-main

Conversation

@jdecarolis

@jdecarolis jdecarolis commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Resolves conflicts in README.md (took unstable's TemoaSequencer
rewrite over main's formatting-only change) and requirements.txt /
requirements-dev.txt / uv.lock (regenerated lockfiles after taking
unstable's dependency state).

Thanks to @idelder (#343, #345, #349, #350, #359, #368),
@SutubraResearch (#351), and @DavidLikesLearning (#332) for the PRs
rolled up in this merge.

jdecarolis and others added 30 commits May 18, 2026 22:41
avoids string interpolation just in case
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/uv-pre-commit: 0.11.19 → 0.11.21](astral-sh/uv-pre-commit@0.11.19...0.11.21)
- [github.com/astral-sh/ruff-pre-commit: v0.15.16 → v0.15.17](astral-sh/ruff-pre-commit@v0.15.16...v0.15.17)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/uv-pre-commit: 0.11.21 → 0.11.23](astral-sh/uv-pre-commit@0.11.21...0.11.23)
- [github.com/astral-sh/ruff-pre-commit: v0.15.17 → v0.15.18](astral-sh/ruff-pre-commit@v0.15.17...v0.15.18)

* Load early retirements from previous planning periods

Signed-off-by: Davey Elder <iandavidelder@gmail.com>

* Adjust existing capacity for past early retirement in myopic

Signed-off-by: Davey Elder <iandavidelder@gmail.com>

* Fix handling of existing capacity for p0

Signed-off-by: Davey Elder <iandavidelder@gmail.com>

* Pull lifetimes data for previously retired existing capacities for accounting purposes

Signed-off-by: Davey Elder <iandavidelder@gmail.com>

* Actually load growthrate constraints

Signed-off-by: Davey Elder <iandavidelder@gmail.com>

* Add a broad stress test for myopic that includes survival curves, early retirement, and growth rate constraints all together

Signed-off-by: Davey Elder <iandavidelder@gmail.com>

* Update test set hashes

Signed-off-by: Davey Elder <iandavidelder@gmail.com>

* Improve custom loader filtering for lifetime data

Signed-off-by: Davey Elder <iandavidelder@gmail.com>

* Update existing capacity check to specifically look for tiny dropped capacities

Signed-off-by: Davey Elder <iandavidelder@gmail.com>

* Try to fix python 3.12 type error

Signed-off-by: Davey Elder <iandavidelder@gmail.com>

* Check if output retirement table exists

Signed-off-by: Davey Elder <iandavidelder@gmail.com>

---------

Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
The v3->v4 migrator routed TechInputSplit and TechOutputSplit rows to the
seasonal v4 tables (limit_tech_input_split / limit_tech_output_split)
unconditionally. Temoa's seasonal split constraints only apply to
non-annual techs, so every annual tech's split constraint silently
disappeared from migrated models: the rows exist in the DB but no
constraint is built from them.

Fix: partition split rows by the tech's Technology.annual flag (with a
tech_annual table fallback for older v3 databases) and route annual
techs' rows to limit_tech_input_split_annual / limit_tech_output_split_annual.
The seasonal and annual targets are column-identical, so the existing row
transformation applies to both.

Found migrating the Open Energy Outlook 9-region US database: 13,313 of
15,369 TechInputSplit rows belonged to annual techs (transport fuel
blends, industrial fuel mixes) and were dropped from the model, letting
e.g. Fischer-Tropsch synfuel run without its mandated hydrogen input.

Adds regression coverage: both mock datasets now carry a seasonal-tech
and an annual-tech split row, asserting placement after migration. The
new v3-schema assertions fail without this fix.
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
…P models

Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
idelder and others added 27 commits August 7, 2026 19:41
…ctions

Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Fix v4 migrator: route annual techs' split rows to the annual split tables
📦 Dependency Canary: Upgrade all packages
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Temporarily lock pyomo to v6.9.5 due to performance regression
📦 Dependency Canary: Upgrade all packages
Clean incomplete emissions constraint handler. The original code passed (e, emission_limit) as a single tuple argument to logger.warning, when it should be two separate positional args for the %s ... %s formatting in msg to work correctly.
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
📦 Dependency Canary: Upgrade all packages
Fix the programmatic route to running Temoa in README
extensions, migrator/emissions/pyomo fixes, and dependency updates

- Add a modular extension framework (#343) and three extensions built
  on it: discrete capacity (#345), economies of scale (#349), and unit
  commitment (#350)
- Fix v4 migrator routing of annual techs' split rows (#351)
- Fix emissions constraint logger.warning arg mismatch (#332)
- Temporarily pin pyomo to 6.9.5 to avoid a performance regression (#359)
- Rewrite the README's programmatic-usage example for the current
  TemoaSequencer API (#368)
- Roll up ~10 dependency-canary security/dependency updates

Resolves conflicts in README.md (took unstable's TemoaSequencer
rewrite over main's formatting-only change) and requirements.txt /
requirements-dev.txt / uv.lock (regenerated lockfiles after taking
unstable's dependency state).

Thanks to @idelder (#343, #345, #349, #350, #359, #368),
@SutubraResearch (#351), and @DavidLikesLearning (#332) for the PRs
rolled up in this merge.
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 136 files, which is 36 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 00f677c7-89c0-4d64-90ce-980655426221

📥 Commits

Reviewing files that changed from the base of the PR and between 4f9d791 and 9c5a690.

⛔ Files ignored due to path filters (5)
  • docs/source/images/eos_cost_curve.png is excluded by !**/*.png
  • docs/source/images/eos_cost_curve.svg is excluded by !**/*.svg
  • docs/source/images/etl_cost_curve.png is excluded by !**/*.png
  • docs/source/images/etl_cost_curve.svg is excluded by !**/*.svg
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (136)
  • README.md
  • docs/source/computational_implementation.rst
  • docs/source/database_schema.mmd
  • docs/source/extensions.rst
  • docs/source/extensions/discrete_capacity.rst
  • docs/source/extensions/eos.rst
  • docs/source/extensions/growth_rates.rst
  • docs/source/extensions/unit_commitment.rst
  • docs/source/index.rst
  • docs/source/mathematical_formulation.rst
  • docs/source/param_desc_and_tables.rst
  • pyproject.toml
  • requirements-dev.txt
  • requirements.txt
  • scripts/generate_etl_figure.py
  • temoa/__init__.py
  • temoa/_internal/exchange_tech_cost_ledger.py
  • temoa/_internal/run_actions.py
  • temoa/_internal/table_data_puller.py
  • temoa/_internal/table_writer.py
  • temoa/_internal/temoa_sequencer.py
  • temoa/cli.py
  • temoa/components/capacity.py
  • temoa/components/commodities.py
  • temoa/components/costs.py
  • temoa/components/limits.py
  • temoa/components/operations.py
  • temoa/components/reserves.py
  • temoa/components/storage.py
  • temoa/components/technology.py
  • temoa/components/time.py
  • temoa/components/utils.py
  • temoa/core/config.py
  • temoa/core/model.py
  • temoa/data_io/component_manifest.py
  • temoa/data_io/hybrid_loader.py
  • temoa/data_io/loader_manifest.py
  • temoa/db_schema/temoa_schema_v4.sql
  • temoa/extensions/discrete_capacity/__init__.py
  • temoa/extensions/discrete_capacity/components/__init__.py
  • temoa/extensions/discrete_capacity/components/discrete_capacity.py
  • temoa/extensions/discrete_capacity/core/__init__.py
  • temoa/extensions/discrete_capacity/core/model.py
  • temoa/extensions/discrete_capacity/data_manifest.py
  • temoa/extensions/discrete_capacity/extension.py
  • temoa/extensions/discrete_capacity/tables.sql
  • temoa/extensions/economies_of_scale/__init__.py
  • temoa/extensions/economies_of_scale/components/__init__.py
  • temoa/extensions/economies_of_scale/components/cost_fixed_eos.py
  • temoa/extensions/economies_of_scale/components/cost_invest_eos.py
  • temoa/extensions/economies_of_scale/components/cost_variable_eos.py
  • temoa/extensions/economies_of_scale/core/__init__.py
  • temoa/extensions/economies_of_scale/core/data_puller.py
  • temoa/extensions/economies_of_scale/core/model.py
  • temoa/extensions/economies_of_scale/data_manifest.py
  • temoa/extensions/economies_of_scale/extension.py
  • temoa/extensions/economies_of_scale/tables.sql
  • temoa/extensions/framework.py
  • temoa/extensions/get_comm_tech.py
  • temoa/extensions/growth_rates/__init__.py
  • temoa/extensions/growth_rates/components/__init__.py
  • temoa/extensions/growth_rates/components/growth_capacity.py
  • temoa/extensions/growth_rates/components/growth_new_capacity.py
  • temoa/extensions/growth_rates/components/growth_new_capacity_delta.py
  • temoa/extensions/growth_rates/core/__init__.py
  • temoa/extensions/growth_rates/core/model.py
  • temoa/extensions/growth_rates/data_manifest.py
  • temoa/extensions/growth_rates/extension.py
  • temoa/extensions/growth_rates/tables.sql
  • temoa/extensions/method_of_morris/morris.py
  • temoa/extensions/method_of_morris/morris_evaluate.py
  • temoa/extensions/method_of_morris/morris_sequencer.py
  • temoa/extensions/modeling_to_generate_alternatives/hull.py
  • temoa/extensions/modeling_to_generate_alternatives/manager_factory.py
  • temoa/extensions/modeling_to_generate_alternatives/mga_sequencer.py
  • temoa/extensions/modeling_to_generate_alternatives/tech_activity_vector_manager.py
  • temoa/extensions/modeling_to_generate_alternatives/vector_manager.py
  • temoa/extensions/modeling_to_generate_alternatives/worker.py
  • temoa/extensions/monte_carlo/example_builds/scenario_analyzer.py
  • temoa/extensions/monte_carlo/example_builds/scenario_maker.py
  • temoa/extensions/monte_carlo/mc_run.py
  • temoa/extensions/monte_carlo/mc_sequencer.py
  • temoa/extensions/monte_carlo/mc_worker.py
  • temoa/extensions/myopic/evolution_updater.py
  • temoa/extensions/myopic/myopic_progress_mapper.py
  • temoa/extensions/myopic/myopic_sequencer.py
  • temoa/extensions/single_vector_mga/output_summary.py
  • temoa/extensions/single_vector_mga/sv_mga_sequencer.py
  • temoa/extensions/stochastics/scenario_creator.py
  • temoa/extensions/stochastics/stochastic_config.py
  • temoa/extensions/stochastics/stochastic_sequencer.py
  • temoa/extensions/template/__init__.py
  • temoa/extensions/template/components/__init__.py
  • temoa/extensions/template/components/example_limit.py
  • temoa/extensions/template/core/__init__.py
  • temoa/extensions/template/core/model.py
  • temoa/extensions/template/data_manifest.py
  • temoa/extensions/template/extension.py
  • temoa/extensions/template/tables.sql
  • temoa/extensions/unit_commitment/__init__.py
  • temoa/extensions/unit_commitment/components/__init__.py
  • temoa/extensions/unit_commitment/components/commitment.py
  • temoa/extensions/unit_commitment/components/startup.py
  • temoa/extensions/unit_commitment/core/__init__.py
  • temoa/extensions/unit_commitment/core/data_puller.py
  • temoa/extensions/unit_commitment/core/model.py
  • temoa/extensions/unit_commitment/data_manifest.py
  • temoa/extensions/unit_commitment/extension.py
  • temoa/extensions/unit_commitment/tables.sql
  • temoa/tutorial_assets/config_sample.toml
  • temoa/tutorial_assets/utopia.sql
  • temoa/types/__init__.py
  • temoa/types/dict_types.py
  • temoa/utilities/master_migration.py
  • tests/conftest.py
  • tests/legacy_test_values.py
  • tests/test_cli.py
  • tests/test_extensions.py
  • tests/test_full_runs.py
  • tests/test_set_consistency.py
  • tests/test_table_writer.py
  • tests/test_v4_migration.py
  • tests/testing_configs/config_myopic_capacities.toml
  • tests/testing_configs/config_test_week.toml
  • tests/testing_configs/config_utopia_myopic.toml
  • tests/testing_data/mediumville.sql
  • tests/testing_data/mediumville_sets.json
  • tests/testing_data/migration_v3_1_mock.sql
  • tests/testing_data/migration_v3_mock.sql
  • tests/testing_data/myopic_capacities.sql
  • tests/testing_data/test_system_sets.json
  • tests/testing_data/test_week.sql
  • tests/testing_data/utopia_sets.json
  • tests/testing_data/utopia_v3.sql
  • tests/utilities/capture_set_values_for_cache.py
  • tests/utilities/hash_utils.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

4 participants