tnfr 2.0.1__py3-none-any.whl → 3.0.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 CHANGED
@@ -1,47 +1,58 @@
1
1
  from __future__ import annotations
2
- import argparse
3
- import sys
4
- import networkx as nx
5
-
6
- from . import preparar_red, run, attach_standard_observer, __version__
7
-
8
- def main(argv: list[str] | None = None) -> None:
9
- p = argparse.ArgumentParser(
10
- prog="tnfr",
11
- description="TNFR canónica — demo CLI (orquesta step/run sobre una red aleatoria)",
12
- )
13
- p.add_argument("--version", action="store_true", help="muestra versión y sale")
14
- p.add_argument("--n", type=int, default=30, help="nodos (Erdős–Rényi)")
15
- p.add_argument("--p", type=float, default=0.15, help="probabilidad de arista (Erdős–Rényi)")
16
- p.add_argument("--steps", type=int, default=100, help="pasos a simular")
17
- p.add_argument("--observer", action="store_true", help="adjunta observador estándar")
18
-
19
-
20
- args = p.parse_args(argv)
21
- if args.version:
22
- print(__version__)
23
- return
24
-
25
-
26
- G = nx.erdos_renyi_graph(args.n, args.p)
27
- G.graph["ATTACH_STD_OBSERVER"] = bool(args.observer)
28
-
29
-
30
- preparar_red(G)
31
- run(G, args.steps)
32
-
33
-
34
- # resumen rápido al final
35
- h = G.graph.get("history", {})
36
- C = h.get("C_steps", [])[-1] if h.get("C_steps") else None
37
- stab = h.get("stable_frac", [])[-1] if h.get("stable_frac") else None
38
- R = h.get("kuramoto_R", [])[-1] if h.get("kuramoto_R") else None
39
-
40
-
41
- print("TNFR terminado:")
42
- if C is not None: print(f" C(t) ~ {C:.3f}")
43
- if stab is not None: print(f" estable ~ {stab:.3f}")
44
- if R is not None: print(f" R (Kuramoto) ~ {R:.3f}")
45
-
46
- if __name__ == "__main__":
47
- main(sys.argv[1:])
2
+ """
3
+ TNFR — Teoría de la Naturaleza Fractal Resonante
4
+ API pública del paquete.
5
+
6
+ Principio operativo (ecuación nodal):
7
+ ∂EPI/∂t = νf · ΔNFR(t)
8
+
9
+ Re-exporta:
10
+ - preparar_red
11
+ - step, run, set_delta_nfr_hook
12
+ - attach_standard_observer, coherencia_global, orden_kuramoto
13
+ """
14
+
15
+ __version__ = "3.0.1"
16
+
17
+ # -------------------------------------------------------------------
18
+ # 1) Registrar alias ANTES de importar submódulos que usan imports
19
+ # absolutos (p.ej. `from constants import DEFAULTS`)
20
+ # -------------------------------------------------------------------
21
+ import sys as _sys
22
+
23
+ from . import constants as _constants
24
+ from . import helpers as _helpers
25
+ from . import operators as _operators
26
+ from . import observers as _observers
27
+
28
+ _sys.modules.setdefault("constants", _constants)
29
+ _sys.modules.setdefault("helpers", _helpers)
30
+ _sys.modules.setdefault("operators", _operators)
31
+ _sys.modules.setdefault("observers", _observers)
32
+
33
+ # -------------------------------------------------------------------
34
+ # 2) Ahora sí: importar módulos que dependen de esos alias
35
+ # -------------------------------------------------------------------
36
+ from .dynamics import step, run, set_delta_nfr_hook
37
+ from .ontosim import preparar_red
38
+ from .observers import attach_standard_observer, coherencia_global, orden_kuramoto
39
+
40
+ # (opcional) exponer también alias para `dynamics` y `ontosim`
41
+ # si algún código externo hace `from dynamics import run`, etc.
42
+ import types as _types
43
+ import importlib as _importlib
44
+
45
+ _dynamics_mod = _importlib.import_module(__name__ + ".dynamics")
46
+ _ontosim_mod = _importlib.import_module(__name__ + ".ontosim")
47
+ _sys.modules.setdefault("dynamics", _dynamics_mod)
48
+ _sys.modules.setdefault("ontosim", _ontosim_mod)
49
+
50
+ # -------------------------------------------------------------------
51
+ # 3) API pública
52
+ # -------------------------------------------------------------------
53
+ __all__ = [
54
+ "preparar_red",
55
+ "step", "run", "set_delta_nfr_hook",
56
+ "attach_standard_observer", "coherencia_global", "orden_kuramoto",
57
+ "__version__",
58
+ ]
tnfr/main.py CHANGED
@@ -0,0 +1,37 @@
1
+ from __future__ import annotations
2
+ import argparse, sys
3
+ import networkx as nx
4
+ from . import preparar_red, run, __version__
5
+
6
+ def main(argv: list[str] | None = None) -> None:
7
+ p = argparse.ArgumentParser(
8
+ prog="tnfr",
9
+ description="TNFR canónica — demo CLI (red Erdős–Rényi + dinámica glífica)",
10
+ )
11
+ p.add_argument("--version", action="store_true", help="muestra versión y sale")
12
+ p.add_argument("--n", type=int, default=30, help="nodos (Erdős–Rényi)")
13
+ p.add_argument("--p", type=float, default=0.15, help="probabilidad de arista (Erdős–Rényi)")
14
+ p.add_argument("--steps", type=int, default=100, help="pasos a simular")
15
+ p.add_argument("--observer", action="store_true", help="adjunta observador estándar")
16
+ args = p.parse_args(argv)
17
+
18
+ if args.version:
19
+ print(__version__)
20
+ return
21
+
22
+ G = nx.erdos_renyi_graph(args.n, args.p)
23
+ preparar_red(G, ATTACH_STD_OBSERVER=bool(args.observer))
24
+ run(G, args.steps)
25
+
26
+ h = G.graph.get("history", {})
27
+ C = h.get("C_steps", [])[-1] if h.get("C_steps") else None
28
+ stab = h.get("stable_frac", [])[-1] if h.get("stable_frac") else None
29
+ R = h.get("kuramoto_R", [])[-1] if h.get("kuramoto_R") else None
30
+
31
+ print("TNFR terminado:")
32
+ if C is not None: print(f" C(t) ~ {C:.3f}")
33
+ if stab is not None: print(f" estable ~ {stab:.3f}")
34
+ if R is not None: print(f" R (Kuramoto) ~ {R:.3f}")
35
+
36
+ if __name__ == "__main__":
37
+ main(sys.argv[1:])
@@ -1,17 +1,24 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tnfr
3
- Version: 2.0.1
3
+ Version: 3.0.1
4
4
  Summary: TNFR canónica: dinámica glífica modular sobre redes.
