calliope-project / calliope

A multi-scale energy systems modelling framework
https://www.callio.pe
Apache License 2.0
287 stars 93 forks source link

Fix references between built backend components #549

Closed brynpickering closed 8 months ago

brynpickering commented 8 months ago

Fixes issue found while implementing gurobi backend related to how updates to parameters filter through the rest of the backend model. It now goes into variables and updates those if needs and it then implements the updates in order (parameters->variables->exprs->constrs->objective)

Reviewer checklist:

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (52bb659) 95.76% compared to head (0c5ee1a) 95.76%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #549 +/- ## ======================================= Coverage 95.76% 95.76% ======================================= Files 24 24 Lines 3562 3566 +4 Branches 775 711 -64 ======================================= + Hits 3411 3415 +4 Misses 86 86 Partials 65 65 ``` | [Files](https://app.codecov.io/gh/calliope-project/calliope/pull/549?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=calliope-project) | Coverage Δ | | |---|---|---| | [src/calliope/backend/backend\_model.py](https://app.codecov.io/gh/calliope-project/calliope/pull/549?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=calliope-project#diff-c3JjL2NhbGxpb3BlL2JhY2tlbmQvYmFja2VuZF9tb2RlbC5weQ==) | `97.87% <100.00%> (+0.02%)` | :arrow_up: | | [src/calliope/backend/latex\_backend\_model.py](https://app.codecov.io/gh/calliope-project/calliope/pull/549?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=calliope-project#diff-c3JjL2NhbGxpb3BlL2JhY2tlbmQvbGF0ZXhfYmFja2VuZF9tb2RlbC5weQ==) | `96.24% <100.00%> (ø)` | | | [src/calliope/backend/pyomo\_backend\_model.py](https://app.codecov.io/gh/calliope-project/calliope/pull/549?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=calliope-project#diff-c3JjL2NhbGxpb3BlL2JhY2tlbmQvcHlvbW9fYmFja2VuZF9tb2RlbC5weQ==) | `94.96% <100.00%> (+0.01%)` | :arrow_up: |