Skip to content

BUG:IndexError with numpy ≥ 1.26 in Pyomo multiply constraint builder #54

Description

@dalyw

eeco/utils.py line 405 indexes numpy arrays with Pyomo time-set values (floats)

def const_rule(model, t):
    return var[t] == expression1[t] * expression2[t]

This assumes model.t is range(0, T) (the documented convention in how_to_cost.rst). It breaks for any other ordered time set. Solution depends on how versatile this needs to be for pyomo users

  • [ x] I have checked that this issue has not already been reported.

  • [ x] I have confirmed this bug exists on the latest version of eeco.


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Description

A clear description of the bug

Expected Behavior

What did you expect to happen instead?

Reproduction

A minimal example that exhibits the behavior.

# Your code here

Environment

Any additional information about your environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageIssue that has not been reviewed by `electric-emission-cost` team member

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions