hoops_ai.storage.datasetstorage.schema_builder.Group

class hoops_ai.storage.datasetstorage.schema_builder.Group(name, primary_dimension, description=None, special_processing=None)

Bases: object

Represents a group in a schema with arrays.

Parameters:
  • name (str)

  • primary_dimension (str)

  • description (str | None)

  • special_processing (str | None)

create_array(name, dimensions, dtype='float32', description=None, **validation_rules)

Create an array in this group.

Parameters:
  • name (str) – Name of the array

  • dimensions (List[str]) – List of dimension names (e.g., [‘face’, ‘coordinate’])

  • dtype (str) – Data type (default: ‘float32’)

  • description (str | None) – Optional description of the array

  • **validation_rules – Additional validation rules (min_value, max_value, etc.)

Return type:

None

Example:

group.create_array('face_areas', ['face'], 'float32', 'Surface area of each face')
group.create_array('face_normals', ['face', 'coordinate'], 'float32', 'Normal vectors')
get_array(name)

Get array specification by name.

Parameters:

name (str)

Return type:

Dict[str, Any] | None

get_arrays()

Get all arrays in this group.

Return type:

Dict[str, Dict[str, Any]]

list_arrays()

Get list of all array names in this group.

Return type:

List[str]

remove_array(name)

Remove an array from this group.

Parameters:

name (str) – Name of the array to remove

Returns:

True if array was removed, False if not found

Return type:

bool

to_dict()

Convert this group to a dictionary representation.

Return type:

Dict[str, Any]