GitHub source

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:

Name Type Description Default
context IContext

The context for connecting to Evo APIs.

required
reference ObjectReference | str

The ObjectReference identifying the object to download.

required

Returns:

Type Description
_BaseObject

A typed GeoscienceObject instance (PointSet, Regular3DGrid, etc.).

Raises:

Type Description
ValueError

If 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.