Skip to main content

Lightweight data-plus-attributes node containers, with an optional lazily-loaded variant for out-of-core data.

Project description

Data Node

Lightweight data-plus-attributes node containers, with an optional lazily-loaded variant for out-of-core data.

Overview

vcti-datanode provides two small, tree-agnostic value types:

  • DataNode — pairs data (an np.ndarray, any array-like, or an arbitrary object) with an attributes metadata dict. Value equality and readable repr/str. That's it.
  • LazyDataNode — a DataNode whose data is fetched on demand through a loader callback (load()) and can be freed (release()) and reloaded later. Attributes stay resident; only the data comes and goes. Built for large datasets (e.g. CAE models) where holding everything in memory at once is impractical.

They are commonly used as node payloads in a tree, but depend on nothing but numpy and can be used anywhere a "data + metadata" unit is useful.

Installation

pip install vcti-datanode

In requirements.txt

vcti-datanode>=1.0.1

In pyproject.toml dependencies

dependencies = [
    "vcti-datanode>=1.0.1",
]

Quick Start

import numpy as np
from vcti.datanode import DataNode, LazyDataNode

# Eager: data held directly.
node = DataNode(data=np.array([1.0, 2.0, 3.0]), attributes={"units": "mm"})

# Lazy: data fetched on demand, freed when not needed.
lazy = LazyDataNode(loader=lambda: np.load("displacement.npy"),
                    attributes={"name": "displacement"})
lazy.is_loaded          # False
arr = lazy.load()       # loader runs once; cached thereafter
lazy.release()          # frees the data; attributes remain

Dependencies

  • numpy>=1.26 — used for array-aware value equality and repr.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vcti_datanode-1.0.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vcti_datanode-1.0.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file vcti_datanode-1.0.1.tar.gz.

File metadata

  • Download URL: vcti_datanode-1.0.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vcti_datanode-1.0.1.tar.gz
Algorithm Hash digest
SHA256 78074d03841f92fafb8cf46eb8d3154a22b53f3a5606f7faa964ee25ae46727b
MD5 7f0beb14c37b8acd26b2486781999be7
BLAKE2b-256 49f19b178b7cfefe160018dcb9cad7ee59bf08217b02d4add4df6039f89a3919

See more details on using hashes here.

Provenance

The following attestation bundles were made for vcti_datanode-1.0.1.tar.gz:

Publisher: release.yml on vcollab/vcti-python-datanode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vcti_datanode-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: vcti_datanode-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vcti_datanode-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 50577c63b7f0600a8037cbe564d9d7490e3e7f77133387bd6bf01cc0146ad51b
MD5 d161bfe31a35571ce4e1be1a39dbe4fa
BLAKE2b-256 4f1536d22cf721a958757dfa9f26ce22813ba51d412544cd7d078d55766b4452

See more details on using hashes here.

Provenance

The following attestation bundles were made for vcti_datanode-1.0.1-py3-none-any.whl:

Publisher: release.yml on vcollab/vcti-python-datanode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page