hmp.trash()#

trash(ref, *, workspace=None, restore=False, force=False)[source]#

Move a run or a session to trash/, or bring a trashed one back.

A trashed directory keeps its name taken until the trash is emptied. The index, when the project has one, is brought up to date.

Parameters:
  • ref (str | PathLike[str] | Run | Session | RunSet | Project) – What to move: a run or a session (a directory, a name in workspace, the object). With restore, a trashed entry as hmp catalog trash lists it, or the directory it came from.

  • workspace (str | PathLike[str] | None) – The project directory, or a folder inside it.

  • restore (bool) – Bring the trashed entry back where it came from.

  • force (bool) – Move a protected directory, or one a stale attempt holds.

Returns:

list of pathlib.Path – The directories moved, where they now are.

Raises:
  • hydromodpy.core.exceptions.WriteConflictError – If the directory is running, or protected without force.

  • hydromodpy.results.catalog.discovery.SimulationNotFoundError – If the reference names nothing.

Return type:

list[Path]