Skip to main content

Float32-focused node graph runtime with PyQt visualizer and real-time instrumentation.

Project description

f32nodes

PyPI Python Versions License CI

Overview

f32nodes integrates a visual programming workflow with plain Python modules into a live-computation environment tuned for multi-modal real-time data streams.

Core Features

  • Python-native nodes: each node is a plain Python subclass representing one step of computation. Nodes declare typed ports and exchange numpy.float32 tensors.
  • YAML graph spec: node instances, configs, and connections sit in a YAML file; the loader resolves import prefixes relative to that file and wires ports automatically.
  • Strict graph & port contracts: preflight rejects unconnected nodes plus shape/range/cycle errors, enforces a single connected DAG, and port writes continue to enforce dtype, shape, and limits during execution.
  • Zero-setup visuals: the strict port contracts drive automatic gauges, waveforms, heatmaps, or RGBA renderers per output shape—with renderer-only normalization and no UI setup required.
  • Performance-minded UI: the PyQt graph view avoids per-frame allocation churn so visualizations stay responsive alongside the runtime.
  • Runtime instrumentation: the runner targets a configurable FPS, records backend/GUI/frame timings, samples per-node costs, and flags when the schedule drifts.
  • Persistent layout: the PyQt6 view stores node positions and viewport state per graph file so the workspace survives restarts.

Visualization Semantics

Renderer-only normalization: visual widgets resample or scale data for display, but the numpy buffers on ports stay untouched.

  • Scalar ports (shape == ()) render as bar gauges between declared bounds.
  • 1D ports (shape == (N,)) render as waveforms after resampling to viewport width.
  • 2D ports (shape == (H, W)) appear as grayscale heatmaps.
  • RGBA ports (shape == (H, W, 4)) display as color textures.

Scope Boundaries

  • No bundled node library; domain-specific nodes live alongside each project.
  • Graph execution is single-threaded within one Python process. Nodes may spawn their own threads, but the runtime does not orchestrate multi-threaded or distributed scheduling.
  • Ports standardize on numpy.float32 scalars and tensors for consistent interoperability; other dtypes require conversion at graph edges.
  • The runner provides best-effort real-time: it reports drift and timings but cannot enforce hard deadlines, and overall throughput is ultimately limited by Python/PyQt rather than native C++ speeds.

Getting Started

Install

Requirements: Python >=3.12, pip 23+, and a working Qt/OpenGL stack (installed automatically through PyQt6 on most platforms).

Install from PyPI:

pip install f32nodes

Demo Gallery

Every demo uses the same setup workflow; from the repo root:

cd demos/<demo_name>
python3 -m venv .venv; source .venv/bin/activate
pip install -r requirements.txt
python3 main.py

Demo 1 – Amplitude Modulation

A low-frequency scalar modulates a waveform generator. The entry point for learning the node API. All files in this demo are heavily commented to illustrate the full flow.

  • nodes.py – defines the modulator and carrier nodes.
  • graph.yaml – initializes & configures nodes, then connects the graph.
  • main.py – loads and runs the graph.

Demo 1 screenshot

Demo 2 – Wavefields

Coupled oscillators drive a drifting 2D height map, while the display node remixes the field into density, height, and a stylized RGBA texture.

Demo 2 screenshot

Demo 3 – Audio Nodes

Streams the bundled spectral_fx.wav, computes octave-band energy plus RMS, and drives an AudioVisualizer node whose three abstract controls (“background change”, “rectangle intensity”, “delay effect”) accept any scalar signal you patch into them. soundfile is required for decoding; sounddevice enables optional playback (toggle via enable_playback).

Demo 3 screenshot

Development

  • Tests: run pytest.

  • Linting: run ruff check ..

  • Packaging: the project ships with a Poetry pyproject.toml; use poetry install if you prefer Poetry over raw pip.

  • Editable install:

    python -m venv .venv
    source .venv/bin/activate
    pip install -U pip
    pip install -e .
    

License & Support

Licensed under the Apache License 2.0. Support is best effort; please open an issue on GitHub and I’ll respond as time allows.

Related Python Node Frameworks

  • Ryven — visual scripting environment for Python that emphasises interactive, dynamically typed nodes within a Qt interface.
  • PyFlow — general-purpose visual scripting system modelled after Unreal’s Blueprints, featuring a plug-in architecture and broad node catalog.
  • Nodezator — node-based Pygame application that streamlines prototyping workflows for games and creative coding projects.

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

f32nodes-0.1.1.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

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

f32nodes-0.1.1-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file f32nodes-0.1.1.tar.gz.

File metadata

  • Download URL: f32nodes-0.1.1.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for f32nodes-0.1.1.tar.gz
Algorithm Hash digest
SHA256 35816e97d43d1cffa89cfaf5462a1cc5fc757912c1962c198798450d0c0bc677
MD5 43dcb1aa1536e69451fc62394ea22a50
BLAKE2b-256 8406099603084adbd6c98708552a2af0bbc85e7cbaf131e05491c03c5140f259

See more details on using hashes here.

Provenance

The following attestation bundles were made for f32nodes-0.1.1.tar.gz:

Publisher: publish.yml on jan-nou/f32nodes

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

File details

Details for the file f32nodes-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: f32nodes-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for f32nodes-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a8b49ea09ca626a237fe9fa91b8aef2c9fb872c57897f7db20f27a70d6afae65
MD5 4c41a84c8a0562a62a13a60b7d6ad781
BLAKE2b-256 20859c264f6505f1806db8a004471a4d43c5227b0a799aa267847f4d3feb1ab5

See more details on using hashes here.

Provenance

The following attestation bundles were made for f32nodes-0.1.1-py3-none-any.whl:

Publisher: publish.yml on jan-nou/f32nodes

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