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

Custom math examples #502

Merged
merged 31 commits into from
Oct 30, 2023
Merged

Custom math examples #502

merged 31 commits into from
Oct 30, 2023

Conversation

brynpickering
Copy link
Member

Fixes issue(s) #424

TODO: inject into the documentation somehow alongside YAML snippets to set up a model that can use them.

NOTE: none of the tests actually optimise the problem, I'm basing them working on the LP files looking right for the math I expect. When running alongside the base math, there's likely to be clashes between constraints that requires deactivating base math / updating where strings.

Summary of changes in this pull request:

  • Reimplemented group and sector-coupled Euro-Calliope custom constraints
  • Tests that validate against an LP file, each of which I've lovingly manually checked

Reviewer checklist:

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

Base automatically changed from update-definition-matrix to main October 26, 2023 09:19
@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #502 (5a14185) into main (34a38f7) will increase coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #502      +/-   ##
==========================================
+ Coverage   92.36%   92.38%   +0.01%     
==========================================
  Files          32       32              
  Lines        4089     4098       +9     
  Branches      964      966       +2     
==========================================
+ Hits         3777     3786       +9     
  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.00% <100.00%> (+0.03%) ⬆️

doc/_static/custom_math/annual_energy_balance.yaml Outdated Show resolved Hide resolved
doc/_static/custom_math/annual_energy_balance.yaml Outdated Show resolved Hide resolved
Positive values indicate carrier imports at a node, negative values for carrier exports.
foreach: [nodes, carriers, timesteps]
# change [fuel1, fuel2] to match the carriers you want to allow to be distributed within the system.
where: "allow_fuel_distribution"
Copy link
Member

Choose a reason for hiding this comment

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

lookup table?

src/calliope/math/base.yaml Show resolved Hide resolved
tests/common/lp_files/piecewise_efficiency_2.lp Outdated Show resolved Hide resolved
@brynpickering brynpickering merged commit 76883ed into main Oct 30, 2023
7 checks passed
@brynpickering brynpickering deleted the feature-custom-math-examples branch October 30, 2023 09:28
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