{
  "$schema": "https://ambiqai.github.io/helia-ui/schema/reference-model-1.json",
  "generatedFrom": {
    "sourceCommit": "f341fb11f7f5d77a4974ba8273c4cd55d67c21f0",
    "tool": "pyref",
    "version": "1.7.3"
  },
  "language": "python",
  "modules": [
    {
      "description": "Reproduce an export from its record (``helia-edge export reproduce``) and create one from a spec file.",
      "name": "reproduce",
      "path": "helia_edge.export.reproduce",
      "submodules": [],
      "summary": "Reproduce an export from its record (helia-edge export reproduce) and create one from a spec file.",
      "symbols": [
        {
          "description": "`dataclass`\n\nWhat ``reproduce`` found.",
          "examples": [],
          "id": "helia_edge.export.reproduce.Reproduction",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "``same`` (same artifact, I/O and golden), ``different``, ``environment`` (the environment\ndiffers and the comparison was not made) or ``input`` (a file is missing or does not match the\nrecord).",
              "examples": [],
              "id": "helia_edge.export.reproduce.Reproduction.status",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "status",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "status: Literal['same', 'different', 'environment', 'input']",
              "source": {
                "line": 27,
                "path": "helia_edge/export/reproduce.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L27"
              },
              "summary": ""
            },
            {
              "description": "What differs, or which input is missing or does not match, one line each.",
              "examples": [],
              "id": "helia_edge.export.reproduce.Reproduction.differences",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "differences",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "differences: tuple[str, ...] = ()",
              "source": {
                "line": 28,
                "path": "helia_edge/export/reproduce.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L28"
              },
              "summary": ""
            },
            {
              "description": "How the environment differs from the record's, or why it cannot export, one line each.",
              "examples": [],
              "id": "helia_edge.export.reproduce.Reproduction.environment",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "environment",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "environment: tuple[str, ...] = ()",
              "source": {
                "line": 29,
                "path": "helia_edge/export/reproduce.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L29"
              },
              "summary": ""
            },
            {
              "description": "What the record names but was not compared, one line each.",
              "examples": [],
              "id": "helia_edge.export.reproduce.Reproduction.skipped",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "skipped",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "skipped: tuple[str, ...] = ()",
              "source": {
                "line": 30,
                "path": "helia_edge/export/reproduce.py",
                "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L30"
              },
              "summary": ""
            }
          ],
          "name": "Reproduction",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "Reproduction(\n    status: Literal['same', 'different', 'environment', 'input'],\n    differences: tuple[str, ...] = (),\n    environment: tuple[str, ...] = (),\n    skipped: tuple[str, ...] = (),\n) -> None",
          "source": {
            "line": 14,
            "path": "helia_edge/export/reproduce.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L14"
          },
          "summary": "What reproduce found."
        },
        {
          "description": "sha256 of a file's bytes.",
          "examples": [],
          "id": "helia_edge.export.reproduce.file_sha256",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "file_sha256",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "file_sha256(path: Path | str) -> str",
          "source": {
            "line": 33,
            "path": "helia_edge/export/reproduce.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L33"
          },
          "summary": "sha256 of a file's bytes."
        },
        {
          "description": "A ``.npy`` array, memory-mapped, so that a header claiming more data than the file holds is refused\nrather than allocated.",
          "examples": [],
          "id": "helia_edge.export.reproduce.load_npy",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "load_npy",
          "params": [],
          "raises": [
            {
              "description": "If the file cannot be read as a ``.npy`` array.",
              "type": "ValueError"
            }
          ],
          "returns": [],
          "signature": "load_npy(path: Path | str) -> np.ndarray",
          "source": {
            "line": 42,
            "path": "helia_edge/export/reproduce.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L42"
          },
          "summary": "A .npy array, memory-mapped, so that a header claiming more data than the file holds is refused rather than allocated."
        },
        {
          "description": "A ``ModelSpec`` from a YAML (``.yaml``/``.yml``) or JSON file.",
          "examples": [],
          "id": "helia_edge.export.reproduce.load_spec",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "load_spec",
          "params": [],
          "raises": [
            {
              "description": "If the file is not valid YAML or JSON, or not a valid ``ModelSpec``.",
              "type": "ValueError"
            }
          ],
          "returns": [],
          "signature": "load_spec(path: Path | str)",
          "source": {
            "line": 59,
            "path": "helia_edge/export/reproduce.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L59"
          },
          "summary": "A ModelSpec from a YAML (.yaml/.yml) or JSON file."
        },
        {
          "description": "The weight mapping ``name`` of the spec's family (its params module's ``MAPPINGS``).",
          "examples": [],
          "id": "helia_edge.export.reproduce.family_mapping",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "family_mapping",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "family_mapping(spec, name: str)",
          "source": {
            "line": 79,
            "path": "helia_edge/export/reproduce.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L79"
          },
          "summary": "The weight mapping name of the spec's family (its params module's MAPPINGS)."
        },
        {
          "description": "How ``current`` differs from ``recorded``, in the versions that can change exported bytes.",
          "examples": [],
          "id": "helia_edge.export.reproduce.environment_differences",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "environment_differences",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "environment_differences(recorded: EnvironmentEntry, current: EnvironmentEntry) -> list[str]",
          "source": {
            "line": 87,
            "path": "helia_edge/export/reproduce.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L87"
          },
          "summary": "How current differs from recorded, in the versions that can change exported bytes."
        },
        {
          "description": "Why this process cannot export LiteRT, one line each; empty when it can.",
          "examples": [],
          "id": "helia_edge.export.reproduce.litert_unavailable",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "litert_unavailable",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "litert_unavailable() -> tuple[str, ...]",
          "source": {
            "line": 116,
            "path": "helia_edge/export/reproduce.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L116"
          },
          "summary": "Why this process cannot export LiteRT, one line each; empty when it can."
        },
        {
          "description": "Rebuild the model a record describes, export it again with the same settings and compare.",
          "examples": [],
          "id": "helia_edge.export.reproduce.reproduce",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "reproduce",
          "params": [
            {
              "description": "The ``record.json``.",
              "name": "record_path",
              "type": "Path | str"
            },
            {
              "description": "The ``.weights.h5`` file, or for imported weights the source file the mapping imports.",
              "name": "weights",
              "type": "Path | str"
            },
            {
              "default": "None",
              "description": "The calibration ``.npy``, when the record has calibration.",
              "name": "calibration",
              "type": "Path | str | None"
            },
            {
              "default": "None",
              "description": "The golden's input ``.npy``, to regenerate and compare the golden.",
              "name": "golden_inputs",
              "type": "Path | str | None"
            },
            {
              "default": "False",
              "description": "Compare even when the environment differs from the record's.",
              "name": "allow_env_mismatch",
              "type": "bool"
            }
          ],
          "raises": [],
          "returns": [
            {
              "description": "``same`` when the weights digest, the export settings, the artifact, the I/O, the golden",
              "name": "Reproduction",
              "type": "Reproduction"
            },
            {
              "description": "(with ``golden_inputs``) and the ``model.tflite`` and ``golden.npz`` beside the record (when present)",
              "type": "Reproduction"
            },
            {
              "description": "match. A failure of the export itself is raised.",
              "type": "Reproduction"
            }
          ],
          "signature": "reproduce(\n    record_path: Path | str,\n    weights: Path | str,\n    calibration: Path | str | None = None,\n    golden_inputs: Path | str | None = None,\n    allow_env_mismatch: bool = False,\n) -> Reproduction",
          "source": {
            "line": 141,
            "path": "helia_edge/export/reproduce.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L141"
          },
          "summary": "Rebuild the model a record describes, export it again with the same settings and compare."
        },
        {
          "description": "The record of weights imported through ``mapping`` from a file with ``sha256``.",
          "examples": [],
          "id": "helia_edge.export.reproduce.imported_source",
          "kind": "function",
          "language": "python",
          "members": [],
          "name": "imported_source",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "imported_source(mapping, sha256: str) -> WeightImport",
          "source": {
            "line": 241,
            "path": "helia_edge/export/reproduce.py",
            "url": "https://github.com/AmbiqAI/helia-edge/blob/f341fb11f7f5d77a4974ba8273c4cd55d67c21f0/helia_edge/export/reproduce.py#L241"
          },
          "summary": "The record of weights imported through mapping from a file with sha256."
        }
      ]
    }
  ],
  "name": "helia_edge"
}
