Skip to content

upgrade_to_latest() doesn't take into account -o flag on CLI #815

Description

@deltamarnix

HydroMT-Wflow version checks

  • I have checked that this issue has not already been reported.
  • I have checked that this bug exists on the latest version of HydroMT-Wflow.

Reproducible Example

On branch fix/example-errors, go to upgrade_to_wflow_v1.ipynb and add "-o", "./data/wflow_upgrade/sbm/v1" to the arguments in cell 2. Then try to run the cell.

Current behaviour

You will get an error.

Traceback (most recent call last):
  File "c:\ProgramData\DevDrive\Repos\hydromt_wflow\.pixi\envs\default\Lib\site-packages\hydromt\log.py", line 179, in to_file
    yield
  File "c:\ProgramData\DevDrive\Repos\hydromt_wflow\.pixi\envs\default\Lib\site-packages\hydromt\model\model.py", line 387, in update
    _validate_steps(self, steps)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^
...
    raise TypeError(
        f"Validation of step {i + 1} ({step}) failed because of the following error: {e}"
    )
TypeError: Validation of step 1 (upgrade_to_latest) failed because of the following error: missing a required argument: 'output_dir'

Desired behaviour

It seems that the output_dir can be specified in the yml as an option for that specific argument, but I have already given a -o in the command line, so that should be taken as the output directory if it's empty?

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds refinementissue still needs refinement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions