OSeMOSYS / otoole

OSeMOSYS Tools for Energy
https://otoole.readthedocs.io
MIT License
23 stars 17 forks source link

[FEATURE]: Change checking of names to a flag option #169

Open trevorb1 opened 1 year ago

trevorb1 commented 1 year ago

Feature Request

With the release of v1.0.2, the updates in PR #157 have been pushed to the main branch. This PR checks the names of the parameters/sets in the config file against the data. If the data does not match perfectly, an OtooleNameMismatch error is raised.

I have heard back from multiple people now that the source of this error is not super clear, especially with legacy models which may have quite a few inconsistencies.

Is your feature related to a bug?

No response

Suggested Solution

My proposed solution is to add a new --ignore_names flag to the convert command. If the flag is passed then the checking of names is ignored, which would allow legacy models to stay up and running with otoole. Moreover, the error statement for the OtooleNameMismatch error can tell users to pass this flag to skip this error.

Example Usage

otoole convert csv datafile <data> <data.txt> <config.yaml> --ignore_names

Example Error Message

OtooleNameMismatchError: <Resource> -> Name not consistent between data and config file. To skip error pass --ignore_name flag

Or maybe the default logic should be reversed (ie. pass a --check_names flag instead), but in any case, once the logic is added that can be updated quickly

Additional Info

No response