hmp.publish()#

publish(
ref,
*,
to,
format='dir',
with_=None,
public=False,
dry_run=False,
workspace=None,
)[source]#

Copy a sealed run, the summary or every sealed run of a project out of the tree.

A copy carries what a reader needs to read it, and with "inputs" to run it again. A project gives one folder per run and one for the summary, and the runs it left out with the reason; PublishedProject.to_dict() says it.

Parameters:
  • ref (Ref) – A run (its directory, its name in workspace, the run), "summary" in workspace, or the project (its directory, "." in workspace, the object).

  • to (PathLike) – Where the copy goes: a folder absent or empty, or the archive file.

  • format (Literal['dir', 'tar']) – "dir" or "tar".

  • with – What the copy carries beyond the run record: "results" and "inputs", both by default.

  • public (bool) – Warn when the project declares no licence; the copy is written either way.

  • dry_run (bool) – Run every check, say where the copy would land and write nothing.

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

Returns:

pathlib.Path or PublishedProject – The copy, or for a project every copy and what was left out.

Raises:
  • hydromodpy.core.exceptions.ExportError – An unsealed run, a destination that holds something, an input that cannot be carried.

  • FileNotFoundError – If "summary" is asked before the summary was written.

Return type:

Path | PublishedProject

Keyword arguments and command-line flags#

The twin command is hmp publish.

KeywordDefaultCommand-line flagAccepted by
to--toevery form
format'dir'--formatevery form
with_None--withevery form
publicFalse--publicevery form
dry_runFalse--dry-runevery form
workspaceNone-w --workspaceevery form

Flags of hmp publish with no keyword: --container, --package, --without, --verify. To get their effect from Python, build the configuration object with the values you want, or write them in the TOML file.