Data¶
Hakowan's internal data frame and adapters for arrays, tabular data, and common geometry containers.
Internal geometry-plus-attributes data frame representation.
DataFrameLike = object
module-attribute
¶
Runtime data accepted by :func:to_dataframe.
Supported values are mesh paths, Lagrange meshes, Hakowan data frames, numeric point arrays, pandas DataFrames, xarray Datasets, PyVista datasets, and Trimesh objects. Optional third-party packages are detected without importing them.
DataFrame
dataclass
¶
Store spatial geometry and element attributes on a SurfaceMesh.
Facet-free meshes represent point clouds; meshes with facets represent surfaces. Attributes act as typed columns defined on vertices, edges, facets, corners, or indexed values.
Attributes:
| Name | Type | Description |
|---|---|---|
mesh |
SurfaceMesh
|
Lagrange geometry and attribute storage. |
roi_box |
ArrayLike | None
|
Optional axis-aligned region used for framing and normalization. |
source |
Path | None
|
Original mesh path for canonical serialization, or |
Source code in hakowan/grammar/dataframe/dataframe.py
Convert supported geometry or tabular data to a Hakowan DataFrame.
Paths and Lagrange meshes retain topology. Numeric arrays become 2D/3D point clouds. Pandas and xarray inputs use inferred or explicit position columns; numeric fields become vertex attributes. PyVista and Trimesh adapters preserve supported point/vertex and cell/facet attributes without importing optional libraries inside Hakowan.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
object
|
Mesh path, Lagrange mesh, point array, table, PyVista dataset, Trimesh object, or existing Hakowan DataFrame. |
required |
positions
|
PositionColumns
|
Two or three position column names for pandas/xarray input. |
None
|
roi_box
|
ArrayLike | None
|
Optional axis-aligned region of interest. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
A DataFrame backed by a Lagrange SurfaceMesh. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If the input type or option combination is unsupported. |
ValueError
|
If positions, topology, or numeric values are invalid. |
Source code in hakowan/grammar/dataframe/adapters.py
Structured inspection¶
Inspect supported geometry or tabular data without changing it.
The returned dataclasses contain only JSON-safe metadata. Attribute statistics
are computed from unique values for indexed attributes; element_count
reports the index count while value_count reports the unique-value count.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
DataFrameLike
|
Any input accepted by :func: |
required |
positions
|
PositionColumns
|
Optional position column names for pandas and xarray inputs. |
None
|
Returns:
| Type | Description |
|---|---|
DataSummary
|
Geometry, topology, attribute-domain, and numeric-range metadata. |
Source code in hakowan/workflow/inspection.py
Machine-readable geometry, topology, and attribute summary.
Source code in hakowan/workflow/inspection.py
Machine-readable metadata and statistics for one mesh attribute.