Adds checks for input data and config file names #157
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, I have added logic to the base
ReadStrategy
class to check that input data names match the parameter and set names defined in the configuration file. If an inconsistency is found, anOtooleNameMismatchError
orAmplyError
is raised.The table below highlights the implemented logic:
The exception here is when reading in a MathProg data file and there are extra definitions in the configuration file. Since the configuration file is used to define what sets/parameters to look for in the datafile (see code snippet below), Im not sure the best way around this? @willu47 do you have any immediate thoughts on how to get around this issue? No worries if not though, and I can see if I can come up with something!
Below shows the issue of how we use the config file to read in MathProg data, so we can't easily check if all values are captured :(
https://github.com/trevorb1/otoole/blob/3ff92fe3668c106f6822978b6aae94cfab05ed9c/src/otoole/read_strategies.py#L287-L324
Closes #151