calliope-project / calliope

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

Clean parsers #506

Closed brynpickering closed 11 months ago

brynpickering commented 11 months ago

Refactoring of the expression and where string parsers to be easier to maintain in future.

Summary of changes in this pull request:

Reviewer checklist:

codecov[bot] commented 11 months ago

Codecov Report

Merging #506 (dfc74b6) into main (45436c9) will increase coverage by 0.29%. The diff coverage is 98.02%.

@@            Coverage Diff             @@
##             main     #506      +/-   ##
==========================================
+ Coverage   92.42%   92.72%   +0.29%     
==========================================
  Files          32       32              
  Lines        4120     4204      +84     
  Branches      969      965       -4     
==========================================
+ Hits         3808     3898      +90     
+ Misses        197      194       -3     
+ Partials      115      112       -3     
Files Coverage Δ
src/calliope/backend/backend_model.py 97.46% <100.00%> (+0.05%) :arrow_up:
src/calliope/backend/latex_backend_model.py 96.00% <100.00%> (-0.10%) :arrow_down:
src/calliope/backend/parsing.py 98.66% <100.00%> (+0.04%) :arrow_up:
src/calliope/backend/pyomo_backend_model.py 95.67% <100.00%> (+0.01%) :arrow_up:
src/calliope/core/model.py 93.71% <100.00%> (ø)
src/calliope/backend/helper_functions.py 97.81% <97.14%> (-0.39%) :arrow_down:
src/calliope/backend/expression_parser.py 98.00% <98.46%> (+2.56%) :arrow_up:
src/calliope/backend/where_parser.py 97.67% <96.61%> (-0.85%) :arrow_down: