LocalStorage#
Module: exa.core.local_storage
- class LocalStorage(path=None)#
Bases:
StorageInterfaceLocal, in-memory implementation of
StorageInterface.Only observation and observation set related methods are implemented; all other methods raise
NotImplementedError. State lives in memory by default; passpathto also persist it to a JSON file, which is loaded on construction (if it already exists) and transparently rewritten after every create/update operation.Methods
Create the set in memory, resolve its
dut_labelfrom constituents, and persist.Assign each definition a new sequential id and the current timestamp, then persist if configured.
Not implemented: LocalStorage has no concept of sequence metadata.
Build an instance from a dict produced by
serialize(); overridesSerializable.Set
end_timestampon the set in memory and persist; a no-op if already finalized.Not implemented: LocalStorage has no concept of calibration sets.
Not implemented: LocalStorage has no concept of calibration or quality metric sets.
Not implemented: LocalStorage has no concept of chip design records.
Not implemented: LocalStorage does not track which dut fields have been observed.
Not implemented: LocalStorage has no concept of calibration sets.
Look up the observation set by id in memory.
Look up the set's constituent observations from the in-memory observation store.
Not implemented: LocalStorage has no concept of runs.
Not implemented: LocalStorage has no concept of sequence results.
Filter, sort and limit the in-memory sets; see
_OBSERVATION_SET_MATCHERSfor lookups.Filter, sort and limit the in-memory observations; see
_OBSERVATION_MATCHERSfor lookups.Not implemented: LocalStorage has no concept of runs.
Not implemented: LocalStorage has no concept of sequence metadata.
Not implemented: LocalStorage has no concept of sequence results.
Serialize the current state to a dict; overrides
Serializable.Merge new observation ids into the set in memory, recompute
dut_label, and persist.Replace each observation in memory with a copy carrying the updated
invalidflag, then persist.- create_observations(observation_definitions)#
Assign each definition a new sequential id and the current timestamp, then persist if configured.
- Parameters:
observation_definitions (Sequence[ObservationDefinition])
- Return type:
- query_observations(**kwargs)#
Filter, sort and limit the in-memory observations; see
_OBSERVATION_MATCHERSfor lookups.- Parameters:
kwargs (Any)
- Return type:
- update_observations(observation_updates)#
Replace each observation in memory with a copy carrying the updated
invalidflag, then persist.- Parameters:
observation_updates (Sequence[ObservationUpdate])
- Return type:
- query_observation_sets(**kwargs)#
Filter, sort and limit the in-memory sets; see
_OBSERVATION_SET_MATCHERSfor lookups.- Parameters:
kwargs (Any)
- Return type:
- create_observation_set(observation_set_definition)#
Create the set in memory, resolve its
dut_labelfrom constituents, and persist.- Parameters:
observation_set_definition (ObservationSetDefinition)
- Return type:
- get_observation_set(observation_set_id)#
Look up the observation set by id in memory.
- Parameters:
- Return type:
- update_observation_set(observation_set_update)#
Merge new observation ids into the set in memory, recompute
dut_label, and persist.- Raises:
ConflictError – If the set is already finalized and new observation ids are given.
- Parameters:
observation_set_update (ObservationSetUpdate)
- Return type:
- finalize_observation_set(observation_set_id)#
Set
end_timestampon the set in memory and persist; a no-op if already finalized.
- get_observation_set_observations(observation_set_id)#
Look up the set’s constituent observations from the in-memory observation store.
- Parameters:
- Return type:
- get_calibration_set(calibration_set_id)#
Not implemented: LocalStorage has no concept of calibration sets.
- Parameters:
- Return type:
- get_dynamic_quantum_architecture(calibration_set_id)#
Not implemented: LocalStorage has no concept of calibration sets.
- Parameters:
- Return type:
- get_calibration_set_quality_metric_set(calibration_set_id)#
Not implemented: LocalStorage has no concept of calibration or quality metric sets.
- Parameters:
- Return type:
- get_chip_design_record(dut_label)#
Not implemented: LocalStorage has no concept of chip design records.
- get_run(run_id)#
Not implemented: LocalStorage has no concept of runs.
- query_runs(**kwargs)#
Not implemented: LocalStorage has no concept of runs.
- get_dut_fields(dut_label)#
Not implemented: LocalStorage does not track which dut fields have been observed.
- Parameters:
dut_label (str)
- Return type:
- query_sequence_metadatas(**kwargs)#
Not implemented: LocalStorage has no concept of sequence metadata.
- Parameters:
kwargs (Any)
- Return type:
- create_sequence_metadata(sequence_metadata_definition)#
Not implemented: LocalStorage has no concept of sequence metadata.
- Parameters:
sequence_metadata_definition (SequenceMetadataDefinition)
- Return type:
- save_sequence_result(sequence_result_definition)#
Not implemented: LocalStorage has no concept of sequence results.
- Parameters:
sequence_result_definition (SequenceResultDefinition)
- Return type:
- get_sequence_result(sequence_id)#
Not implemented: LocalStorage has no concept of sequence results.
- Parameters:
- Return type:
- serialize()#
Serialize the current state to a dict; overrides
Serializable.Not meant to be called directly: it exists to satisfy
Serializable, and is used internally to implement disk persistence.
- classmethod deserialize(data)#
Build an instance from a dict produced by
serialize(); overridesSerializable.Not meant to be called directly: it exists to satisfy
Serializable, and is used internally to implement disk persistence.- Parameters:
- Return type:
Inheritance
