LinkedObject¶
- class LinkedObject(filename, object_id, *, class_type, instance=None)¶
Class for linking to an object in a hdf5 file.
- Parameters:
filename (str) – The filename.
object_id (str) – The object id.
class_type (class) – Only link to objects of this type.
instance (object) – The optional instance.
- classType()¶
- Returns:
The class type.
- Return type:
class
- copy()¶
- Returns:
A copy (without any cached instance).
- Return type:
The copy
- static fallback()¶
The fallback handler for the entire cargo chain. Only applies to the top level object.
- Returns:
The optional fallback function.
- Return type:
callable
- filename()¶
- Returns:
The filename.
- Return type:
str
- instance()¶
- Returns:
[description].
- Return type:
[type]
- metatext()¶
- Returns:
The metatext of the object or None if no metatext is present.
- Return type:
str | None
- objectId()¶
- Returns:
The object_id.
- Return type:
str
- static registry()¶
Retrieve the current registry. This is used e.g. when calling nlsave() or nlread() on the CargoSerializable itself.
- Returns:
The registry.
- Return type:
Registry
- setMetatext(metatext)¶
Set a given metatext string on the object.
- Parameters:
metatext (str | None) – The metatext string that should be set. A value of “None” can be given to remove the current metatext.
- uniqueString()¶
Return a unique string representing the state of the object.
- classmethod upgrade(data, entries, data_version)¶
Legacy support:
Upgrade the LinkedObject from the version read from the disk to the current LinkedObject.
- Parameters:
data (dict) – The data.
data_version (int) – The version number from serialized input (from the disk).
- classmethod version()¶
- Returns:
The version of the LinkedObject, used for legacy support issues.
- Return type:
int