Skip to content

refac: rename PWL suffix constants for clarity#643

Closed
FBumann wants to merge 1 commit intoPyPSA:feat/piecewise-api-refactorfrom
FBumann:feat/piecewise-suffix-rename
Closed

refac: rename PWL suffix constants for clarity#643
FBumann wants to merge 1 commit intoPyPSA:feat/piecewise-api-refactorfrom
FBumann:feat/piecewise-suffix-rename

Conversation

@FBumann
Copy link
Copy Markdown
Collaborator

@FBumann FBumann commented Apr 1, 2026

Summary

Rename internal PWL suffix constants to be self-descriptive without relying on method context:

Old New Generated name What it does
_x_link / _y_link _link pwl0_link expr = weighted sum (N-var, single constraint)
_binary _segment_binary pwl0_segment_binary disjunctive segment selection
_inc_binary _order_binary pwl0_order_binary incremental fill-ordering binary
_inc_link _delta_bound pwl0_delta_bound δ ≤ binary
_inc_order _binary_order pwl0_binary_order binary_{i+1} ≤ δ_i
_fill _fill_order pwl0_fill_order δ_{i+1} ≤ δ_i

Unchanged: _lambda, _convex, _delta, _select, _active_bound

Test plan

  • pytest test/test_piecewise_constraints.py — 108 passed
  • mypy . --exclude build — clean
  • ruff check — clean

🤖 Generated with Claude Code

- PWL_X_LINK_SUFFIX/_Y_LINK_SUFFIX → PWL_LINK_SUFFIX (N-var, single link)
- PWL_BINARY_SUFFIX → PWL_SEGMENT_BINARY_SUFFIX (disjunctive segment selection)
- PWL_INC_BINARY_SUFFIX → PWL_ORDER_BINARY_SUFFIX (incremental ordering)
- PWL_INC_LINK_SUFFIX → PWL_DELTA_BOUND_SUFFIX (δ ≤ binary)
- PWL_INC_ORDER_SUFFIX → PWL_BINARY_ORDER_SUFFIX (binary_{i+1} ≤ δ_i)
- PWL_FILL_SUFFIX → PWL_FILL_ORDER_SUFFIX (δ_{i+1} ≤ δ_i)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@FBumann
Copy link
Copy Markdown
Collaborator Author

FBumann commented Apr 1, 2026

Folding into #642 instead.

@FBumann FBumann closed this Apr 1, 2026
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