Skip to content

simulo.save_output

Register metadata for a file produced while this job is running.

This validates the name, path, and kind, then records them in the running job. Returning successfully makes eligible registrations available to the worker for upload; a file becomes available through simulo outputs only after the upload is persisted. A cancelled, timed-out, crashed, or otherwise failed run does not reach the successful registry drain, and a refused or unsuccessful upload can also leave a registration undelivered. Use a named simulo.Volume instead when another job needs shared durable files.

Args:

  • name — The registration’s logical filename. It must be one safe filename, never a path: separators, control characters, dots-only tokens, empty values, and over-length names are rejected with ValueError.
  • path — Filesystem path of the produced file. str, bytes, or any os.PathLike (a pathlib.Path works); bytes-ish values are os.fsdecode-d, so a real non-UTF-8 filename registers fine. Validated for usability: type, length, non-empty, and no NUL.
  • kind — What the output is — an OutputKind or its wire string (e.g. "report", "dataset"). Defaults to FILE, the kind for a general produced file.

Returns:

True when the registration was kept; False when it was dropped because the run already registered 1000 files. Register final output, not a new scratch file on every simulation step.

Raises:

  • ValueErrorname is not a safe single filename, path is not usable as a path, or kind is not a known output kind — all surfaced at the call site before anything is registered.
  • ModuleNotFoundError — The job runtime is missing a required dependency.
  • RuntimeError — Called outside a supported job execution context.
simulo.save_output(
name: str,
path: Union[str, bytes, 'os.PathLike[str]', 'os.PathLike[bytes]'],
kind: Union[OutputKind, str] = OutputKind.FILE,
) -> bool