fiftyone.operators.store.clone#
Clone execution store records when a dataset is cloned.
This module registers an βextras clonerβ (see
fiftyone.core.dataset.register_extras_cloner()) that copies an
allowlisted set of execution store records from a source dataset to its
clone, so the run history backing stateful panels follows a full dataset
clone.
Functions:
|
Registers an execution store whose records should be copied when a full dataset is cloned. |
|
Copies allowlisted execution store records to a cloned dataset. |
- fiftyone.operators.store.clone.register_cloneable_store(store_name)#
Registers an execution store whose records should be copied when a full dataset is cloned.
Lets code outside this module (e.g. additional panels) opt their store into cloning without this module needing to import them. Registrations must be in place before the clone runs.
- Parameters:
store_name β the execution store name
- fiftyone.operators.store.clone.clone_execution_stores(src_dataset, dst_dataset, now, id_map=None)#
Copies allowlisted execution store records to a cloned dataset.
Execution store records are keyed by
(store_name, key, dataset_id). Cloning copies each matching record under a fresh_idwithdataset_idrewritten to the destination dataset. Original timestamps are preserved so the cloned panels reflect the original run history.A clone re-creates run docs with new ids, so store data keyed by (or referencing) a run doc id would otherwise be orphaned.
id_mapmaps each source id (the dataset doc + cloned run docs) to its new id; each recordβskeyandvalueare rewritten through it so references resolve on the clone.- Parameters:
src_dataset β the source
fiftyone.core.dataset.Datasetdst_dataset β the destination (clone)
fiftyone.core.dataset.Datasetnow β the clone timestamp (unused; record timestamps are preserved)
id_map (None) β a
{str(old_id): str(new_id)}mapping of source ids to their clone counterparts