Skip to main content

vcti-mesh-schema

Mesh schema and accessors for structured-array mesh blocks in DataNode trees.

Overview

vcti-mesh-schema defines what a mesh subtree looks like: a DataNode subtree whose children carry one structured numpy array per block — a node block with point coordinates (x, y for 2-D meshes, x, y, z for 3-D), and cell blocks (edge, triangle, tetrahedron, ...) with integer node_index* connectivity fields. It is the shared contract that lets mesh readers (fileloader plugins such as vcti-fileloader-slim) and mesh writers (vcti-tree-exporter-mesh) interoperate without depending on each other. There is deliberately no container class — just the vocabulary, and free functions that extract coordinate/connectivity matrices, locate blocks in a tree, and validate conformance.

Installation

pip install vcti-mesh-schema

In requirements.txt

vcti-mesh-schema>=1.0.0

In pyproject.toml dependencies

dependencies = [
    "vcti-mesh-schema>=1.0.0",
]

Quick Start

Work with a block array directly (any structured array with schema fields):

import numpy as np
from vcti.mesh.schema import attribute_fields, connectivity, coordinates

node = np.array(
    [(0.0, 0.0, 0.0, 10), (1.0, 0.0, 0.0, 11), (1.0, 1.0, 0.0, 12)],
    dtype=[("x", "<f8"), ("y", "<f8"), ("z", "<f8"), ("uid", "<i4")],
)
triangle = np.array(
    [(0, 1, 2, 7)],
    dtype=[("node_index0", "<u4"), ("node_index1", "<u4"),
           ("node_index2", "<u4"), ("uid", "<i4")],
)

coordinates(node)            # (3, 3) float64 matrix — (N, 2) for a 2-D mesh
connectivity(triangle)       # (1, 3) int64 matrix, zero-based indices
attribute_fields(node.dtype) # ("uid",) — the per-entity fields
dimension(node.dtype)        # 3 (a block with only x, y fields gives 2)

Work with a mesh subtree produced by a loader:

from vcti.mesh.schema import load_mesh_blocks, validate_mesh_subtree

validate_mesh_subtree(tree, mesh_root)          # raises MeshSchemaError subclass
blocks = load_mesh_blocks(tree, mesh_root)      # {"node": ..., "triangle": ...}
xyz = coordinates(blocks["node"])

Blocks may be lazy (LazyDataNode-style payloads); load_mesh_blocks materialises them through the payload's own load().


API surface

Name Kind Purpose
NODE_BLOCK, COORDINATE_FIELDS, CONNECTIVITY_PREFIX, UID_FIELD constants Schema vocabulary
CELL_NODE_COUNTS mapping Canonical cell types → nodes per cell
dimension(dtype) function Mesh dimension: 2 or 3
coordinates(block) function (N, d) float64 matrix from a point block
connectivity(block) function (M, k) int64 matrix from a cell block
connectivity_fields(dtype) / attribute_fields(dtype) function Field classification
block_array(payload) function Duck-typed (lazy-aware) array access
find_mesh_blocks(tree, root) function Block handles by name
load_mesh_blocks(tree, root) function Block arrays by name
validate_mesh_subtree(tree, root) function Schema conformance check
MeshSchemaError exception Base; BlockNotFoundError, BlockFormatError, ConnectivityError

See docs/schema.md for the normative schema and docs/design.md for the rationale and boundaries.


Dependencies

  • vcti-tree — the tree protocols the accessors walk.
  • numpy — structured-array block access.

Metadata

Release files for vcti-mesh-schema 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vcti-mesh-schema 1.0.0
File Size Uploaded Provenance Actions
vcti_mesh_schema-1.0.0.tar.gz 12.0 kB With provenance Details for vcti_mesh_schema-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vcti-mesh-schema 1.0.0
File Interpreter ABI Platform Actions
vcti_mesh_schema-1.0.0-py3-none-any.whl Python 3 none any Details for vcti_mesh_schema-1.0.0-py3-none-any.whl

Total release size: 22.8 kB

Release files / vcti_mesh_schema-1.0.0.tar.gz

Download URL vcti_mesh_schema-1.0.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
aeaedfebc327dfe1c3284855d8eb51db3ce0f98bc9bf4a904a206dcaa60d01f9
BLAKE2b-256 checksum
How to use checksums
206b1ac5e90245cff7cc663cb187dca5cf07f989232ed6f3f1bdd4259c2c6398
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release files / vcti_mesh_schema-1.0.0-py3-none-any.whl

Download URL vcti_mesh_schema-1.0.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ecb1d0195bff0090060bc2e8388e5b0c7d9c656c05652e2ff8aec52582ceb88
BLAKE2b-256 checksum
How to use checksums
027365475614b0322b543ea8b65c50f6c1a93a88417f1a4b18cb1cb0eaa0313d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Security for vcti-mesh-schema 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vcti_mesh_schema-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page