Modular structural-based dynamics on networks.
Project description
TNFR Python Engine
Canonical implementation of the Resonant Fractal Nature Theory (TNFR) for modelling structural coherence. The engine seeds resonant nodes, applies structural operators, coordinates ΔNFR/phase dynamics, and measures coherence metrics (C(t), Si, νf) without breaking the nodal equation $\partial EPI/\partial t = \nu_f \cdot \Delta NFR(t)$.
Snapshot
- Operate: build nodes with
tnfr.create_nfr, execute trajectories viatnfr.structural.run_sequence, and evolve dynamics withtnfr.dynamics.run. - Observe: register metrics/trace callbacks to capture ΔNFR, C(t), Si, and structural histories for every run.
- Extend: rely on the canonical operator grammar and invariants before introducing new utilities or telemetry.
Quickstart
Install from PyPI (Python ≥ 3.9):
pip install tnfr
Then follow the quickstart guide for Python and CLI walkthroughs plus optional dependency caching helpers.
Documentation map
- Documentation index — navigation hub for API chapters and examples.
- API overview — package map, invariants, and structural data flow.
- Structural operators — canonical grammar, key concepts, and typical workflows.
- Telemetry & utilities — coherence metrics, trace capture, locking, and helper facades.
- Examples — runnable scenarios, CLI artefacts, and token legend.
Documentation build workflow
Netlify publishes the documentation with MkDocs so the generated site preserves the canonical TNFR structure. The same steps can be executed locally:
- Create and activate a virtual environment (e.g.
python -m venv .venv && source .venv/bin/activate). - Install the documentation toolchain:
python -m pip install -r docs/requirements.txt. - Preview changes live with
mkdocs serveor reproduce the Netlify pipeline withmkdocs build, which writes the static site to thesite/directory.
The Netlify build (netlify.toml) runs python -m pip install -r docs/requirements.txt && mkdocs build
and publishes the resulting site/ directory, ensuring the hosted documentation matches local builds.
Local development
Use the helper scripts to keep formatting aligned with the canonical configuration and to reproduce the quality gate locally:
./scripts/format.sh # Apply Black and isort across src/, tests/, scripts/, and benchmarks/
./scripts/format.sh --check # Validate formatting without modifying files
./scripts/run_tests.sh # Execute the full QA battery (type checks, tests, coverage, linting)
The formatting helper automatically prefers poetry run when a Poetry environment is available and
falls back to python -m invocations so local runs mirror the tooling invoked in continuous
integration.
Additional resources
- ARCHITECTURE.md — orchestration layers and invariant enforcement.
- CONTRIBUTING.md — QA battery (
scripts/run_tests.sh) and review expectations. - TNFR.pdf — theoretical background, structural operators, and paradigm glossary.
Migration notes
- Si dispersion keys: Replace any remaining
dSi_ddisp_faseentries in graph payloads or configuration files with the EnglishdSi_dphase_dispkey before upgrading. The runtime now raises :class:ValueErrorlisting any unexpected sensitivity keys, and :func:tnfr.metrics.sense_index.compute_Si_noderejects unknown keyword arguments. - Refer to the release notes for a migration snippet that rewrites stored graphs in place prior to running the new version.
Licensing
Released under the MIT License. Cite the TNFR paradigm when publishing research or derived artefacts based on this engine.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tnfr-6.0.0.tar.gz.
File metadata
- Download URL: tnfr-6.0.0.tar.gz
- Upload date:
- Size: 184.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a90348b0438dc1507a1ec0f852083afba47751c1afb12c1649e341df8f0a60d8
|
|
| MD5 |
107006263ce192ba5ab9e678833d0530
|
|
| BLAKE2b-256 |
a267fe7c715aef7d7b8e88084e79ebb496b6d2653186b2d15a3540e6a19b6394
|
File details
Details for the file tnfr-6.0.0-py3-none-any.whl.
File metadata
- Download URL: tnfr-6.0.0-py3-none-any.whl
- Upload date:
- Size: 238.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e1aae1cee8b47aa1f5da23dc8c97b50e9ea44b7ca75d2a98191c2819de51934
|
|
| MD5 |
914dd52f739a58ac309cb8b90aa09d83
|
|
| BLAKE2b-256 |
90df80c13143234bb6625168dd7a417dfe3fae4cfa1e50701bc6bfbeaa19e3e3
|