GitHub source

evo.objects.typed.base.BaseObject

Base object for all Geoscience Objects, containing common properties.

create

create(context: IContext, data: BaseObjectData, parent: str | None = None, path: str | None = None) -> BaseObject

Create a new object.

The type of Geoscience Object created is determined by the type of data provided.

Parameters:

Name Type Description Default
context IContext

The context containing the environment, connector, and cache to use.

required
data BaseObjectData

The data that will be used to create the object.

required
parent str | None

Optional parent path for the object.

None
path str | None

Full path to the object, can't be used with parent.

None

replace

replace(context: IContext, reference: str, data: BaseObjectData) -> BaseObject

Replace an existing object.

The type of Geoscience Object that will be replaced is determined by the type of data provided. This must match the type of the existing object.

Parameters:

Name Type Description Default
context IContext

The context containing the environment, connector, and cache to use.

required
reference str

The reference of the object to replace.

required
data BaseObjectData

The data that will be used to create the object.

required

create_or_replace

create_or_replace(context: IContext, reference: str, data: BaseObjectData) -> BaseObject

Create or replace an existing object.

If the object identified by reference exists, it will be replaced. Otherwise, a new object will be created.

The type of Geoscience Object that will be created or replaced is determined by the type of data provided. This must match the type of the existing object if it already exists.

Parameters:

Name Type Description Default
context IContext

The context containing the environment, connector, and cache to use.

required
reference str

The reference of the object to create or replace.

required
data BaseObjectData

The data that will be used to create the object.

required