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

Update top level config params #497

Merged
merged 28 commits into from
Oct 26, 2023
Merged

Conversation

brynpickering
Copy link
Member

@brynpickering brynpickering commented Oct 24, 2023

Fixes #496 with new parameter names and no equals or scale.

Fixes issue #452

EDIT: is automatically the case Possible TODO: allow init kwargs to be passed to the built-in example models on their initialisation (e.g., calliope.examples.national_scale(override_dict={"config.init.subset_time": ...}) -> calliope.examples.national_scale(subset_time=...))

TODO: add top-level parameter tests.

Summary of changes in this pull request:

  • run and model config split into init/build/solve config keys with a flat dict layout in each.
  • parameters moved out of config into a top-level parameters key with a syntax discussed in Separate top-level config and parameters  #452 and in a number of discussions.

Reviewer checklist:

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

@brynpickering brynpickering mentioned this pull request Oct 24, 2023
4 tasks
Base automatically changed from update-remove-equals-and-scale to main October 24, 2023 15:52
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Merging #497 (b9d1e34) into main (c53bfa7) will increase coverage by 0.15%.
The diff coverage is 93.77%.

@@            Coverage Diff             @@
##             main     #497      +/-   ##
==========================================
+ Coverage   92.20%   92.36%   +0.15%     
==========================================
  Files          32       32              
  Lines        4016     4045      +29     
  Branches      957      956       -1     
==========================================
+ Hits         3703     3736      +33     
+ Misses        198      196       -2     
+ Partials      115      113       -2     
Files Coverage Δ
src/calliope/backend/backend_model.py 97.40% <100.00%> (+2.11%) ⬆️
src/calliope/backend/helper_functions.py 99.37% <100.00%> (+0.01%) ⬆️
src/calliope/backend/pyomo_backend_model.py 95.66% <100.00%> (ø)
src/calliope/backend/where_parser.py 98.52% <100.00%> (-0.04%) ⬇️
src/calliope/core/attrdict.py 99.50% <100.00%> (ø)
src/calliope/core/util/tools.py 91.89% <100.00%> (+0.11%) ⬆️
src/calliope/examples.py 100.00% <100.00%> (ø)
src/calliope/postprocess/results.py 90.32% <100.00%> (ø)
src/calliope/preprocess/model_data.py 99.11% <100.00%> (+0.17%) ⬆️
src/calliope/preprocess/time.py 72.85% <100.00%> (-3.20%) ⬇️
... and 6 more

... and 1 file with indirect coverage changes

doc/helpers/generate_math.py Outdated Show resolved Hide resolved
doc/user/building.rst Outdated Show resolved Hide resolved
src/calliope/backend/latex_backend_model.py Show resolved Hide resolved
@brynpickering brynpickering merged commit a20cd52 into main Oct 26, 2023
9 checks passed
@brynpickering brynpickering deleted the update-top-level-config-params branch October 26, 2023 07:56
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