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

Allow node params on links #736

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jnnr
Copy link
Contributor

@jnnr jnnr commented Jan 27, 2025

Fixes the following issue:

I am not allowed to set a constraint on flow_out of transmission links. I will get this error:

calliope.exceptions.ModelError: (data_sources, boundary_link_flow_out) | Cannot define transmission technology data over the `nodes` dimension.

I am trying to provide the model with a data table like this:

nodes,techs,timesteps,fix_link_flow_out
ESP,ESP_to_FRA,2017-01-01,120

And a constraint like this:

constraints:
  boundary_constraint_link_flow_out_group_ub:
    foreach: [nodes,techs,carriers,timesteps]
    where: "base_tech=transmission AND carriers=electricity AND fix_link_flow_out"
    equations:
      - expression: flow_out == fix_link_flow_out

Summary of changes in this pull request

I convert the error message into a warning.

Reviewer checklist

  • Test(s) added to cover contribution
  • Documentation updated
  • Changelog updated
  • Coverage maintained or improved

@@ -154,7 +155,7 @@ def node_dict(self, techs_incl_inheritance: AttrDict) -> AttrDict:
techs_incl_inheritance[tech].get("base_tech", None)
== "transmission"
):
self._raise_error(
self._raise_warning(
"Cannot define transmission technology data over the `nodes` dimension"
Copy link
Contributor Author

@jnnr jnnr Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we change the message to something like this?
"Trying to define transmission technology data over the nodes dimension. Be sure that you know what you are doing."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want a more descriptive message, stating the possible error that this might create.

@brynpickering
Copy link
Member

Thanks for the contribution @jnnr. My only concern is that this was in there for a reason. If you define transmission data at a node in YAML, what happens with this change? It would require some tests to check for what happens.

@jnnr
Copy link
Contributor Author

jnnr commented Feb 14, 2025

Thanks for your comments, @brynpickering and @irm-codebase. Apparently, we need to first better understand how link data is treated in preprocessing to understand the scenarios of failure we are opening up. I will take some time with to study this with @irm-codebase at the whiteboard and come back to this soon.

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.

3 participants