OCDocker.Workbench.IO module

Serialization helpers for OCDocker workbench specs and manifests.

OCDocker.Workbench.IO.model_to_data(model)[source]

Return a JSON-compatible dictionary for a workbench model.

Parameters:

model (WorkbenchModel) – Input value.

Returns:

Returned value.

Return type:

dict[str, Any]

OCDocker.Workbench.IO.read_data(path)[source]

Read a JSON or YAML mapping from disk.

Parameters:

path (str | Path) – Input value.

Returns:

Returned value.

Return type:

dict[str, Any]

OCDocker.Workbench.IO.read_result_manifest(path)[source]

Load and validate a result manifest from JSON or YAML.

Parameters:

path (str | Path) – Input value.

Returns:

Returned value.

Return type:

ResultManifest

OCDocker.Workbench.IO.read_run_manifest(path)[source]

Load and validate a run manifest from JSON or YAML.

Parameters:

path (str | Path) – Input value.

Returns:

Returned value.

Return type:

RunManifest

OCDocker.Workbench.IO.read_spec(path)[source]

Load and validate a workbench spec from JSON or YAML.

Parameters:

path (str | Path) – Input value.

Returns:

Returned value.

Return type:

WorkbenchSpec

OCDocker.Workbench.IO.write_model(path, model)[source]

Write a workbench model to JSON or YAML based on the file suffix.

Parameters:
  • path (str | Path) – Input value.

  • model (WorkbenchModel) – Input value.

Returns:

Returned value.

Return type:

Path