Skip to content

Dead code: lower-bound parameterized range-constraint helpers are unreachable #150

Description

@luke-kiernan

add_parameterized_lower_bound_range_constraints (and the chain it drives) is unreachable — it has no callers and is not exported.

Specifically, in src/devices_models/devices/common/range_constraint.jl:

  • add_parameterized_lower_bound_range_constraints (:646 expression version, :674 variable version) — no call sites in this repo or HydroPowerSimulations.jl, and not exported.
  • _add_parameterized_lower_bound_range_constraints_impl! (:753) — only called by the above.
  • lower_bound_range_with_parameter! (:703, :725) — only reached via that dead chain (the feedforward_constraints.jl:67 reference is itself in an unreached branch; SC feedforward uses the underscore-prefixed _lower_bound_range_with_parameter! instead).

Because nothing exercises them, three latent bugs sit uncaught:

  1. The impl (:780) calls lower_bound_range_with_parameter!(jump_model, constraint, array, multiplier, parameter, devices) — wrong argument shape vs. the method signature (container first, ::Type{P}/param at arg4, model last).
  2. :733 references an undefined U (get_parameter(container, U(), V)); should use param/P.
  3. arg4 is declared ::Type{P} here, but the working upper-bound twins use an instance param::P.

Either remove these as dead code, or repair them to mirror the working upper-bound family (upper_bound_range_with_parameter! / add_parameterized_upper_bound_range_constraints).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions