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, explicit vertices / facets
mesh mappings, 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, Lagrange meshes, and mappings with vertices and facets retain
topology. Two-dimensional Lagrange meshes and mapping vertices are embedded
in the XY plane. 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, mapping of mesh arrays, 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
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | |
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.