loqs.internal.serializable¶
Serializable definition.
Classes¶
DecodableVersionErrorDeferredRefIncorrectDecodableTypeErrorMisformedDecodableErrorResolvingDecodeCacheSerializable
Attributes¶
| Name | Type | Value | Doc |
|---|---|---|---|
IMPORT_LOCATION_CHANGES_BY_VERSION |
dict[int, dict[tuple[str, str], tuple[str, str] | None]] |
{1: {(' |
|
SERIALIZATION_VERSION |
2 |
Serialization versions. 0: First version. JSON encoding only, per-shot checkpointing only. 1: HDF5 encoding now available. Backwards compatible to version 0. 2: CastableTypes -> Like renames and several class removals/ relocations; see IMPORT_LOCATION_CHANGES_BY_VERSION. |
|
MIGRATE_LEGACY_FNS |
contextvars.ContextVar[bool] |
contextvars.ContextVar('migrate_legacy_fns', default=False) |
Whether decoding may run a known legacy-construction pattern found in an old Instruction's frozen source, rather than raising a clear error. Set for the duration of a Serializable.read/.load call, read once in Instruction._from_decoded_attrs. |
EncodableArrays |
TypeAlias |
|
|
EncodableIterables |
TypeAlias |
list | tuple | set |
|
EncodablePrimitives |
TypeAlias |
|
|
Encodable |
TypeAlias |
'Serializable | |
|
Encoded |
TypeAlias |
dict | h5py.Group |
|
EncodeFormats |
TypeAlias |
Literal['json', 'json.gz', 'hdf5', 'h5'] | None |
|
EncodeCache |
TypeAlias |
dict[int, list[tuple[int, int]]] | None |
|
DecodeCache |
TypeAlias |
dict[int, 'Serializable | DeferredRef'] | None |
|
T |
TypeVar |
TypeVar('T', bound='Serializable') |