RavenPy icon indicating copy to clipboard operation
RavenPy copied to clipboard

'overwrite=False' does not work in Emulator.run()

Open RondeauG opened this issue 8 months ago • 0 comments

Setup Information

  • ravenpy version: 18.2

Description

No response

Steps To Reproduce

In ravenpy.ravenpy.run(), we have: https://github.com/CSHS-CWRA/RavenPy/blob/4652e4130b843a9baaf7437994c8a7488ea5cea1/src/ravenpy/ravenpy.py#L294-L307

Meaning that if overwrite=False, we don't delete the output folder, but we don't prevent Raven from overwriting the files.

Solution:

    if outputdir.exists():
        if overwrite:
            shutil.rmtree(str(outputdir))
        else:
            raise FileExistsError(...

Additional context

No response

Contribution

  • [x] I would be willing/able to open a Pull Request to address this bug.

RondeauG avatar May 15 '25 21:05 RondeauG