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

Enable use of transmission techs in custom math #505

Merged
merged 38 commits into from
Oct 30, 2023

Conversation

brynpickering
Copy link
Member

@brynpickering brynpickering commented Oct 26, 2023

Adds ability to reference transmission technologies by the tech name, which will grab the relevant tech:node_to concatenated techs.

Summary of changes in this pull request:

  • New expression helper function to get transmission techs, but also allow it to work in the defined where string helper function.
  • New custom math to showcase it in action, creating a net import share constraint.
  • Revoke option to use - in node names, replacing with _ (will need baking into a YAML schema in due course). With - there was a parsing issue raised if directly referencing the tech name in the where/expression string (- is not part of the allowed string characters).

Reviewer checklist:

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

src/calliope/backend/helper_functions.py Show resolved Hide resolved
doc/_static/custom_math/net_import_share.yaml Outdated Show resolved Hide resolved
doc/_static/custom_math/net_import_share.yaml Outdated Show resolved Hide resolved
doc/_static/custom_math/net_import_share.yaml Outdated Show resolved Hide resolved
doc/_static/custom_math/net_import_share.yaml Show resolved Hide resolved
doc/_static/custom_math/net_import_share.yaml Show resolved Hide resolved
Base automatically changed from feature-custom-math-examples to main October 30, 2023 09:28
@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Merging #505 (e9fc66c) into main (b1fc928) will increase coverage by 0.05%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #505      +/-   ##
==========================================
+ Coverage   92.36%   92.42%   +0.05%     
==========================================
  Files          32       32              
  Lines        4089     4120      +31     
  Branches      964      969       +5     
==========================================
+ Hits         3777     3808      +31     
  Misses        197      197              
  Partials      115      115              
Files Coverage Δ
src/calliope/backend/expression_parser.py 95.44% <100.00%> (+0.07%) ⬆️
src/calliope/backend/helper_functions.py 98.20% <100.00%> (+0.22%) ⬆️

@brynpickering brynpickering merged commit 45436c9 into main Oct 30, 2023
9 checks passed
@brynpickering brynpickering deleted the feature-tranmissions-in-custom-math branch October 30, 2023 10:53
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.

2 participants