Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent backend after adding constraint that applies nowhere #425

Closed
jnnr opened this issue Mar 17, 2023 · 1 comment
Closed

Inconsistent backend after adding constraint that applies nowhere #425

jnnr opened this issue Mar 17, 2023 · 1 comment
Assignees
Projects
Milestone

Comments

@jnnr
Copy link
Contributor

jnnr commented Mar 17, 2023

Problem description

When adding constraints (m.backend.add_constraint) that do not apply anywhere because of the where, the backend is left in an inconsistent state:

The constraint does not appear in m.backend.constraints. But when you try to add a new version of the constraint with the same name, you will be notified that the constraint already exists. That's because it remains in the pyomo list created in _add_constraint_or_expression.

This list should be deleted if the constraint (/other optimisation problem element) does not apply anywhere.

Steps to reproduce the problem

Add a constraint with a where string does not apply anywhere.

Calliope version

v0.7dev

@sjpfenninger sjpfenninger added this to the 0.7.0 milestone Mar 17, 2023
@sjpfenninger sjpfenninger added this to Constraints as YAML in v0.7.0 Mar 17, 2023
@brynpickering brynpickering self-assigned this Mar 22, 2023
@jnnr
Copy link
Contributor Author

jnnr commented Apr 21, 2023

Closed by #437

@jnnr jnnr closed this as completed Apr 21, 2023
v0.7.0 automation moved this from Constraints as YAML to Done Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

3 participants