27. Skip to content

27. API reference

This page links to the Python API modules and helps you navigate the reference. For workflows, start with Quickstart.

27.1 What it is for

This section documents the public Python API across ModSSC bricks. Each page includes a short overview, runnable examples, and mkdocstrings output. The reference targets stable package-level imports, while internal implementation packages are described separately in the Architecture page. [1]

27.2 Examples

Load a dataset and inspect its spec:

from modssc.data_loader import load_dataset, dataset_info

ds = load_dataset("toy", download=True)
print(dataset_info("toy").as_dict())

Run a simple evaluation:

import numpy as np
from modssc.evaluation import evaluate

print(evaluate(np.array([0, 1]), np.array([0, 1]), ["accuracy"]))

These APIs are exported from the package-level bricks under src/modssc/. Some bricks delegate orchestration to internal services/, helpers/, or bundle_factories/ subpackages, but those internal directories are not treated as the primary public surface. [1][2][3]

27.3 Modules

27.4 Structure notes

  • Package pages such as modssc.preprocess and modssc.sampling document the public facade imported by user code.
  • Internal support packages such as services/, helpers/, bundle_factories/, adapters/, and backend-specific implementation packages are intentionally treated as implementation details.
  • Runtime support utilities now live under modssc.runtime, not at the package root.
  • Cache resolution helpers live under modssc.cache, and shared optional-dependency helpers live under modssc.dependencies.

For the current repository layout, see Architecture.

Sources
  1. src/modssc/
  2. src/modssc/data_loader/
  3. src/modssc/evaluation/