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

Add broadcast_param_data config option and default it to False. #715

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

brynpickering
Copy link
Member

Fixes #615

Summary of changes in this pull request

  • config.init.broadcast_param_data boolean option available as per suggestion from @irm-codebase. It defaults to False, so must be set knowingly by the user to True to allow for indexed parameter data broadcasting.
  • Updated example models to use CSV cost data (national scale) and to have a top-level interest rate (since we don't change it per technology in our example models).
  • Updated docs to include this info and reflect updates to example models.

Reviewer checklist

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

@brynpickering brynpickering marked this pull request as ready for review November 19, 2024 19:54
Copy link
Contributor

@FLomb FLomb left a comment

Choose a reason for hiding this comment

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

Thanks for this PR @brynpickering; it looks like a very good solution to issue #615, while it simultaneously enriches the documentation by providing an example of cost data loading from tabular files.

I couldn't check that the docs build properly (see specific comment), but the rest looks ready to approve. Before giving the green light, I would like to perform only a test with some of the models that led me to find the issue in the first place so that I can confirm this solution works in practice. I will do so later today.

In the Calliope national scale example model, we load both timeseries and cost data from file.
As an example, the data in the cost CSV file looks like this:

{{ read_csv(page.meta.costs.file, header=page.meta.costs.header, index_col=page.meta.costs.index_col) }}
Copy link
Contributor

Choose a reason for hiding this comment

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

If I look at the 'built' markdown file here on GitHub, the links to files and to the header do not work properly, but I assume this is because these files are built into documentation by Calliope in a different way than simple markdown visualisation. So perhaps someone else who knows how to build the docs locally can double-check that all is as expected

@brynpickering
Copy link
Member Author

@FLomb thanks for checking. You can see the rendered documentation by clicking on the RTD build "details" in the checks:

image

Copy link
Contributor

@FLomb FLomb left a comment

Choose a reason for hiding this comment

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

Ok, I have tested this on a practical case, and it works as expected; it also nicely warns me if I have a dimension mismatch when switching the broadcast to False.

Copy link
Contributor

@irm-codebase irm-codebase left a comment

Choose a reason for hiding this comment

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

Gave a glance at how the code is arranged for this change. Looks fine to me!

In the future we might want to turn this type of broadcasting individually per parameter, but let's keep things simple for now.

@brynpickering
Copy link
Member Author

Yep, agreed that per-param broadcasting config is a nice-to-have @irm-codebase - it can be added to the longer-term roadmap.

@brynpickering brynpickering merged commit dcd9699 into main Nov 20, 2024
8 checks passed
@brynpickering brynpickering deleted the add-broadcast-param-data branch November 20, 2024 16:26
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.

Unwanted spillover and overwriting across cost dimensions
3 participants