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

assign_duals() not assigning duals for custom constraints which are not tied to a component type #850

Open
ktehranchi opened this issue Mar 8, 2024 · 0 comments

Comments

@ktehranchi
Copy link

ktehranchi commented Mar 8, 2024

Describe the feature you'd like to see

I have implemented custom constraints in my model like regional CO2/Capacity/SAFE- and would like to access the duals of these constraints. However- as currently implemented assign_duals() will only assign duals where the component name from (c, attr = name.split("-", 1) ) is a network component or is "GlobalConstraint".

I believe this is already an issue with other pypsa-eur/usa opts like SAFE and CCL where the constraint names are not tied to components.

A temporary solution for myself is to name these constraints as "GlobalConstraint-SAFE_XXX_Region". However, it could be useful to have a dedicated location for these regional/custom constraint duals + a place to store the constraints themselves. I am happy to implement a solution if you all have any preferred location/method for storing these variables.

Or- perhaps just adding in the documentation a note like "if you want to access your duals then set the constraint name to "GlobalConstraint-...."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant