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

Enable customisation of constraints #354

Closed dalonsoa closed 3 months ago

dalonsoa commented 3 months ago

Description

Enables the customisation of constraints, which should be there but it was not. So far, constraints to be used were hardcoded and always the same, being the settings in relation to constraints passed in the TOML file ignored. This PR fixes that issue.

The settings file where the constraints sections include # Optional, defaults to the constraints below have been updated, if needed, to include the really default constraints that were being used so far.

Fixes #336

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s.

Key checklist

Further checks

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 71.24%. Comparing base (130c8f1) to head (73c734f).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #354 +/- ## =========================================== - Coverage 71.27% 71.24% -0.04% =========================================== Files 44 44 Lines 5870 5870 Branches 1158 1158 =========================================== - Hits 4184 4182 -2 - Misses 1365 1366 +1 - Partials 321 322 +1 ```

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

dalonsoa commented 3 months ago

The results are not affected because we are using the same constraints - the only thing this does is letting the user actually select which constrains are to be used, which was not possible before.

I've checked this works by using the debugger and seeing that, indeed, now changing the input constraints results in different constraints being called in the relevant places (and because I'm working in #355 which needs this, and it works), but I agree a test should be in place.

I'll add a test before merging.

dalonsoa commented 3 months ago

I've added a test to check that the input constraints settings are indeed passed to the agents factory, which was the only barrier, really.