geoh5py.data

geoh5py.data.blob_data

class geoh5py.data.blob_data.BlobData(data_type: DataType, **kwargs)[source]

Bases: Data

classmethod primitive_type() PrimitiveTypeEnum[source]

geoh5py.data.color_map

class geoh5py.data.color_map.ColorMap(**kwargs)[source]

Bases: object

Records colors assigned to value ranges (where Value is the start of the range).

property name: str

str: Name of the colormap

property parent

Parent data type

property values: np.ndarray | None

numpy.array: Colormap defined by values and corresponding RGBA:

values = [
    [V_1, R_1, G_1, B_1, A_1],
    ..., [V_i, R_i, G_i, B_i, A_i]
]

where V (Values) are sorted floats defining the position of each RGBA. R (Red), G (Green), B (Blue) and A (Alpha) are integer values between [0, 255].

geoh5py.data.data

class geoh5py.data.data.Data(data_type: DataType, **kwargs)[source]

Bases: Entity

Base class for Data entities.

add_file(file: str)[source]

Alias not implemented from base Entity class.

property association: DataAssociationEnum | None

DataAssociationEnum: Relationship made between the values() and elements of the parent object. Association can be set from a str chosen from the list of available DataAssociationEnum options.

property entity_type: DataType

DataType

property modifiable: bool

bool Entity can be modified.

property n_values: int | None

int: Number of expected data values based on association

abstract classmethod primitive_type() PrimitiveTypeEnum[source]
remove_data_from_group(data: list | Entity | uuid.UUID | str, name: str = None)[source]

Remove self from a property group.

property values

Data values

geoh5py.data.data_association_enum

class geoh5py.data.data_association_enum.DataAssociationEnum(value)[source]

Bases: Enum

Known data association between values and the parent object. Available options:

CELL = 2
DEPTH = 6
FACE = 4
GROUP = 5
OBJECT = 1
UNKNOWN = 0
VERTEX = 3

geoh5py.data.data_type

class geoh5py.data.data_type.DataType(workspace: workspace.Workspace, **kwargs)[source]

Bases: EntityType

DataType class

property color_map: ColorMap | None

ColorMap: Colormap used for plotting

The colormap can be set from a dict of sorted values with corresponding RGBA color.

color_map = {
    val_1: [r_1, g_1, b_1, a_1],
    ...,
    val_i: [r_i, g_i, b_i, a_i]
}
classmethod create(workspace: workspace.Workspace, data_class: type[data.Data]) DataType[source]

Creates a new instance of DataType with corresponding PrimitiveTypeEnum.

Parameters

data_class – A Data implementation class.

Returns

A new instance of DataType.

classmethod find_or_create(workspace: workspace.Workspace, **kwargs) DataType[source]

Find or creates an EntityType with given UUID that matches the given Group implementation class.

Parameters

workspace – An active Workspace class

Returns

A new instance of DataType.

classmethod for_x_data(workspace: workspace.Workspace) DataType[source]
classmethod for_y_data(workspace: workspace.Workspace) DataType[source]
classmethod for_z_data(workspace: workspace.Workspace) DataType[source]
property hidden: bool

bool: Hidden data [False]

property mapping: str

str: Color stretching type chosen from: ‘linear’, [‘equal_area’], ‘logarithmic’, ‘cdf’, ‘missing’

property number_of_bins: int | None

int: Number of bins used by the histogram [50]

property primitive_type: PrimitiveTypeEnum | None

PrimitiveTypeEnum

property transparent_no_data: bool

bool: Use transparent for no-data-value [True]

property units: str | None

str: Data units

property value_map: ReferenceValueMap | None

ReferenceValueMap: Reference value map for ReferenceData

The value_map can be set from a dict of sorted values with corresponding str description.

value_map = {
    val_1: str_1,
    ...,
    val_i: str_i
}

geoh5py.data.data_unit

class geoh5py.data.data_unit.DataUnit(unit_name: Optional[str] = None)[source]

Bases: object

Data unit

