You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Replace nb-scenarios with scenario playlist in scenario-scope (#206)
* Replace nb-scenarios with scenario playlist in scenario-scope
The scenario-scope config now accepts either an inline include/exclude
declaration (with support for 1-based integer indices and 'a-b' range
strings) or a playlist-file reference pointing to a flat JSON array of
1-based integers. Both forms resolve to a sorted, deduplicated list of
0-based MC scenario indices consumed by the solver.
nb-scenarios is removed: the pydantic extra="forbid" policy makes any
YAML that still uses it a hard validation error. All test fixtures and
inline config strings have been migrated to the new include form.
validate_optim_config gains an optional scenario_builder parameter to
cross-check playlist indices against every defined scenario group.
https://claude.ai/code/session_01EfjU9tBfdyZ9nZmQFCe5uU
* Update uv.lock after dependency resolution
https://claude.ai/code/session_01EfjU9tBfdyZ9nZmQFCe5uU
* Fix black and isort formatting
Two lines wrapped to 88 chars in parsing.py; one extra blank line
removed after import in the test file.
https://claude.ai/code/session_01EfjU9tBfdyZ9nZmQFCe5uU
* Improve scenario-scope: string ints, eager cache, missing tests
- _expand_entries now accepts string integers like "5" in addition to
int 5 and range "1-10", treating them identically after stripping
- ScenarioScopeConfig stores scenario_ids in a PrivateAttr cache so
resolution happens at most once per instance
- load_optim_config triggers eager resolution after path resolution,
so the playlist file is read exactly once at load time and I/O
errors surface immediately
- New tests: string-integer entries, cache identity (file deleted after
load), and validate_optim_config ScenarioBuilder cross-check
https://claude.ai/code/session_01EfjU9tBfdyZ9nZmQFCe5uU
* Fix playlist loading: wrap I/O errors as ValueError, reject JSON booleans
FileNotFoundError and json.JSONDecodeError from _load_playlist now surface
as ValueError so callers always receive a consistent exception type.
JSON boolean values (true/false) are now explicitly rejected — bool is a
subclass of int in Python so they previously slipped through the isinstance
check silently. Three new tests cover each case.
https://claude.ai/code/session_01EfjU9tBfdyZ9nZmQFCe5uU
* Update documentation for scenario-scope playlist feature
- optim-config.md: replace nb-scenarios section with full description of
the inline (include/exclude) and playlist-file forms, with examples,
validation rules, and updated Python API snippets
- scenario-builder.md: remove stale nb-scenarios reference; link to
validate_optim_config cross-check
- CHANGELOG.md: add [Unreleased] entry summarising the playlist changes;
fix the 0.1.0 entry that still mentioned nb_scenarios
https://claude.ai/code/session_01EfjU9tBfdyZ9nZmQFCe5uU
* Reject boolean values in inline include/exclude lists
Pydantic coerces True/False to 1/0 before _expand_entries sees them, so
the check must happen at the field_validator(mode="before") layer. A
field_validator on include and exclude now raises ValueError for any bool
item, making the behaviour consistent with playlist-file which already
rejects JSON booleans. Two new tests cover include=[True] and
exclude=[False].
https://claude.ai/code/session_01EfjU9tBfdyZ9nZmQFCe5uU
* Switch scenario-scope to 0-based indexing throughout
All user-facing scenario index surfaces (optim-config.yml include/exclude
and JSON playlist files) now use 0-based indices, consistent with the
modeler-scenariobuilder.dat convention. The internal representation is
unchanged (already 0-based), so only the boundary conversion code is
affected:
- _expand_entries: removed the '- 1' offset; lower bound is now >= 0
- _load_playlist: removed the '- 1' offset; lower bound is now >= 0
- _resolve_inline warning: no longer adds 1 back when reporting orphans
- Range 'a-b' now means [a, b] inclusive (both 0-based)
All test fixtures, inline config strings, unit tests and documentation
updated accordingly. 'include: [0]' now means the first scenario (was 1).
https://claude.ai/code/session_01EfjU9tBfdyZ9nZmQFCe5uU
* Fix CHANGELOG: restore accurate 0.1.0 entry, add inline boolean note
- 0.1.0 entry: restore nb_scenarios description (that is what was shipped
in 0.1.0; the playlist feature is in [Unreleased])
- [Unreleased] other-changes bullet: broaden boolean rejection note to
cover both inline include/exclude lists and JSON playlist files
https://claude.ai/code/session_01EfjU9tBfdyZ9nZmQFCe5uU
* Allow exclude with playlist-file; update docstrings throughout
exclude is no longer restricted to the inline include form — it now applies
to both base-set forms (include and playlist-file). The exclude logic was
lifted out of _resolve_inline (now removed) into _compute_scenario_ids so
it runs uniformly after the base set is built.
- _check_constraints: 'exclude' now requires include OR playlist-file
- _load_playlist: returns Set[int] instead of List[int]; sorting deferred
to _compute_scenario_ids after exclude is applied
- _compute_scenario_ids: single unified method handles both forms + exclude
- Warning message updated: 'include set' → 'base set'
Docstrings updated:
- ScenarioScopeConfig: full class docstring documenting both forms,
exclude compatibility, caching behaviour, and index convention
- _expand_entries: clarified entry formats and boolean handling note
- validate_optim_config: enumerated bullet-point list of all checks
- ScenarioBuilder.validate_mc_scenarios: documents return contract
Four new tests cover playlist-file + exclude (basic, range, all-excluded,
orphan warning). Updated test for the relaxed exclude-without-base error.
https://claude.ai/code/session_01EfjU9tBfdyZ9nZmQFCe5uU
* Fix validate_mc_scenarios error message; update load_optim_config docstring
validate_mc_scenarios was still converting indices to 1-based in its error
message after the 0-based switch. Error now reports the raw 0-based indices
and the correct range (0–N-1).
load_optim_config docstring replaced: removes the stale 'components_path'
reference and documents the two extra steps the function performs beyond
plain YAML parsing (relative path resolution and eager scenario_ids
population).
https://claude.ai/code/session_01EfjU9tBfdyZ9nZmQFCe5uU
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Equality refacto (#209)
* Equality refacto
* Add and update tests
* Update reference MPS
---------
Co-authored-by: Antoine Oustry, PhD <58943406+aoustry@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: tbittar <thomas.bittar@rte-france.com>
-**`scenario_scope.nb_scenarios`** — number of Monte-Carlo scenarios to run
77
+
- **`scenario_scope.nb_scenarios`** — number of Monte-Carlo scenarios to run (replaced by the playlist mechanism in a later release)
30
78
- **`solver_options`** — solver name (default: HiGHS), log verbosity, and free-form solver parameters
31
79
- **`models[].model_decomposition`** — per-model assignment of variables, constraints, and objective contributions to `master`, `subproblems`, or `master-and-subproblems` (used for Benders decomposition)
32
80
- **`models[].out_of_bounds_processing`** — per-constraint handling of time indices that fall outside the horizon (`cyclic` or `drop`)
0 commit comments