GitHub source

evo.objects.typed.attributes.Attribute

A Geoscience Object Attribute

key

key: str

The key used to identify this attribute.

This is required to be unique within a group of attributes.

attribute_type

attribute_type: str

The type of this attribute.

exists

exists: bool

Whether this attribute exists on the object.

Returns:

Type Description
bool

True for existing attributes.

to_dataframe

to_dataframe(fb: IFeedback = NoFeedback) -> pd.DataFrame

Load a DataFrame containing the values for this attribute from the object.

Parameters:

Name Type Description Default
fb IFeedback

Optional feedback object to report download progress.

NoFeedback

Returns:

Type Description
DataFrame

The loaded DataFrame with values for this attribute, applying lookup table and NaN values as specified. The column name will be updated to match the attribute name.

set_attribute_values

set_attribute_values(df: DataFrame, infer_attribute_type: bool = False, fb: IFeedback = NoFeedback) -> None

Update the values of this attribute.

Parameters:

Name Type Description Default
df DataFrame

DataFrame containing the new values for this attribute. The DataFrame should contain a single column.

required
infer_attribute_type bool

Whether to infer the attribute type from the DataFrame. If False, the existing attribute type will be used.

False
fb IFeedback

Optional feedback object to report upload progress.

NoFeedback