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

bug: User_dict entries not read into parser configs #96

Closed
ktehranchi opened this issue Dec 11, 2024 · 1 comment
Closed

bug: User_dict entries not read into parser configs #96

ktehranchi opened this issue Dec 11, 2024 · 1 comment

Comments

@ktehranchi
Copy link
Collaborator

ktehranchi commented Dec 11, 2024

Describe the bug
Recent changes made (compared to branch kt/fix_scenario_filtering) have caused the dictionaries from the user_dict.yaml to not be read into the parser config. This causes the plexos parser to fail with error:

r2x run -i NVE_7_19_24/ --input-model plexos --output-model sienna --user-dict user_dict_nve_july.yaml --year=2030 --weather-year=2030 -o output_test2  --flags plexos-csv=1
Traceback (most recent call last):
  File "/Users/kamrantehranchi/miniforge3/envs/r2x/bin/r2x", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/kamrantehranchi/Local_Documents/R2X/src/r2x/cli.py", line 42, in cli
    cli_commands(cli_args, user_dict)
  File "/Users/kamrantehranchi/Local_Documents/R2X/src/r2x/cli.py", line 63, in cli_commands
    run(cli_args, user_dict=user_dict)
  File "/Users/kamrantehranchi/Local_Documents/R2X/src/r2x/runner.py", line 161, in run
    run_single_scenario(scenario)
  File "/Users/kamrantehranchi/Local_Documents/R2X/src/r2x/runner.py", line 114, in run_single_scenario
    system, parser = run_parser(scenario, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kamrantehranchi/Local_Documents/R2X/src/r2x/runner.py", line 59, in run_parser
    parser = get_parser_data(config, parser_class, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kamrantehranchi/Local_Documents/R2X/src/r2x/parser/handler.py", line 278, in get_parser_data
    parser = parser_class(config=config, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kamrantehranchi/Local_Documents/R2X/src/r2x/parser/plexos.py", line 175, in __init__
    raise ParserError(msg)
r2x.exceptions.ParserError: At least one of fuel_map, or device_map, or device_match_string, or category_map is required to initialize PlexosParser

pdb'ing into the config shows that the plexos_fuel_map and other user dict specifications are not being read into self.config.defaults

Not sure if if this is a change to the CLI/user_dict specifications, but I couldn't find a change in the code which would indicate this.

To Reproduce
See r2x command above. The same command works on my kt/fix_scenario_filtering branch. (minus the new "run" command)

Environement (please complete the following information):

  • OS: Mac
  • R2X version: main
@pesap
Copy link
Collaborator

pesap commented Jan 17, 2025

This should be fixed in the latest version. Let me know if still appears and we can re-open

@pesap pesap closed this as completed Jan 17, 2025
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

No branches or pull requests

2 participants