5
5
  Author: Fer
6
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,fractal resonante,resonancia,glifos,networkx,dinámica,coherencia,EPI,Kuramoto
7
10
  Classifier: Programming Language :: Python :: 3
8
11
  Classifier: Programming Language :: Python :: 3 :: Only
9
12
  Classifier: Programming Language :: Python :: 3.9
10
13
  Classifier: Programming Language :: Python :: 3.10
11
14
  Classifier: Programming Language :: Python :: 3.11
12
15
  Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
13
17
  Classifier: License :: OSI Approved :: MIT License
14
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
15
22
  Requires-Python: >=3.9
16
23
  Description-Content-Type: text/markdown
17
24
  License-File: LICENSE.txt
@@ -0,0 +1,13 @@
1
+ tnfr/__init__.py,sha256=KFOkKW99ZQR_czFQ2oyWf3fEGFPBOXXZIs6HLtbAPfc,2135
2
+ tnfr/constants.py,sha256=_775sPHussR9vgkWRCLC6dzwgk_1_lLnSlWT8sBWR3U,7677
3
+ tnfr/dynamics.py,sha256=7B38c9SVKLVFBrKHeJ1nXbghoRHfDs8Nl9CqUmCcAyI,23260
4
+ tnfr/helpers.py,sha256=tZJsDXc8k9HIfg8BA9cVUEFKBoX1Rfnuhurl2Fvxsy0,6017
5
+ tnfr/main.py,sha256=TEngteuC9MD7Ec9bNGuCC9ym-2ohbh202-HGArCR4tk,1506
6
+ tnfr/observers.py,sha256=MoC-xLJuMP-UYj8cpIVlgSbXDsE1Uj70Zy51PSH3AJY,5192
7
+ tnfr/ontosim.py,sha256=U0IeNVF8rFNhnmWWux91xDc0djTDZQkqRRosP6Z7FmE,5485
8
+ tnfr/operators.py,sha256=M6ahJL8IuB2y4qiEalge5EufCz0eEbhw-O4xfh3NpwE,12146
9
+ tnfr-3.0.1.dist-info/licenses/LICENSE.txt,sha256=xTjBNhy3N8pomFljrCkD1d34SmAEWv8hyJMMOjNMH0M,1071
10
+ tnfr-3.0.1.dist-info/METADATA,sha256=llsEctHecy9-uddgAq6Xw7CmJrwRamSH0bZ4Ov95Q28,1325
11
+ tnfr-3.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ tnfr-3.0.1.dist-info/top_level.txt,sha256=Q2HJnvc5Rt2VHwVvyBTnNPT4SfmJWnCj7XUxxEvQa7c,5
13
+ tnfr-3.0.1.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- tnfr/__init__.py,sha256=o0EN91tVau9YxuN7W17xk4KD7M7wtk6PVwuTcMw8Cbk,1601
2
- tnfr/constants.py,sha256=_775sPHussR9vgkWRCLC6dzwgk_1_lLnSlWT8sBWR3U,7677
3
- tnfr/dynamics.py,sha256=7B38c9SVKLVFBrKHeJ1nXbghoRHfDs8Nl9CqUmCcAyI,23260
4
- tnfr/helpers.py,sha256=tZJsDXc8k9HIfg8BA9cVUEFKBoX1Rfnuhurl2Fvxsy0,6017
5
- tnfr/main.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- tnfr/observers.py,sha256=MoC-xLJuMP-UYj8cpIVlgSbXDsE1Uj70Zy51PSH3AJY,5192
7
- tnfr/ontosim.py,sha256=U0IeNVF8rFNhnmWWux91xDc0djTDZQkqRRosP6Z7FmE,5485
8
- tnfr/operators.py,sha256=M6ahJL8IuB2y4qiEalge5EufCz0eEbhw-O4xfh3NpwE,12146
9
- tnfr-2.0.1.dist-info/licenses/LICENSE.txt,sha256=xTjBNhy3N8pomFljrCkD1d34SmAEWv8hyJMMOjNMH0M,1071
10
- tnfr-2.0.1.dist-info/METADATA,sha256=PbHEXhc_39gusakjfFSN_ky5ODSV_UPaSeW32KFlFbY,831
11
- tnfr-2.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- tnfr-2.0.1.dist-info/entry_points.txt,sha256=ybvBewhP43jPrDialnQ7XkhpK5LXotzJXIRFyeXmxZo,44
13
- tnfr-2.0.1.dist-info/top_level.txt,sha256=Q2HJnvc5Rt2VHwVvyBTnNPT4SfmJWnCj7XUxxEvQa7c,5
14
- tnfr-2.0.1.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- tnfr = tnfr.__main__:main
File without changes