property name: str | None

geoh5py.data.datetime_data

class geoh5py.data.datetime_data.DatetimeData(data_type: DataType, **kwargs)[source]

Bases: Data

classmethod primitive_type() PrimitiveTypeEnum[source]

geoh5py.data.filename_data

class geoh5py.data.filename_data.FilenameData(data_type: DataType, file_name=None, **kwargs)[source]

Bases: Data

property file_name: str | None

str Text value.

classmethod primitive_type() PrimitiveTypeEnum[source]
save_file(path: str = './', name=None)[source]

Save the file to disk.

Parameters
  • path – Directory to save the file to.

  • name – Name given to the file.

property values: bytes | None

Binary str value representation of a file.

geoh5py.data.float_data

class geoh5py.data.float_data.FloatData(data_type: DataType, **kwargs)[source]

Bases: NumericData

Data container for floats values

classmethod ndv() float[source]

No-Data-Value

classmethod primitive_type() PrimitiveTypeEnum[source]

geoh5py.data.geometric_data_constants

class geoh5py.data.geometric_data_constants.GeometricDataConstants[source]

Bases: object

classmethod primitive_type() PrimitiveTypeEnum[source]
classmethod x_datatype_uid() UUID[source]
classmethod y_datatype_uid() UUID[source]
classmethod z_datatype_uid() UUID[source]

geoh5py.data.integer_data

class geoh5py.data.integer_data.IntegerData(data_type: DataType, **kwargs)[source]

Bases: NumericData

classmethod ndv() int[source]

No-Data-Value

classmethod primitive_type() PrimitiveTypeEnum[source]

geoh5py.data.numeric_data

class geoh5py.data.numeric_data.NumericData(data_type: DataType, **kwargs)[source]

Bases: Data, ABC

Data container for floats values

check_vector_length(values) ndarray[source]

Check for possible mismatch between the length of values stored and the expected number of cells or vertices.

classmethod primitive_type() PrimitiveTypeEnum[source]
property values: np.ndarray | None
Returns

values: An array of float values

geoh5py.data.primitive_type_enum

class geoh5py.data.primitive_type_enum.PrimitiveTypeEnum(value)[source]

Bases: Enum

Known data type.

Available options:

BLOB = 6
DATETIME = 8
FILENAME = 5
FLOAT = 2
GEOMETRIC = 9
INTEGER = 1
INVALID = 0
REFERENCED = 4
TEXT = 3
VECTOR = 7

geoh5py.data.reference_value_map

class geoh5py.data.reference_value_map.ReferenceValueMap(color_map: dict[int, str] = None)[source]

Bases: ABC

Maps from reference index to reference value of ReferencedData.

property map

dict: A reference dictionary mapping values to strings

geoh5py.data.referenced_data

class geoh5py.data.referenced_data.ReferencedData(data_type: DataType, **kwargs)[source]

Bases: IntegerData

Reference data described by indices and associated strings.

classmethod primitive_type() PrimitiveTypeEnum[source]
property value_map

Pointer to the data.data_type.DataType.value_map

geoh5py.data.text_data

class geoh5py.data.text_data.CommentsData(data_type: DataType, **kwargs)[source]

Bases: Data

Comments added to an Object or Group. Stored as a list of dictionaries with the following keys:

comments = [
    {
        "Author": "username",
        "Date": "2020-05-21T10:12:15",
        "Text": "A text comment."
    },
]
classmethod primitive_type() PrimitiveTypeEnum[source]
property values: list[dict] | None

list List of comments

class geoh5py.data.text_data.TextData(data_type: DataType, **kwargs)[source]

Bases: Data

classmethod primitive_type() PrimitiveTypeEnum[source]
property values: np.ndarray | str | None

str Text value.

geoh5py.data.unknown_data

class geoh5py.data.unknown_data.UnknownData(data_type: DataType, association: DataAssociationEnum, name: str, uid: Optional[UUID] = None)[source]

Bases: Data

classmethod primitive_type() PrimitiveTypeEnum[source]