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

[BUG] Default `minimum_service` model produces utilisation factors < minimums #362

Closed alexdewar closed 3 months ago

alexdewar commented 3 months ago

I noticed this while working on #328. It may be a bug introduced by my changes (though I don't think so), but I'm opening this issue so I don't forget about it.

The error message I get when running the minimum_service model (using code from #328) is:

Exception has occurred: ValueError
Utilization factors must all be greater than or equal to
                          their corresponding minimum service factors. Please check
                         /tmp/tmph_o7bg4t/model/technodata/industry/Technodata.csv.
  File "/home/alex/code/MUSE_OS/src/muse/readers/csv.py", line 961, in _check_utilization_not_below_minimum
    raise ValueError(f"""Utilization factors must all be greater than or equal to
  File "/home/alex/code/MUSE_OS/src/muse/readers/csv.py", line 937, in check_utilization_and_minimum_service_factors
    _check_utilization_not_below_minimum(data, filename)
  File "/home/alex/code/MUSE_OS/src/muse/readers/csv.py", line 103, in read_technodictionary
    check_utilization_and_minimum_service_factors(data, filename)
  File "/home/alex/code/MUSE_OS/src/muse/readers/csv.py", line 348, in read_technologies
    result = read_technodictionary(tpath)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/code/MUSE_OS/src/muse/readers/toml.py", line 894, in read_technodata
    technologies = read_technologies(
                   ^^^^^^^^^^^^^^^^^^
  File "/home/alex/code/MUSE_OS/src/muse/sectors/sector.py", line 41, in factory
    technologies = read_technodata(settings, name, settings.time_framework)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/code/MUSE_OS/src/muse/mca.py", line 73, in factory
    sectors.append(SECTORS_REGISTERED[kind](sector, settings))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/code/MUSE_OS/src/muse/examples.py", line 65, in model
    return MCA.factory(settings)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/code/MUSE_OS/src/muse/__main__.py", line 52, in muse_main
    examples.model(model).run()
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/code/MUSE_OS/src/muse/__main__.py", line 61, in run
    muse_main(args.settings, args.model, args.copy)
  File "/home/alex/code/MUSE_OS/src/muse/__main__.py", line 65, in <module>
    run()
ValueError: Utilization factors must all be greater than or equal to
                          their corresponding minimum service factors. Please check
                         /tmp/tmph_o7bg4t/model/technodata/industry/Technodata.csv.