scope_profiler.h5schema
Versioning and compatibility helpers for scope-profiler HDF5 files.
Attributes
| Name | Description |
|---|---|
CURRENT_SCHEMA_VERSION | No description. |
SCHEMA_ATTRIBUTE | No description. |
Classes
| Name | Description |
|---|---|
HDF5SchemaError | Raised when a profiling file has an invalid or unsupported schema. |
Functions
| Name | Description |
|---|---|
migrate_schema | Normalize a supported file schema for the reader. |
read_schema_version | Return and validate the schema version stored on an HDF5 file. |
CURRENT_SCHEMA_VERSIONattributemodule attribute#
CURRENT_SCHEMA_VERSION = 3SCHEMA_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) -> intNormalize 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) -> intReturn 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.