Skip to content

fix: namespace user commitment names with a custom: prefix#2285

Open
Flix6x wants to merge 3 commits into
mainfrom
fix/namespace-user-commitment-names
Open

fix: namespace user commitment names with a custom: prefix#2285
Flix6x wants to merge 3 commits into
mainfrom
fix/namespace-user-commitment-names

Conversation

@Flix6x

@Flix6x Flix6x commented Jul 10, 2026

Copy link
Copy Markdown
Member

Description

Implements the internal namespacing proposed in #1572: a user commitment named e.g. electricity net energy would shadow the scheduler's internal commitment of the same name in the name-keyed commitment-costs dict of the scheduling results. StorageScheduler.convert_to_commitments now (idempotently) prefixes user-given names with custom:, so users can pick any name. The prefixed name is what shows up in the commitment costs.

  • Added changelog item in documentation/changelog.rst

How to test

pytest flexmeasures/data/models/planning/tests/test_commitments.py -k namespaced

Related Items

Prepares the commitments flex-context editor (#1572).

🤖 Generated with Claude Code

https://claude.ai/code/session_016MLCUiSdXDqDBmg8GbYp1B

A user commitment named e.g. 'electricity net energy' would shadow the
scheduler's internal commitment of the same name in the name-keyed
commitment-costs dict of the scheduling results. Prefix user names in
convert_to_commitments (idempotently), so users can pick any name.

Prepares the commitments editor (#1572), where users type free-form names.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MLCUiSdXDqDBmg8GbYp1B
…mmitment-names

Resolve conflicts:
- changelog.rst: keep both the #2285 namespacing entry and main's bugfix list.
- test_commitments.py: keep both branches' appended tests; drop a duplicate
  'ur' import introduced by the merge; adapt main's commodity-matching test to
  expect the new 'custom:' prefix on user-given commitment names (#2285 x main
  interaction).

Signed-off-by: F.N. Claessen <claessen@seita.nl>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MLCUiSdXDqDBmg8GbYp1B
Signed-off-by: F.N. Claessen <claessen@seita.nl>
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