Scenario loading bugfix + Better error message on missing keys #743
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.
PR includes:
Implementation of CSV support for Scenario files (requested in Use CSV or TXT for Scenario Difference files #693):Outdated fix for #693
Was removed from this PR as it's not needed anymore.
When pressing
load
. AB asks what file type to open:Users get tooltip with CSV separator information:
When choosing Excel, user gets the original excel import dialog:
When choosing CSV, user gets a new dialog:
Rest of the file import is handled the same way by AB
Few notes on importer:
The CSV importer identifies the file separator of any arbitrary length automatically, as long as it is not a (set of) spaces. Making it an Anything-that-is-not-a-space Separated Values importer rather than a Comma Separated Values importer.
If ',' is used in naming (like
market for electricity, high voltage
), the ',' cannot be used as separator. In this case another separator (e.g. ';') would be required.Exporting excel files as CSV makes the separator automatically a ';' when ',' are present in the file.
I'd thus recommend using ';' as separators, using '::' is also an option, as this is something more unlikely to occur in someone's scenario files.