consumption_dollars: route max_consumption_dollars through fixed_params (pylcm #351 cascade)#11
Open
hmgaudecker wants to merge 1 commit into
Conversation
…ed_params
The upper bound of the runtime consumption_dollars action grid used to
be a module-level constant in `baseline/regimes/_common.py`, with a
TODO to route through `fixed_params` once pylcm could surface
grid-level scalars in the params template. pylcm#348 lands that.
* `baseline/regimes/_common.py`: declare the grid as
`IrregSpacedGrid(..., extra_param_names=("max_consumption_dollars",))`
so the template gains a `ScalarFloat` slot per regime alongside
`points`.
* `consumption_dollars_grid.py`:
- Drop the module-level `MAX_CONSUMPTION_DOLLARS` constant.
- `_compute_consumption_dollars_points` takes the bound as a
parameter.
- `inject_consumption_dollars_points` reads it from
`model.fixed_params["max_consumption_dollars"]` (alongside
`exponent`), then threads it into the gridpoint computation.
* `_benchmark_data/benchmark_params.pkl`: regenerated so
`fixed_params["max_consumption_dollars"]` is populated from the
refreshed aca-data env constants.
* CI temporarily pinned to pylcm@feat/runtime-grid-extra-params;
revert to @main once pylcm#348/#350 merge.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MAX_CONSUMPTION_DOLLARS = 300_000.0inbaseline/regimes/_common.py; the upper bound of the runtime consumption_dollars grid now enters viafixed_params["max_consumption_dollars"](per pylcm#351, which addsIrregSpacedGrid(extra_param_names=...)).baseline/regimes/_common.pydeclares the grid asIrregSpacedGrid(n_points=..., extra_param_names=("max_consumption_dollars",))so pylcm surfaces the scalar slot in the params template.consumption_dollars_grid.py:_compute_consumption_dollars_pointstakes the bound as a parameter;inject_consumption_dollars_pointsreads it frommodel.fixed_params["max_consumption_dollars"]._benchmark_data/benchmark_params.pklregenerated so the snapshot carriesmax_consumption_dollarsinfixed_params. Upstream change in aca-data adds the key toenvironment_constants.@feat/runtime-grid-extra-params; revert to@mainonce pylcm#348/#350 merge.Stacks on #10 (uses the
feature/categorical-scalarintbranch as base).Test plan
pixi run -e tests-cpu pytest aca-model -n 4— 216 passed.pixi run -e type-checking ty— clean.🤖 Generated with Claude Code