Skip to content

Add a flag to model.save_to_h5 to prevent overwriting #64

@allevitan

Description

@allevitan

Sometimes by accident we've found issues with folks overwriting files from previously saved reconstructions during beamtimes when scripts are shared.

I think it would be nice to change the default behavior of model.save_to_h5 to avoid overwriting past work.

I propose adding a safety_mode=("overwrite"/"increment"/"prompt") flag to the function, which would by default be "increment".

False or "False", just overwrite, but print a warning
True or "True", add an increment to the saved filename
"prompt" - ask for user input as to which behavior to use!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions