-
Notifications
You must be signed in to change notification settings - Fork 93
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
tech/node groups to templates #655
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #655 +/- ##
==========================================
- Coverage 95.98% 95.97% -0.01%
==========================================
Files 26 26
Lines 3981 3980 -1
Branches 836 767 -69
==========================================
- Hits 3821 3820 -1
Misses 70 70
Partials 90 90
|
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.
I must say: I love this change. Very simple to understand, and will lead to users handling less terminology.
Bryn's idea to just merge everything into templates
is excellent.
docs/advanced/mode.md
Outdated
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.
The new name is excellent!
Very easy to follow what's happening now!
|
||
Args: | ||
dim_item_dict (AttrDict): | ||
Dictionary (possibly) containing `inherit`. If it doesn't contain `inherit`, the climbing stops here. | ||
Dictionary (possibly) containing `template`. If it doesn't contain `template`, the climbing stops here. |
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.
Small note: generally I think it's ok to omit long parameter explanations if they are in the docstring body above. Keeps docs lean and leads to less boilerplate fixing over time.
tests/common/test_model/model.yaml
Outdated
name: Transmission heat tech | ||
carrier_in: heat | ||
carrier_out: heat | ||
base_tech: transmission | ||
flow_cap_max: 5 | ||
|
||
init_nodes: | ||
techs.test_demand_elec: |
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.
The red mark above indicates that the document does not end in an empty line. Generally, it's good to do so to aid in machine readability.
I'll fix that in a PR soon through pre-commit CI
tests/test_preprocess_model_data.py
Outdated
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.
Nice-to-have: consider adding the small docstring to the modified tests, so that we know what they do in the future.
Feel free to skip.
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.
Excellent!
@sjpfenninger @irm-codebase one thing I missed is that you still end up with the two input variables in the xarray dataset: |
@brynpickering looking at the code, it seems they achieve very similar things, but I do not think they match I think you are right in just going for |
docs/creating/techs.md
Outdated
@@ -13,9 +13,10 @@ This establishes the basic characteristics in the optimisation model (decision v | |||
* `conversion`: Converts from one carrier to another. | |||
|
|||
??? info "Sharing configuration through inheritance" |
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.
??? info "Sharing configuration through inheritance" | |
??? info "Sharing configuration through inheritance from templates" |
I agree with @irm-codebase that we can stick to inheritance here which marks this as a separate (but related) variable. |
6a0705d
Fixes #600
I've merged
tech_
andnode_
intotemplates
as there's no real reason to split them. You can access the same template from techs or nodes but the chance that it causes issues is minimal. The benefit is fewer top-level keys.I've kept the reference to "inheriting" templates in the docs and the helper function. If there is a perference to purge all concept of inheritance, we could change it, but I don't have a good idea what to replace it with.
Summary of changes in this pull request
tech_groups
/node_groups
->templates
inherit
->template
Reviewer checklist