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

Overwritting existing models #524

Closed
2 tasks done
hboisgon opened this issue Sep 22, 2023 · 0 comments · Fixed by #534
Closed
2 tasks done

Overwritting existing models #524

hboisgon opened this issue Sep 22, 2023 · 0 comments · Fixed by #534
Assignees
Labels
Bug Something isn't working Model issues related to the Model class and its subclasses

Comments

@hboisgon
Copy link
Contributor

hboisgon commented Sep 22, 2023

HydroMT 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.

Reproducible Example

hydromt update wflow wflow_piave -o wflow_piave_update -i update.ini -d artifact_data -vv

hydromt update wflow wflow_piave -o wflow_piave_update -i update.ini -d artifact_data --fo -vv

ERROR: Model dir already exists and cannot be overwritten

Current behaviour

When updating a model in an already existing folder, the models cannot be overwritten even with the --force-overwrite option on.

Desired behaviour

Like we implemented for build, I think if the user specifies --fo / --force-overwrite in update, hydromt should be able to overwrite the existing model.

Additional context

Doing a check below if force_overwrite then set root with mode="w+" and else keep mode="w"

# read current model
if not self._write:
if model_out is None:
raise ValueError(
'"model_out" directory required when updating in "read-only" mode'
)
self.read()
self.set_root(model_out, mode="w")

@hboisgon hboisgon added Bug Something isn't working Needs refinement issue still needs refinement Model issues related to the Model class and its subclasses and removed Needs refinement issue still needs refinement labels Sep 22, 2023
hboisgon added a commit that referenced this issue Sep 29, 2023
@hboisgon hboisgon mentioned this issue Sep 29, 2023
5 tasks
@savente93 savente93 added the Blocked An issue that cannot be progressed right now label Oct 5, 2023
@savente93 savente93 removed the Blocked An issue that cannot be progressed right now label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Model issues related to the Model class and its subclasses
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants