geoh5py.ui_json package#
Submodules#
geoh5py.ui_json.annotations module#
geoh5py.ui_json.constants module#
geoh5py.ui_json.forms module#
geoh5py.ui_json.input_file module#
geoh5py.ui_json.templates module#
geoh5py.ui_json.ui_json module#
geoh5py.ui_json.utils module#
- geoh5py.ui_json.utils.class_or_raise(value: UUID) type[ObjectBase] | type[Group]#
Promote uid to class, raise if uid is not a geoh5py type uid.
- geoh5py.ui_json.utils.monitored_directory_copy(directory: str, entities: EntityContainer | list[EntityContainer], copy_children: bool = True) str#
Create a temporary geoh5 file in the monitoring folder and export entities for update.
Creates a temporary workspace in the specified monitoring directory and copies the given entities to it. This is useful for monitoring and updating entities in a separate workspace environment.
- Parameters:
directory – Path to the monitoring directory where the temporary file will be created.
entities – Entity (objects.ObjectBase or groups.Group) to be copied for monitoring.
copy_children – Whether to copy children entities along with the main entities.
- Returns:
Full path to the created temporary geoh5 file.
- geoh5py.ui_json.utils.name_or_uid_to_type(value: str | UUID | type) type[ObjectBase] | type[Group] | UUID#
Convert a string to a geoh5py type or group type.
- Parameters:
value – String representing geoh5py type, either as a UUID or name.
- Returns:
Type of object, group or UUID
- geoh5py.ui_json.utils.optional_uuid_mapper(value: Any)#
Take values and convert them into UUID or None (or list of).
- Parameters:
value – Either a string of entity, or list of.
- Returns:
UUID, Nont or list of.
- geoh5py.ui_json.utils.str2list(value: Any) Any#
Convert string representation of numbers to list of floats.
Maps string values like “[1,2,3]” or “1,2,3” to [1.0, 2.0, 3.0]. Handles special cases like “inf”, “-inf”, and empty strings.
- Parameters:
value – Value to convert, typically a string or already converted type.
- Returns:
List of floats if conversion successful, original value otherwise.
- geoh5py.ui_json.utils.to_class(value: UUID | type[ObjectBase] | type[Group]) type[ObjectBase] | type[Group]#
Promote uid to class.
Passes existing classes and raises if uid is not a geoh5py type uid.
- geoh5py.ui_json.utils.to_class_type(values: str | UUID | list[str] | list[UUID]) type[ObjectBase] | type[Group] | list[type[ObjectBase]] | list[type[Group]]#
Promote strings or uuid to a class type.
Strings can represent both uid(s) or names that represent geoh5py objects. We first attempt to convert strings to uid(s) and then fall back on conversion from name to class(es), and finally to type uid(s). GA naming doesn’t match geoh5py naming, so we must map names to classes before type uid conversion.
- Parameters:
values – Value or list of strings representing either geoh5py type uids or class names.
- Returns:
Value or list of geoh5py objects or groups.
- geoh5py.ui_json.utils.to_list(value: Any) list[Any]#
Promote single values to list.
- geoh5py.ui_json.utils.to_path(value: list[str]) list[Path | None]#
Promote path strings to patlib.Path objects.
- geoh5py.ui_json.utils.workspace2path(value: Any) str#
Convert a Workspace object to its file path string.
Deprecated: This function has been migrated to geoh5py.shared.utils.workspace2path and will be removed in future versions.
- Parameters:
value – Workspace object or other value to convert.
- Returns:
File path string for Workspace objects, “[in-memory]” for in-memory workspaces, or the original value for non-Workspace inputs.