OSeMOSYS / otoole

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

Extra column in CSV file, but not in config fails to raise error #159

Closed trevorb1 closed 1 year ago

trevorb1 commented 1 year ago

In this PR, I address the issue described in issue #156. The logic to fix this issue includes:

As mentioned in the comment in issue #156, I decided to move up the checking of header names and dtypes to the base ReadStrategy class. While this means there is an efficiency hit (since we read in all data then check the headers/dtypes, rather checking one by one as we read in the data), all current and future read strategies can now use the ReadStrategy._check_index( .. ) method! So I thought this trade off seemed okay.

If you have any comments @willu47, please just let me know! Else, I will go ahead a merge in :)