-
Notifications
You must be signed in to change notification settings - Fork 94
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
Conversation
There was a problem hiding this 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) }} |
There was a problem hiding this comment.
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
@FLomb thanks for checking. You can see the rendered documentation by clicking on the RTD build "details" in the checks: |
There was a problem hiding this 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.
There was a problem hiding this 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.
Yep, agreed that per-param broadcasting config is a nice-to-have @irm-codebase - it can be added to the longer-term roadmap. |
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.Reviewer checklist