EnergySystemsModellingLab / MUSE_OS

Welcome to the MUSE-OS repository
https://muse-os.readthedocs.io/en/latest/
GNU General Public License v3.0
22 stars 9 forks source link

Enforce minimum service factor limits #325

Closed alexdewar closed 3 months ago

alexdewar commented 3 months ago

Description

I've fixed #320 by introducing a check in the minimum_service constraint function that all minimum service factors are >=0 and <= 1 and I've also amended the spurious tests accordingly.

The only thing is that I'm wondering whether this is a bit late to raise an error. Should the check be in some earlier parsing step (either in addition or instead)?

While I was reading through the docstring for muse.constraints I noticed some typos and fixed those while I was at it.

Fixes #320.

Type of change

Key checklist

Further checks

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.09%. Comparing base (89754e6) to head (c7a0101).

Files Patch % Lines
src/muse/constraints.py 33.33% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #325 +/- ## =========================================== - Coverage 71.11% 71.09% -0.02% =========================================== Files 44 44 Lines 5809 5812 +3 Branches 1147 1148 +1 =========================================== + Hits 4131 4132 +1 - Misses 1358 1359 +1 - Partials 320 321 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.