Skip to content
Projects

scope_profiler.h5schema

Versioning and compatibility helpers for scope-profiler HDF5 files.

Attributes

NameDescription
CURRENT_SCHEMA_VERSIONNo description.
SCHEMA_ATTRIBUTENo description.

Classes

NameDescription
HDF5SchemaErrorRaised when a profiling file has an invalid or unsupported schema.

Functions

NameDescription
migrate_schemaNormalize a supported file schema for the reader.
read_schema_versionReturn and validate the schema version stored on an HDF5 file.

CURRENT_SCHEMA_VERSIONattributemodule attribute#

CURRENT_SCHEMA_VERSION = 3

SCHEMA_ATTRIBUTEattributemodule attribute#

SCHEMA_ATTRIBUTE = 'scope_profiler_schema'

HDF5SchemaErrorclass#

class HDF5SchemaError(ValueError)

Bases: ValueError

Raised when a profiling file has an invalid or unsupported schema.

migrate_schemafunction#

def migrate_schema(h5file, version: int) -> int

Normalize a supported file schema for the reader.

This is intentionally a separate dispatch point even while version 1 is the only schema. Future readers can add transformations for older layouts here without spreading version checks through the HDF5 parser. Migration is read-only: the input file is never modified.

read_schema_versionfunction#

def read_schema_version(h5file) -> int

Return and validate the schema version stored on an HDF5 file.

Files written before schema versioning was introduced have no attribute; they are the original layout and are therefore treated as version 1.