Skip to main content

object_from_reference

GitHub source

object_from_reference

evo.objects.typed.base.object_from_reference

object_from_reference(context: IContext, reference: ObjectReference | str) -> _BaseObject

Download a GeoscienceObject from an ObjectReference and create the appropriate typed instance.

This function downloads the object from a full ObjectReference (which can contain path, UUID, version, etc.) and automatically selects the correct typed class (e.g., PointSet, Regular3DGrid) based on the object's sub-classification.

Parameters:

NameTypeDescriptionDefault
contextIContextThe context for connecting to Evo APIs.required
referenceObjectReference | strThe ObjectReference identifying the object to download.required

Returns:

TypeDescription
_BaseObjectA typed GeoscienceObject instance (PointSet, Regular3DGrid, etc.).

Raises:

TypeDescription
ValueErrorIf no typed class is found for the object's sub-classification. Example:: from evo.objects.typed import object_from_reference from evo.objects import ObjectReference # Create reference from URL ref = ObjectReference("evo://org/workspace/object/b208a6c9-6881-4b97-b02d-acb5d81299bb") obj = await object_from_reference(context, ref) # obj will be a PointSet if the object is a pointset, # a Regular3DGrid if it's a regular-3d-grid, etc.

What is the reason for your feedback?