Skip to main content

NPZ Tree Exporter

NPZ exporter plugin for vcti-tree-exporter: writes a vcti tree to a single .npz archive.

NpzExporter serializes any vcti-tree tree whose node payloads are vcti-datanode DataNodes to one NumPy .npz archive, and ships a get_exporter_descriptor() factory so a consumer registers it in a catalog and resolves it by id ("npz") or by attribute lookup.

NPZ preserves array dtype and shape natively, so it suits complete numeric simulation data — the heavy arrays JSON and CSV handle poorly.

Tree → NPZ mapping

The archive is self-contained:

  • each data leaf's array is stored under a path key built from node names, e.g. model/materials/material_0, so the flat NPZ namespace still reads as the tree (duplicate paths are de-collided with a ~N suffix);
  • the hierarchy, each node's attributes, and the array key of every data node are stored as one JSON manifest under the reserved key __manifest__.
import numpy as np, json
archive = np.load("model.npz")
manifest = json.loads(str(archive["__manifest__"]))   # the tree structure + attributes
array = archive["model/materials/material_0"]          # a leaf's array, native dtype

A node may carry both an array and children. Attribute values are JSON-encoded into the manifest (bytes decoded, numpy scalars/arrays converted) with a str() fallback. The export is one-way — there is no matching importer.

Usage

from pathlib import Path
from vcti.tree.exporter.core import build_registry, get_exporter
from vcti.tree.exporter.npz import get_exporter_descriptor

registry = build_registry([get_exporter_descriptor()])   # plus any other format plugins
get_exporter(registry, "npz").export(tree, Path("model.npz"), overwrite=True)

Or use the exporter directly:

from vcti.tree.exporter.npz import NpzExporter
NpzExporter().export(tree, Path("model.npz"))

Dependencies

Metadata

Release files for vcti-tree-exporter-npz 2.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-tree-exporter-npz 2.0.0
File Size Uploaded
vcti_tree_exporter_npz-2.0.0.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vcti-tree-exporter-npz 2.0.0
File Interpreter ABI Platform
vcti_tree_exporter_npz-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.0 kB

Release files / vcti_tree_exporter_npz-2.0.0.tar.gz

Download URL vcti_tree_exporter_npz-2.0.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
beb0be6ef1cc6964b374814df1edc74e3338322bfccd576078fac7f8943c41e7
BLAKE2b-256 checksum
How to use checksums
988dedb19ab1bc125c974823f6085094ab5b3c455030611759bc088c0e84b884
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 Jun 27, 2026.

Transparency log

Release files / vcti_tree_exporter_npz-2.0.0-py3-none-any.whl

Download URL vcti_tree_exporter_npz-2.0.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d12ad414d83f765718e05bf41eb15e12a680e95557e68c1f968297a7cac077cb
BLAKE2b-256 checksum
How to use checksums
a947e8ec03d724b0bd47971f0ee0683084496a8e8e2e0d744b8d8357efcd1e1b
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 Jun 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

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