Skip to content

Error when loading scenario files from scenairolink in AB3 #1689

@OliverLyon

Description

@OliverLyon

What do you want to report?

I tried to load the superstructure file produced from scenariolink in AB2 to the scenarios in AB3. The loading failed and output the following error. And interestingly, I tried to load the superstructure file I created a year ago but this worked. It just does not work for the new superstructures created.

Relevant errors

11:37:25 | DEBUG    | separator == ','
11:37:25 | INFO     | Loading Scenario file. This may take a while for large files
11:37:30 | INFO     | <function SuperstructureManager.fill_empty_process_keys_in_exchanges at 0x0000024B38F14720> -- 0.02207636833190918
11:37:31 | INFO     | <function SuperstructureManager.verify_scenario_process_keys at 0x0000024B38F14860> -- 0.7357823848724365
11:37:31 | INFO     | <function SuperstructureManager.check_duplicates at 0x0000024B38F14AE0> -- 0.13503122329711914
11:37:32 | INFO     | <function SuperstructureManager.check_scenario_exchange_values at 0x0000024B38F149A0> -- 0.04606366157531738
11:37:34 | INFO     | <function SuperstructureManager.merge_flows_to_self at 0x0000024B38F14400> -- 1.9059808254241943
11:37:42 | DEBUG    | separator == ','
11:37:42 | INFO     | Loading Scenario file. This may take a while for large files
Traceback (most recent call last):
  File "C:\Users\zhiliang\.conda\envs\ab3\Lib\site-packages\activity_browser\app\pages\calculation_setup\scenario_section.py", line 314, in load_action
    df = ss.ABCSVImporter.read_file(path, separator=separator)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\.conda\envs\ab3\Lib\site-packages\activity_browser\bwutils\superstructure\file_imports.py", line 223, in read_file
    df = pd.read_csv(
         ^^^^^^^^^^^^
  File "C:\Users\.conda\envs\ab3\Lib\site-packages\pandas\io\parsers\readers.py", line 1026, in read_csv
    return _read(filepath_or_buffer, kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\.conda\envs\ab3\Lib\site-packages\pandas\io\parsers\readers.py", line 626, in _read
    return parser.read(nrows)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\.conda\envs\ab3\Lib\site-packages\pandas\io\parsers\readers.py", line 1923, in read
    ) = self._engine.read(  # type: ignore[attr-defined]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\.conda\envs\ab3\Lib\site-packages\pandas\io\parsers\c_parser_wrapper.py", line 234, in read
    chunks = self._reader.read_low_memory(nrows)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pandas/_libs/parsers.pyx", line 838, in pandas._libs.parsers.TextReader.read_low_memory
  File "pandas/_libs/parsers.pyx", line 921, in pandas._libs.parsers.TextReader._read_rows
  File "pandas/_libs/parsers.pyx", line 1045, in pandas._libs.parsers.TextReader._convert_column_data
  File "pandas/_libs/parsers.pyx", line 2116, in pandas._libs.parsers._apply_converter
  File "C:\Users\.conda\envs\ab3\Lib\ast.py", line 66, in literal_eval
    node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\.conda\envs\ab3\Lib\ast.py", line 52, in parse
    return compile(source, filename, mode, flags,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<unknown>", line 0

SyntaxError: invalid syntax

Version

3.0.0b202605072131

Installation method

Anaconda (conda)

Operating system

Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    betaIssues related to the Activity Browser 3 Beta

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions