Data Flow
vcti-flow bindings for array data: a DataNode payload binding and a FieldSet table binding — sources, transformers, reducers, and sinks.
Overview
vcti-flow is a payload-agnostic
framework for composing flow graphs — it never inspects the values flowing
through it. This package binds that framework to two concrete payloads so you
subclass ready-bound node kinds instead of writing Source[...] everywhere:
vcti.flow.data— the vcti-datanodeDataNodebinding: one array plus layered attributes behind a data source. Node kindsSource/Transformer/Reducer/Sink/Observer, plusfrom_array(eager) andArraySource(lazy) payload builders.vcti.flow.fieldset— the vcti-fieldsetFieldSetbinding: a table of named columns. This is where column and row reshaping lives — select / drop / rename / cast / compute, filter / sort / slice, and the N→1 combiners merge / concat. The nodes are thin wrappers over FieldSet's own copy-freeproject()/rows()builders.
Use the DataNode binding for single-array flows; use the FieldSet binding to
reshape multi-column tables. DataNodesSource / WriteDataNodes bridge between
them (a group of DataNodes ⇆ a FieldSet).
Installation
pip install vcti-dataflow
In pyproject.toml dependencies
dependencies = [
"vcti-dataflow>=3.0.0",
]
Quick Start — DataNode binding
import numpy as np
from vcti.flow.data import Source, Transformer, DataNode, from_array
# A source produces a DataNode
class Stress(Source):
def load(self) -> DataNode:
return from_array(np.array([1.0, 2.0, 3.0]), {"units": "MPa"})
# A transformer maps one DataNode to another
class Scale(Transformer):
def __init__(self, factor: float) -> None:
super().__init__()
self.factor = factor
def transform(self, record: DataNode) -> DataNode:
return from_array(record.load() * self.factor, record.attributes)
result = Scale(2.0).connect(Stress()).execute()
result.load() # array([2., 4., 6.])
result.attributes["units"] # "MPa"
Reach for the array only when you need it (record.load()); a leaf source can
hand back a LazyDataSource-backed node (or use ArraySource) to defer a heavy
read.
Quick Start — FieldSet binding (tables)
The vcti.flow.fieldset nodes carry a FieldSet (named columns) and reshape it.
Column ops (select / drop / rename / cast) share columns by reference —
no data copy; cast is a lazy per-column cast. Row ops fold to a single index.
import numpy as np
from vcti.datanode import DataNode, EagerDataSource
from vcti.flow.fieldset import (
DataNodesSource, SelectFields, RenameFields, CastFields, ComputeFields,
FilterRows, SortRows, MergeFields, ConcatRows, WriteDataNodes,
)
# Read a group of DataNodes as one FieldSet (lazy — nothing materialises here)
src = DataNodesSource([
DataNode(name="id", data_source=EagerDataSource(np.array([1, 2, 3]))),
DataNode(name="stress", data_source=EagerDataSource(np.array([10.0, 20.0, 30.0]))),
])
# Reshape: rename, add a computed column, filter and sort rows
flow = RenameFields({"stress": "s"}).connect(src)
flow = ComputeFields("s_kpa = s * 1000").connect(flow)
flow = FilterRows("s > 10").connect(flow)
flow = SortRows("s", descending=True).connect(flow)
result = flow.execute() # a FieldSet
result.get_values("s_kpa") # array([30000., 20000.])
# Combine tables — N→1 reducers own the policy (collision / schema)
wide = MergeFields().connect(flowA).connect(flowB) # union columns
tall = ConcatRows().connect(flowA).connect(flowB) # stack rows
# Write out: FieldSet -> DataNodes -> your writer (I/O stays in your app)
WriteDataNodes(lambda node: write_to_h5(node)).connect(flow).execute()
Column reshaping is project()-backed; row reshaping is rows()-backed. See
docs/patterns.md for the full recipe set.
API
vcti.flow.data — DataNode binding
| Symbol | Purpose |
|---|---|
Source / Transformer / Reducer / Sink / Observer |
vcti.flow kinds bound to DataNode |
from_array(array, attributes=None) |
Build a DataNode from an in-memory array (eager) |
ArraySource(load_fn, attributes=None) |
Lazy leaf source over a callable returning an array |
DataNode / EagerDataSource / LazyDataSource |
Re-exported from vcti-datanode |
vcti.flow.fieldset — FieldSet binding
| Symbol | Purpose |
|---|---|
Source / Transformer / Reducer / Sink / Observer |
vcti.flow kinds bound to FieldSet |
SelectFields / DropFields / RenameFields |
Keep / remove / rename columns (share sources, no copy) |
CastFields / ComputeFields / FreezeFields |
Cast dtypes (lazy), add expression columns, bake an expression to data |
FilterRows / SortRows / HeadRows / SliceRows |
Row selection (fold to one index; slice stays a view) |
MergeFields / ConcatRows |
N→1: union columns / stack rows (own collision & schema policy) |
FieldSetSource |
Leaf source over an existing FieldSet (or a callable returning one) |
DataNodesSource / WriteDataNodes |
Boundary: DataNodes → FieldSet / FieldSet → DataNodes |
for_each_group(source, key_field, factory) |
Fan out into one flow per group |
from_datanodes / to_datanodes |
Re-exported from vcti-fieldset |
Dependencies
- vcti-flow (>=2.0.0) — the generic framework
- vcti-datanode (>=2.0.0) — the
DataNodepayload - vcti-fieldset
[datanode](>=2.0.0) — theFieldSettable payload and its copy-free reshaping - numpy (>=1.24)
Metadata
Release files for vcti-dataflow 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vcti_dataflow-3.0.0.tar.gz | 17.0 kB | With provenance | Details for vcti_dataflow-3.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vcti_dataflow-3.0.0-py3-none-any.whl | Python 3 | none | any | Details for vcti_dataflow-3.0.0-py3-none-any.whl |
Total release size: 33.3 kB
Release files / vcti_dataflow-3.0.0.tar.gz
| Download URL | vcti_dataflow-3.0.0.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
04cceb1d7bfe3e23d1b2e5d9b5050abe8d863970b1c3ef81b1c30d8544bcadac
|
|
BLAKE2b-256 checksum How to use checksums |
3481b571003b0a4cfca84e592fcb16e0c2dd357dde73bc8a59318356378f8f24
|
| 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 4, 2026.
Transparency logRelease files / vcti_dataflow-3.0.0-py3-none-any.whl
| Download URL | vcti_dataflow-3.0.0-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ac7500c7da4aee72978e09a6ad4ef34a5c0ac2f34a19f1d789b394bcb561a88
|
|
BLAKE2b-256 checksum How to use checksums |
b1e644c3d0c9d70d8097b6c7128ab06ce7a48c53206d133ecc0b7a8ac7935b92
|
| 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 4, 2026.
Transparency logSecurity for vcti-dataflow 3.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.
Attestation for vcti_dataflow-3.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 4, 2026.
Transparency logA 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.