Skip to content

Allow node params on links#736

Open
jnnr wants to merge 2 commits into
calliope-project:mainfrom
jnnr:feature/allow-node-params-on-links
Open

Allow node params on links#736
jnnr wants to merge 2 commits into
calliope-project:mainfrom
jnnr:feature/allow-node-params-on-links

Conversation

@jnnr
Copy link
Copy Markdown
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

):
self._raise_error(
self._raise_warning(
"Cannot define transmission technology data over the `nodes` dimension"
Copy link
Copy Markdown
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
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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.

@brynpickering
Copy link
Copy Markdown
Member

Any progress on identifying the link @jnnr ?

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