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

DEFINE inside workflow files are problematic #10193

Open
berland opened this issue Mar 3, 2025 · 0 comments
Open

DEFINE inside workflow files are problematic #10193

berland opened this issue Mar 3, 2025 · 0 comments
Labels

Comments

@berland
Copy link
Contributor

berland commented Mar 3, 2025

If you have a file wflow containing:

DEFINE <FOO> defined_in_workflow

and LOAD_WORKFLOW wflow in your config file, then there will be no errors, but it will not be substituted in e.g.:

RUNPATH poly_out/realization-<FOO>-<IENS>/iter-<ITER>

If you also in your config file do

DEFINE <FOO> first_foo
then Ert will crash with

2025-03-03 15:56:50,096 - ert.__main__ - MainThread - ERROR - ERT crashed unexpectedly with "'tuple' object does not support item assignment"
Traceback (most recent call last):
  File "/data/projects/ert/src/ert/__main__.py", line 610, in main
    args.func(args, context.plugin_manager)
  File "/data/projects/ert/src/ert/cli/main.py", line 43, in run_cli
    ert_config = ErtConfig.with_plugins().from_file(args.config)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/projects/ert/src/ert/config/ert_config.py", line 659, in from_file
    return cls.from_dict(user_config_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/projects/ert/src/ert/config/ert_config.py", line 742, in from_dict
    workflow_jobs, workflows, hooked_workflows = workflows_from_dict(
                                                 ^^^^^^^^^^^^^^^^^^^^
  File "/data/projects/ert/src/ert/config/ert_config.py", line 348, in workflows_from_dict
    workflow = Workflow.from_file(
               ^^^^^^^^^^^^^^^^^^^
  File "/data/projects/ert/src/ert/config/workflow.py", line 93, in from_file
    cmd_list = cls._parse_command_list(
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/projects/ert/src/ert/config/workflow.py", line 38, in _parse_command_list
    config_dict = parse(src_file, schema, pre_defines=context)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/projects/ert/src/ert/config/parsing/lark_parser.py", line 497, in parse
    return _transform_tree(_parse_file(file), file, schema, pre_defines)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/projects/ert/src/ert/config/parsing/lark_parser.py", line 535, in _transform_tree
    return _tree_to_dict(
           ^^^^^^^^^^^^^^
  File "/data/projects/ert/src/ert/config/parsing/lark_parser.py", line 208, in _tree_to_dict
    existing_define[1:] = define_args
    ~~~~~~~~~~~~~~~^^^^
TypeError: 'tuple' object does not support item assignment
@berland berland added the bug label Mar 3, 2025
@berland berland moved this to Todo in SCOUT Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

1 participant