class documentation
class SampleSingleton(DocumentSingleton): (source)
Constructor: SampleSingleton(*args, **kwargs)
Singleton metaclass for fiftyone.core.sample.Sample
.
This metaclass maintains a weakref dictionary of all in-memory
fiftyone.core.sample.Sample
instances keyed by
[collection name][sample ID].
Method | __new__ |
Undocumented |
Method | _clear |
Removes all samples for the given collection from the cache. |
Method | _clear |
Clears the values for the given fields (i.e., sets them to None) on all in-memory samples in the collection. |
Method | _get |
Retrieves the fiftyone.core.document.Document instance for the given document, if one exists. |
Method | _purge |
Removes the fields from all in-memory samples in the collection. |
Method | _register |
Registers the given instance in the weakref dictionary. |
Method | _reload |
Reloads the backing document for the given sample if it is in-memory. |
Method | _reload |
Reloads the backing documents for in-memory samples in the collection. |
Method | _reload |
Reloads the backing document for the given instance (or view), if a reference exists to it. |
Method | _rename |
Renames the field on all in-memory samples in the collection. |
Method | _reset |
Resets the backing documents for in-memory samples in the collection. |
Method | _sync |
Syncs the backing documents for all in-memory samples in the collection according to the following rules: |
Clears the values for the given fields (i.e., sets them to None) on all in-memory samples in the collection.
Retrieves the fiftyone.core.document.Document
instance for
the given document, if one exists.
Parameters | |
cls | Undocumented |
doc | a fiftyone.core.odm.document.Document |
Returns | |
a fiftyone.core.document.Document instance, or None |
Reloads the backing documents for in-memory samples in the collection.
If sample_ids are provided, only those samples are reloaded.
Reloads the backing document for the given instance (or view), if a reference exists to it.
Parameters | |
cls | Undocumented |
obj | a Document or DocumentView |