Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scenario loading bugfix + Better error message on missing keys #743

Merged

Conversation

marc-vdm
Copy link
Member

@marc-vdm marc-vdm commented Mar 7, 2022

PR includes:

  1. Fix for Scenario excel files locked by AB #721
  2. Implementation of CSV support for Scenario files (requested in Use CSV or TXT for Scenario Difference files #693):
  3. Minor improvement to missing keys error Listing exchange keys not found instead of erroring in SDF #746)
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:
image
Users get tooltip with CSV separator information:
image
When choosing Excel, user gets the original excel import dialog:
image
When choosing CSV, user gets a new dialog:
image
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.

…A-ActivityBrowser#693).

Comment rows are not possible in CSV
Dialog first asks user which scenario file type to load.
For CSV files, any separator excluding spaces works, AB identifies separator on its own.
@marc-vdm marc-vdm requested a review from bsteubing March 7, 2022 14:18
@coveralls
Copy link

coveralls commented Mar 7, 2022

Coverage Status

Coverage increased (+0.1%) to 54.398% when pulling 92ff6e9 on marc-vdm:better_SS/scenario_loading into be1113a on LCA-ActivityBrowser:master.

@marc-vdm

This comment was marked as outdated.

@marc-vdm marc-vdm marked this pull request as draft March 23, 2022 10:07
@marc-vdm marc-vdm changed the title Better ss/scenario loading Better ss/scenario loading & error messages Mar 31, 2022
@marc-vdm marc-vdm changed the title Better ss/scenario loading & error messages Scenario loading bugfix + Better error message on missing keys Apr 13, 2022
@marc-vdm marc-vdm added bug and removed change labels Apr 13, 2022
@marc-vdm marc-vdm marked this pull request as ready for review April 13, 2022 07:55
@marc-vdm marc-vdm merged commit 50f8564 into LCA-ActivityBrowser:master Apr 13, 2022
@marc-vdm marc-vdm mentioned this pull request Jul 6, 2022
@marc-vdm marc-vdm deleted the better_SS/scenario_loading branch May 14, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants