tnfr 4.3.0__py3-none-any.whl → 4.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tnfr might be problematic. Click here for more details.
- tnfr/__init__.py +41 -12
- tnfr/cli.py +53 -1
- tnfr/config.py +41 -0
- tnfr/constants.py +82 -25
- tnfr/dynamics.py +191 -42
- tnfr/gamma.py +17 -0
- tnfr/helpers.py +33 -21
- tnfr/metrics.py +368 -5
- tnfr/node.py +202 -0
- tnfr/observers.py +9 -1
- tnfr/operators.py +298 -125
- tnfr/structural.py +201 -0
- tnfr/types.py +2 -1
- tnfr/validators.py +38 -0
- tnfr-4.5.1.dist-info/METADATA +221 -0
- tnfr-4.5.1.dist-info/RECORD +28 -0
- tnfr-4.3.0.dist-info/METADATA +0 -109
- tnfr-4.3.0.dist-info/RECORD +0 -24
- {tnfr-4.3.0.dist-info → tnfr-4.5.1.dist-info}/WHEEL +0 -0
- {tnfr-4.3.0.dist-info → tnfr-4.5.1.dist-info}/entry_points.txt +0 -0
- {tnfr-4.3.0.dist-info → tnfr-4.5.1.dist-info}/licenses/LICENSE.md +0 -0
- {tnfr-4.3.0.dist-info → tnfr-4.5.1.dist-info}/top_level.txt +0 -0
tnfr/types.py
CHANGED
|
@@ -9,9 +9,10 @@ class NodeState:
|
|
|
9
9
|
vf: float = 1.0 # νf
|
|
10
10
|
theta: float = 0.0 # θ
|
|
11
11
|
Si: float = 0.5
|
|
12
|
+
epi_kind: str = ""
|
|
12
13
|
extra: Dict[str, Any] = field(default_factory=dict)
|
|
13
14
|
|
|
14
15
|
def to_attrs(self) -> Dict[str, Any]:
|
|
15
|
-
d = {"EPI": self.EPI, "νf": self.vf, "θ": self.theta, "Si": self.Si}
|
|
16
|
+
d = {"EPI": self.EPI, "νf": self.vf, "θ": self.theta, "Si": self.Si, "EPI_kind": self.epi_kind}
|
|
16
17
|
d.update(self.extra)
|
|
17
18
|
return d
|
tnfr/validators.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Validadores de invariantes TNFR."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from typing import Iterable
|
|
5
|
+
|
|
6
|
+
from .constants import ALIAS_EPI, DEFAULTS
|
|
7
|
+
from .helpers import _get_attr
|
|
8
|
+
from .sense import sigma_vector_global, GLYPHS_CANONICAL
|
|
9
|
+
from .helpers import last_glifo
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _validate_epi(G) -> None:
|
|
13
|
+
emin = float(G.graph.get("EPI_MIN", DEFAULTS.get("EPI_MIN", -1.0)))
|
|
14
|
+
emax = float(G.graph.get("EPI_MAX", DEFAULTS.get("EPI_MAX", 1.0)))
|
|
15
|
+
for n in G.nodes():
|
|
16
|
+
x = float(_get_attr(G.nodes[n], ALIAS_EPI, 0.0))
|
|
17
|
+
if not (emin - 1e-9 <= x <= emax + 1e-9):
|
|
18
|
+
raise ValueError(f"EPI fuera de rango en nodo {n}: {x}")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _validate_sigma(G) -> None:
|
|
22
|
+
sv = sigma_vector_global(G)
|
|
23
|
+
if sv.get("mag", 0.0) > 1.0 + 1e-9:
|
|
24
|
+
raise ValueError("Norma de σ excede 1")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _validate_glifos(G) -> None:
|
|
28
|
+
for n in G.nodes():
|
|
29
|
+
g = last_glifo(G.nodes[n])
|
|
30
|
+
if g and g not in GLYPHS_CANONICAL:
|
|
31
|
+
raise ValueError(f"Glifo inválido {g} en nodo {n}")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def run_validators(G) -> None:
|
|
35
|
+
"""Ejecuta todos los validadores de invariantes sobre ``G``."""
|
|
36
|
+
_validate_epi(G)
|
|
37
|
+
_validate_sigma(G)
|
|
38
|
+
_validate_glifos(G)
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tnfr
|
|
3
|
+
Version: 4.5.1
|
|
4
|
+
Summary: modular structural-based dynamics on networks
|
|
5
|
+
Author: fmg
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://pypi.org/project/tnfr/
|
|
8
|
+
Project-URL: Repository, https://github.com/fermga/Teoria-de-la-naturaleza-fractal-resonante-TNFR-
|
|
9
|
+
Keywords: TNFR,resonant fractal,resonance,glyphs,networkx,dynamics,coherence,EPI,Kuramoto
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Intended Audience :: Science/Research
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE.md
|
|
25
|
+
Requires-Dist: networkx>=2.6
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# tnfr · Python package
|
|
29
|
+
|
|
30
|
+
> Engine for **modeling, simulation, and measurement** of multiscale structural coherence through **structural operators** (emission, reception, coherence, dissonance, coupling, resonance, silence, expansion, contraction, self‑organization, mutation, transition, recursivity).
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## What is `tnfr`?
|
|
35
|
+
|
|
36
|
+
`tnfr` is a Python library to **operate with form**: build nodes, couple them into networks, and **modulate their coherence** over time using structural operators. It does not describe “things”; it **activates processes**. Its theoretical basis is the Resonant Fractal Nature Theory (TNFR), which understands reality as **networks of coherence** that persist because they **resonate**.
|
|
37
|
+
|
|
38
|
+
In practical terms, `tnfr` lets you:
|
|
39
|
+
|
|
40
|
+
* Model **Resonant Fractal Nodes (NFR)** with parameters for **frequency** (νf), **phase** (θ), and **form** (EPI).
|
|
41
|
+
* Apply **structural operators** to start, stabilize, propagate, or reconfigure coherence.
|
|
42
|
+
* **Simulate** nodal dynamics with discrete/continuous integrators.
|
|
43
|
+
* **Measure** global coherence C(t), nodal gradient ΔNFR, and the **Sense Index** (Si).
|
|
44
|
+
* **Visualize** states and trajectories (coupling matrices, C(t) curves, graphs).
|
|
45
|
+
|
|
46
|
+
> **Nodal equation (operational core)**
|
|
47
|
+
>
|
|
48
|
+
> $\frac{\partial \mathrm{EPI}}{\partial t} = \nu_f\,\cdot\,\Delta\mathrm{NFR}(t)$
|
|
49
|
+
>
|
|
50
|
+
> A form emerges and persists when **internal reorganization** (ΔNFR) **resonates** with the node’s **frequency** (νf).
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install tnfr
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Requires **Python ≥ 3.9**.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Why TNFR (in 60 seconds)
|
|
65
|
+
|
|
66
|
+
* **From objects to coherences:** you model **processes** that hold, not fixed entities.
|
|
67
|
+
* **Operators instead of rules:** you compose **structural operators** (e.g., *emission*, *coherence*, *dissonance*) to **build trajectories**.
|
|
68
|
+
* **Operational fractality:** the same pattern works for **ideas, teams, tissues, narratives**; the scales change, **the logic doesn’t**.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Getting started (minimal recipe)
|
|
73
|
+
|
|
74
|
+
> *The high‑level API centers on three things: nodes, operators, simulation.*
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
# 1) Nodes and network
|
|
78
|
+
import tnfr as T
|
|
79
|
+
|
|
80
|
+
# A minimal set of nodes with initial frequency (νf)
|
|
81
|
+
A = T.Node(label="seed", nu_f=0.8)
|
|
82
|
+
B = T.Node(label="context", nu_f=0.6)
|
|
83
|
+
net = T.Network([A, B], edges=[(A, B, 0.7)]) # coupling 0..1
|
|
84
|
+
|
|
85
|
+
# 2) Sequence of structural operators
|
|
86
|
+
ops = [
|
|
87
|
+
T.ops.Emission(strength=0.4), # start pattern
|
|
88
|
+
T.ops.Coupling(weight=0.7), # synchronize nodes
|
|
89
|
+
T.ops.Coherence(), # stabilize form
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
# 3) Simulation and metrics
|
|
93
|
+
traj = T.sim.run(net, ops, steps=200, dt=0.05)
|
|
94
|
+
print("C(t) =", T.metrics.coherence(traj)[-1])
|
|
95
|
+
print("Si =", T.metrics.sense_index(traj))
|
|
96
|
+
|
|
97
|
+
# 4) Quick visualization
|
|
98
|
+
T.viz.plot_coherence(traj) # C(t) curve
|
|
99
|
+
T.viz.plot_network(net) # graph/couplings
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
> **Note:** Specific class/function names may vary across minor versions. Check `help(T.ops)` and `help(T.sim)` for your installed API.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Key concepts (operational summary)
|
|
107
|
+
|
|
108
|
+
* **Node (NFR):** a unit that persists because it **resonates**. Parameterized by **νf** (frequency), **θ** (phase), and **EPI** (coherent form).
|
|
109
|
+
* **Structural operators:** functions that reorganize the network. We use **functional** names (not phonemes):
|
|
110
|
+
|
|
111
|
+
* **Emission** (start), **Reception** (open), **Coherence** (stabilize), **Dissonance** (creative tension), **Coupling** (synchrony), **Resonance** (propagate), **Silence** (latency), **Expansion**, **Contraction**, **Self‑organization**, **Mutation**, **Transition**, **Recursivity**.
|
|
112
|
+
* **Magnitudes:**
|
|
113
|
+
|
|
114
|
+
* **C(t):** global coherence.
|
|
115
|
+
* **ΔNFR:** nodal gradient (need for reorganization).
|
|
116
|
+
* **νf:** structural frequency (Hz\_str).
|
|
117
|
+
* **Si:** sense index (ability to generate stable shared coherence).
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Typical workflow
|
|
122
|
+
|
|
123
|
+
1. **Model** your system as a network: nodes (agents, ideas, tissues, modules) and couplings.
|
|
124
|
+
2. **Select** a **trajectory of operators** aligned with your goal (e.g., *start → couple → stabilize*).
|
|
125
|
+
3. **Simulate** the dynamics: number of steps, step size, tolerances.
|
|
126
|
+
4. **Measure**: C(t), ΔNFR, Si; identify bifurcations and collapses.
|
|
127
|
+
5. **Iterate** with controlled **dissonance** to open mutations without losing form.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## High‑level API (orientation map)
|
|
132
|
+
|
|
133
|
+
> The typical module layout in `tnfr` is:
|
|
134
|
+
|
|
135
|
+
* `tnfr.core`: `Node`, `Network`, `EPI`, `State`
|
|
136
|
+
* `tnfr.ops`: structural operators (Emission, Reception, Coherence, Dissonance, ...)
|
|
137
|
+
* `tnfr.sim`: integrators (`run`, `step`, `integrate`), dt control and thresholds
|
|
138
|
+
* `tnfr.metrics`: `coherence`, `gradient`, `sense_index`, `phase_sync`
|
|
139
|
+
* `tnfr.viz`: plotting utilities (`plot_coherence`, `plot_network`, `plot_phase`)
|
|
140
|
+
|
|
141
|
+
Usage examples:
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
from tnfr import core, ops, sim, metrics
|
|
145
|
+
|
|
146
|
+
net = core.Network.from_edges([
|
|
147
|
+
("n1", "n2", 0.6),
|
|
148
|
+
("n2", "n3", 0.8),
|
|
149
|
+
])
|
|
150
|
+
|
|
151
|
+
sequence = [ops.Emission(0.3), ops.Coupling(0.5), ops.Coherence()]
|
|
152
|
+
traj = sim.run(net, sequence, steps=500)
|
|
153
|
+
|
|
154
|
+
print(metrics.coherence(traj))
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Parametric modeling
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
import tnfr as T
|
|
163
|
+
|
|
164
|
+
net = T.Network.uniform(n=25, nu_f=0.4, coupling=0.3)
|
|
165
|
+
plan = (
|
|
166
|
+
T.ops.Emission(0.2)
|
|
167
|
+
>> T.ops.Expansion(0.4)
|
|
168
|
+
>> T.ops.Coupling(0.6)
|
|
169
|
+
>> T.ops.Coherence()
|
|
170
|
+
)
|
|
171
|
+
traj = T.sim.run(net, plan, steps=800)
|
|
172
|
+
T.viz.plot_phase(traj)
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Main metrics
|
|
178
|
+
|
|
179
|
+
* `coherence(traj) → C(t)`: global stability; higher values indicate sustained form.
|
|
180
|
+
* `gradient(state) → ΔNFR`: local demand for reorganization (high = risk of collapse/bifurcation).
|
|
181
|
+
* `sense_index(traj) → Si`: proxy for **structural sense** (capacity to generate shared coherence) combining **νf**, phase, and topology.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Best practices
|
|
186
|
+
|
|
187
|
+
* **Short sequences** and frequent C(t) checks avoid unnecessary collapses.
|
|
188
|
+
* Use **dissonance** as a tool: introduce it to open possibilities, but **seal** with coherence.
|
|
189
|
+
* **Scale first, detail later:** tune coarse couplings before micro‑parameters.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Project status
|
|
194
|
+
|
|
195
|
+
* **pre‑1.0 API**: signatures may be refined; concepts and magnitudes are stable.
|
|
196
|
+
* **Pure‑Python** core with minimal dependencies (optional: `numpy`, `matplotlib`, `networkx`).
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Contributing
|
|
201
|
+
|
|
202
|
+
Suggestions, issues, and PRs are welcome. Guidelines:
|
|
203
|
+
|
|
204
|
+
1. Prioritize **operational clarity** (names, docstrings, examples).
|
|
205
|
+
2. Add **tests** and **notebooks** that show the structural effect of each PR.
|
|
206
|
+
3. Keep **semantic neutrality**: operators act on form, not on contents.
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## License
|
|
211
|
+
|
|
212
|
+
MIT
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## References & notes
|
|
217
|
+
|
|
218
|
+
* Theoretical foundations: TNFR operational manual.
|
|
219
|
+
* Operational definitions: nodal equation, dimensions (frequency, phase, form), and structural operators.
|
|
220
|
+
|
|
221
|
+
> If you use `tnfr` in research or projects, please cite the TNFR conceptual framework and link to the PyPI package.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
tnfr/__init__.py,sha256=2j-PNqXRQxiMOsq6qEZ33XZ59vuqrvLXq7g4GCxAwDw,2790
|
|
2
|
+
tnfr/cli.py,sha256=7OR3dlWUVjEKVH_itH-zYq8WQculXwSdCDDvmQH15kY,14372
|
|
3
|
+
tnfr/config.py,sha256=bFc5AnLVoF0oUrSedAi5WpD6oCvn4hhLHO7WGgslg2M,1303
|
|
4
|
+
tnfr/constants.py,sha256=XoUlTuUaQgQ6BbHzKSIHijqRMf9Gb3Avjo7_CLicgps,11570
|
|
5
|
+
tnfr/dynamics.py,sha256=An0MlAJVhCy5uCQsl3c_PZKdAKBZojgRCnTAQzfaahg,32799
|
|
6
|
+
tnfr/gamma.py,sha256=U1yXbv4ef9VSwXirjRlcwdNr78Ah5LstAsg5WIkRQxY,4083
|
|
7
|
+
tnfr/grammar.py,sha256=vz5F0P3IfvA6HassRcoD327hBP5vCUw-xPSTsPmqwhQ,5363
|
|
8
|
+
tnfr/helpers.py,sha256=KT9_CAz3Z-WRKdARyGnsQ16m-p2z-l1-Y6UhVyY8tcU,8323
|
|
9
|
+
tnfr/main.py,sha256=XqjI1YEdF-OqRzTMa5dYIxCig4qyAR-l1FPcyxpC8WY,1926
|
|
10
|
+
tnfr/metrics.py,sha256=MTp0YifWdycW-jUFWhvxbJx-labWUR0thTnS0sxifrg,20259
|
|
11
|
+
tnfr/node.py,sha256=A3nlaW_lwG0Q1dj6HPmyjfccWfZt4rwnzqPxTglu-Sk,6184
|
|
12
|
+
tnfr/observers.py,sha256=7bdxYCXVDwHeSeeyI9IalogMuxaZYy2MafDs9rWEyQY,5979
|
|
13
|
+
tnfr/ontosim.py,sha256=9GfEtiLIdJOPJUTufcq_MssAA9J8AfChHU6HKb3DIJY,5628
|
|
14
|
+
tnfr/operators.py,sha256=TSY2LNIC-um3iSwniYiyu6oumnDwiES2zwb2B7ZbEZE,20536
|
|
15
|
+
tnfr/presets.py,sha256=qFuDxlexc_kw--3VRaOx3cfyL6vPEOX_UVsJd2DNWAE,998
|
|
16
|
+
tnfr/program.py,sha256=eim7D8zsbbkGDWbODag-0VKG44jEYioX4Sl6KRwgVtw,6038
|
|
17
|
+
tnfr/scenarios.py,sha256=QkUdCHp5R5T44fgfGppJ8dHzZa6avdNTNsYJbya_7XM,1165
|
|
18
|
+
tnfr/sense.py,sha256=9ABkqHjwu5pxoakddZwANpp9xy_NNo4frm9NGTg1GXQ,6482
|
|
19
|
+
tnfr/structural.py,sha256=hE5_l7cuiPad9AuFVrFtnkJ8A8eL_e69gUN5VknkQiI,5155
|
|
20
|
+
tnfr/trace.py,sha256=e_xdOOMZ5rqXOcdw99h8X1RnVuf_s9AeTzncqS551hE,4735
|
|
21
|
+
tnfr/types.py,sha256=CnSwzzh9d0WgqB128y71iNWiiAA7Sf-eJ_v1xHMAwLo,507
|
|
22
|
+
tnfr/validators.py,sha256=tCsz9A8OvEKiBZX9wvvri_C894XXdWfkbEZ6qqpcdNg,1169
|
|
23
|
+
tnfr-4.5.1.dist-info/licenses/LICENSE.md,sha256=SRvvhXLrKtseuK6DARbuJffuXOXqAyk3wvF2n0t1SWA,1109
|
|
24
|
+
tnfr-4.5.1.dist-info/METADATA,sha256=EQzW2AFCOyt8eVHWaqk5ka1MIzHCUn1IRRg8x1czxbA,8119
|
|
25
|
+
tnfr-4.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
26
|
+
tnfr-4.5.1.dist-info/entry_points.txt,sha256=j4-QRHqeT2WnchHe_mvK7npGTLjlyfLpvRONFe9Z4MU,39
|
|
27
|
+
tnfr-4.5.1.dist-info/top_level.txt,sha256=Q2HJnvc5Rt2VHwVvyBTnNPT4SfmJWnCj7XUxxEvQa7c,5
|
|
28
|
+
tnfr-4.5.1.dist-info/RECORD,,
|
tnfr-4.3.0.dist-info/METADATA
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: tnfr
|
|
3
|
-
Version: 4.3.0
|
|
4
|
-
Summary: Canonical TNFR: modular glyph-based dynamics on networks.
|
|
5
|
-
Author: fmg
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://pypi.org/project/tnfr/
|
|
8
|
-
Project-URL: Repository, https://github.com/fermga/Teoria-de-la-naturaleza-fractal-resonante-TNFR-
|
|
9
|
-
Keywords: TNFR,resonant fractal,resonance,glyphs,networkx,dynamics,coherence,EPI,Kuramoto
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
-
Classifier: Operating System :: OS Independent
|
|
19
|
-
Classifier: Intended Audience :: Science/Research
|
|
20
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
-
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
22
|
-
Requires-Python: >=3.9
|
|
23
|
-
Description-Content-Type: text/markdown
|
|
24
|
-
License-File: LICENSE.md
|
|
25
|
-
Requires-Dist: networkx>=2.6
|
|
26
|
-
Dynamic: license-file
|
|
27
|
-
|
|
28
|
-
# TNFR — Canonical Glyph-Based Dynamics
|
|
29
|
-
|
|
30
|
-
Reference implementation of the Resonant Fractal Nature Theory (TNFR).
|
|
31
|
-
It models glyph-driven dynamics on NetworkX graphs, providing a modular
|
|
32
|
-
engine to simulate coherent reorganization processes.
|
|
33
|
-
|
|
34
|
-
## General Project Structure
|
|
35
|
-
|
|
36
|
-
* **Package entry point.** `__init__.py` registers modules under short names to avoid circular imports and exposes the public API: `preparar_red`, `step`, `run`, and observation utilities.
|
|
37
|
-
|
|
38
|
-
* **Configuration & constants.** `constants.py` centralizes default parameters (discretization, EPI and νf ranges, mixing weights, re-mesh limits, etc.) and provides utilities to inject them into the network (`attach_defaults`, `merge_overrides`), along with standardized aliases for node attributes.
|
|
39
|
-
|
|
40
|
-
* **Cross-cutting utilities.** `helpers.py` offers core numeric helpers, alias-based attribute accessors, neighborhood statistics, glyph history, a callback system, and computation of the sense index `Si` for each node.
|
|
41
|
-
|
|
42
|
-
* **Dynamics engine.** `dynamics.py` implements the simulation loop: ΔNFR field computation, nodal equation integration, glyph selection/application, clamps, phase coordination, history updates, and conditional re-mesh (`step` and `run`).
|
|
43
|
-
|
|
44
|
-
* **Glyph operators.** `operators.py` defines the 13 glyphs as local transformations, a dispatcher `aplicar_glifo`, and both direct and stability-conditioned re-mesh utilities.
|
|
45
|
-
|
|
46
|
-
* **Observers & metrics.** `observers.py` registers standard callbacks and computes global coherence, phase synchrony, Kuramoto order, glyph distribution, and the sense vector `Σ⃗`, among others.
|
|
47
|
-
|
|
48
|
-
* **Simulation orchestration.** `ontosim.py` prepares a NetworkX graph, attaches configuration, and initializes attributes (EPI, phases, frequencies) before delegating dynamics to `dynamics.step`/`run`.
|
|
49
|
-
|
|
50
|
-
* **Demo CLI.** `main.py` generates an Erdős–Rényi network, lets you tweak basic parameters, and runs the simulation while displaying final metrics.
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Key Concepts to Grasp
|
|
55
|
-
|
|
56
|
-
* **Aliased dependency tree.** Modules import each other via global aliases to simplify access and prevent cycles—essential for navigating the code unambiguously.
|
|
57
|
-
|
|
58
|
-
* **Normalized node attributes.** All data (EPI, phase `θ`, frequency `νf`, `ΔNFR`, etc.) live in `G.nodes[n]` under compatible alias names, making extensions and custom hooks straightforward.
|
|
59
|
-
|
|
60
|
-
* **Sense Index (`Si`).** Combines normalized frequency, phase dispersion, and field magnitude to evaluate each node’s “sense,” influencing glyph selection.
|
|
61
|
-
|
|
62
|
-
* **Step-wise engine.** `dynamics.step` orchestrates eight phases: field computation, `Si`, glyph selection & application, integration, clamps, phase coordination, history update, and conditioned re-mesh.
|
|
63
|
-
|
|
64
|
-
* **Glyphs as operators.** Each glyph applies a smooth transformation to node attributes (emission, diffusion, coupling, dissonance, etc.), dispatched by a configurable, typographic name.
|
|
65
|
-
|
|
66
|
-
* **Network re-mesh.** Mixes the current state with a past one (memory `τ`) to stabilize the network, with clear precedence for `α` and conditions based on recent stability and synchrony history.
|
|
67
|
-
|
|
68
|
-
* **Γ(R) coupling.** Optional network term added to the nodal equation, parameterized by global phase order `R` with gain `β` and threshold `R0` (see `DEFAULTS["GAMMA"]`).
|
|
69
|
-
|
|
70
|
-
* **Callbacks & observers.** The `Γ(R)` system lets you hook functions before/after each step and after re-mesh, enabling monitoring or external intervention.
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## Recommendations for Going Deeper
|
|
75
|
-
|
|
76
|
-
* **NetworkX & the Graph API.** Get comfortable with how NetworkX handles attributes and topology; all dynamics operate on `Graph` objects and their properties.
|
|
77
|
-
|
|
78
|
-
* **Extending the ΔNFR field.** Explore `set_delta_nfr_hook` to implement alternative nodal fields and learn how metadata and mixing weights are recorded.
|
|
79
|
-
|
|
80
|
-
* **Designing new glyphs.** Review `operators.py` to add operators or adjust factors in `DEFAULTS['GLYPH_FACTORS']`.
|
|
81
|
-
|
|
82
|
-
* **Custom observers.** Implement your own metrics via `register_callback` or by extending `observers.py` to measure phenomena specific to your study.
|
|
83
|
-
|
|
84
|
-
* **Theoretical reading.** For conceptual background, see the included PDFs (`TNFR.pdf`, *El Pulso que nos Atraviesa*), which deepen the fractal-resonant framework.
|
|
85
|
-
|
|
86
|
-
* **Advanced parameters.** Experiment with adaptive phase coordination, stability criteria, and the glyph grammar to observe their impact on network self-organization.
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
**Mastering these pieces will let you extend the simulation, build analysis pipelines and connect the theory with computational applications.**
|
|
91
|
-
|
|
92
|
-
## Optional Node environment
|
|
93
|
-
The repository includes a minimal `package.json` and `netlify.toml` used for an experimental Remix web demo. They are not required for the core Python package; feel free to ignore them unless you plan to build the demo via `npm run build`.
|
|
94
|
-
|
|
95
|
-
## Testing
|
|
96
|
-
|
|
97
|
-
Install the dependencies and project in editable mode before running the test suite with `pytest`:
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
pip install networkx
|
|
101
|
-
pip install -e .
|
|
102
|
-
pytest
|
|
103
|
-
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## Installation
|
|
107
|
-
```
|
|
108
|
-
pip install tnfr
|
|
109
|
-
```
|
tnfr-4.3.0.dist-info/RECORD
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
tnfr/__init__.py,sha256=g3v2NoMYZuOvxALTpNMyj-bddJDyQWaZ5poV6vFYqCg,2051
|
|
2
|
-
tnfr/cli.py,sha256=DyJlawWo-mC44RZz4UR4WseqZymcc_zfo49ivZjtkxY,11744
|
|
3
|
-
tnfr/constants.py,sha256=PTAX5ZGCiU2lmBNSIsmS402BWS-oTKhQV6wBGL_-SxM,9549
|
|
4
|
-
tnfr/dynamics.py,sha256=913qUr-Jv495ocPBzd6vxkhKIKrKXXkqnBNzrUlnj7A,27556
|
|
5
|
-
tnfr/gamma.py,sha256=7ZOYoa0dMyxapu_ok8syWa6fIIdgR5XGgNhVIf1Np44,3466
|
|
6
|
-
tnfr/grammar.py,sha256=vz5F0P3IfvA6HassRcoD327hBP5vCUw-xPSTsPmqwhQ,5363
|
|
7
|
-
tnfr/helpers.py,sha256=2Y6hEShM3EHxRIYCir2GvxZWtRVAUTw9ERKITf_BcIw,7873
|
|
8
|
-
tnfr/main.py,sha256=XqjI1YEdF-OqRzTMa5dYIxCig4qyAR-l1FPcyxpC8WY,1926
|
|
9
|
-
tnfr/metrics.py,sha256=z85robiGF9CDVPen98fN00Qih7xknqvrkGOW_BIkGUs,7769
|
|
10
|
-
tnfr/observers.py,sha256=PTw3hxk7KD-Yx_CvCIU09icuhyYD6uNU6SvF80UvP-Y,5354
|
|
11
|
-
tnfr/ontosim.py,sha256=9GfEtiLIdJOPJUTufcq_MssAA9J8AfChHU6HKb3DIJY,5628
|
|
12
|
-
tnfr/operators.py,sha256=aEiWF_9XLTsREe56urEH6aU_Hpu5tGxPbg4cWcGBLvs,15139
|
|
13
|
-
tnfr/presets.py,sha256=qFuDxlexc_kw--3VRaOx3cfyL6vPEOX_UVsJd2DNWAE,998
|
|
14
|
-
tnfr/program.py,sha256=eim7D8zsbbkGDWbODag-0VKG44jEYioX4Sl6KRwgVtw,6038
|
|
15
|
-
tnfr/scenarios.py,sha256=QkUdCHp5R5T44fgfGppJ8dHzZa6avdNTNsYJbya_7XM,1165
|
|
16
|
-
tnfr/sense.py,sha256=9ABkqHjwu5pxoakddZwANpp9xy_NNo4frm9NGTg1GXQ,6482
|
|
17
|
-
tnfr/trace.py,sha256=e_xdOOMZ5rqXOcdw99h8X1RnVuf_s9AeTzncqS551hE,4735
|
|
18
|
-
tnfr/types.py,sha256=xyFHp0PptEqPNUekAFH6DcAnyMx4bCQutMyFUXMd2sA,457
|
|
19
|
-
tnfr-4.3.0.dist-info/licenses/LICENSE.md,sha256=SRvvhXLrKtseuK6DARbuJffuXOXqAyk3wvF2n0t1SWA,1109
|
|
20
|
-
tnfr-4.3.0.dist-info/METADATA,sha256=L25IajD448ZSlOLJikBDahMQzl8LQCSKdMfOUVJEx3g,6321
|
|
21
|
-
tnfr-4.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
-
tnfr-4.3.0.dist-info/entry_points.txt,sha256=j4-QRHqeT2WnchHe_mvK7npGTLjlyfLpvRONFe9Z4MU,39
|
|
23
|
-
tnfr-4.3.0.dist-info/top_level.txt,sha256=Q2HJnvc5Rt2VHwVvyBTnNPT4SfmJWnCj7XUxxEvQa7c,5
|
|
24
|
-
tnfr-4.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|