tnfr 4.5.2__py3-none-any.whl → 7.0.0__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.

Files changed (195) hide show
  1. tnfr/__init__.py +275 -51
  2. tnfr/__init__.pyi +33 -0
  3. tnfr/_compat.py +10 -0
  4. tnfr/_generated_version.py +34 -0
  5. tnfr/_version.py +49 -0
  6. tnfr/_version.pyi +7 -0
  7. tnfr/alias.py +117 -31
  8. tnfr/alias.pyi +108 -0
  9. tnfr/cache.py +6 -572
  10. tnfr/cache.pyi +16 -0
  11. tnfr/callback_utils.py +16 -38
  12. tnfr/callback_utils.pyi +79 -0
  13. tnfr/cli/__init__.py +34 -14
  14. tnfr/cli/__init__.pyi +26 -0
  15. tnfr/cli/arguments.py +211 -28
  16. tnfr/cli/arguments.pyi +27 -0
  17. tnfr/cli/execution.py +470 -50
  18. tnfr/cli/execution.pyi +70 -0
  19. tnfr/cli/utils.py +18 -3
  20. tnfr/cli/utils.pyi +8 -0
  21. tnfr/config/__init__.py +13 -0
  22. tnfr/config/__init__.pyi +10 -0
  23. tnfr/{constants_glyphs.py → config/constants.py} +26 -20
  24. tnfr/config/constants.pyi +12 -0
  25. tnfr/config/feature_flags.py +83 -0
  26. tnfr/{config.py → config/init.py} +11 -7
  27. tnfr/config/init.pyi +8 -0
  28. tnfr/config/operator_names.py +93 -0
  29. tnfr/config/operator_names.pyi +28 -0
  30. tnfr/config/presets.py +84 -0
  31. tnfr/config/presets.pyi +7 -0
  32. tnfr/constants/__init__.py +80 -29
  33. tnfr/constants/__init__.pyi +92 -0
  34. tnfr/constants/aliases.py +31 -0
  35. tnfr/constants/core.py +4 -4
  36. tnfr/constants/core.pyi +17 -0
  37. tnfr/constants/init.py +1 -1
  38. tnfr/constants/init.pyi +12 -0
  39. tnfr/constants/metric.py +7 -15
  40. tnfr/constants/metric.pyi +19 -0
  41. tnfr/dynamics/__init__.py +165 -633
  42. tnfr/dynamics/__init__.pyi +82 -0
  43. tnfr/dynamics/adaptation.py +267 -0
  44. tnfr/dynamics/aliases.py +23 -0
  45. tnfr/dynamics/coordination.py +385 -0
  46. tnfr/dynamics/dnfr.py +2283 -400
  47. tnfr/dynamics/dnfr.pyi +24 -0
  48. tnfr/dynamics/integrators.py +406 -98
  49. tnfr/dynamics/integrators.pyi +34 -0
  50. tnfr/dynamics/runtime.py +881 -0
  51. tnfr/dynamics/sampling.py +10 -5
  52. tnfr/dynamics/sampling.pyi +7 -0
  53. tnfr/dynamics/selectors.py +719 -0
  54. tnfr/execution.py +70 -48
  55. tnfr/execution.pyi +45 -0
  56. tnfr/flatten.py +13 -9
  57. tnfr/flatten.pyi +21 -0
  58. tnfr/gamma.py +66 -53
  59. tnfr/gamma.pyi +34 -0
  60. tnfr/glyph_history.py +110 -52
  61. tnfr/glyph_history.pyi +35 -0
  62. tnfr/glyph_runtime.py +16 -0
  63. tnfr/glyph_runtime.pyi +9 -0
  64. tnfr/immutable.py +69 -28
  65. tnfr/immutable.pyi +34 -0
  66. tnfr/initialization.py +16 -16
  67. tnfr/initialization.pyi +65 -0
  68. tnfr/io.py +6 -240
  69. tnfr/io.pyi +16 -0
  70. tnfr/locking.pyi +7 -0
  71. tnfr/mathematics/__init__.py +81 -0
  72. tnfr/mathematics/backend.py +426 -0
  73. tnfr/mathematics/dynamics.py +398 -0
  74. tnfr/mathematics/epi.py +254 -0
  75. tnfr/mathematics/generators.py +222 -0
  76. tnfr/mathematics/metrics.py +119 -0
  77. tnfr/mathematics/operators.py +233 -0
  78. tnfr/mathematics/operators_factory.py +71 -0
  79. tnfr/mathematics/projection.py +78 -0
  80. tnfr/mathematics/runtime.py +173 -0
  81. tnfr/mathematics/spaces.py +247 -0
  82. tnfr/mathematics/transforms.py +292 -0
  83. tnfr/metrics/__init__.py +10 -10
  84. tnfr/metrics/__init__.pyi +20 -0
  85. tnfr/metrics/coherence.py +993 -324
  86. tnfr/metrics/common.py +23 -16
  87. tnfr/metrics/common.pyi +46 -0
  88. tnfr/metrics/core.py +251 -35
  89. tnfr/metrics/core.pyi +13 -0
  90. tnfr/metrics/diagnosis.py +708 -111
  91. tnfr/metrics/diagnosis.pyi +85 -0
  92. tnfr/metrics/export.py +27 -15
  93. tnfr/metrics/glyph_timing.py +232 -42
  94. tnfr/metrics/reporting.py +33 -22
  95. tnfr/metrics/reporting.pyi +12 -0
  96. tnfr/metrics/sense_index.py +987 -43
  97. tnfr/metrics/sense_index.pyi +9 -0
  98. tnfr/metrics/trig.py +214 -23
  99. tnfr/metrics/trig.pyi +13 -0
  100. tnfr/metrics/trig_cache.py +115 -22
  101. tnfr/metrics/trig_cache.pyi +10 -0
  102. tnfr/node.py +542 -136
  103. tnfr/node.pyi +178 -0
  104. tnfr/observers.py +152 -35
  105. tnfr/observers.pyi +31 -0
  106. tnfr/ontosim.py +23 -19
  107. tnfr/ontosim.pyi +28 -0
  108. tnfr/operators/__init__.py +601 -82
  109. tnfr/operators/__init__.pyi +45 -0
  110. tnfr/operators/definitions.py +513 -0
  111. tnfr/operators/definitions.pyi +78 -0
  112. tnfr/operators/grammar.py +760 -0
  113. tnfr/operators/jitter.py +107 -38
  114. tnfr/operators/jitter.pyi +11 -0
  115. tnfr/operators/registry.py +75 -0
  116. tnfr/operators/registry.pyi +13 -0
  117. tnfr/operators/remesh.py +149 -88
  118. tnfr/py.typed +0 -0
  119. tnfr/rng.py +46 -143
  120. tnfr/rng.pyi +14 -0
  121. tnfr/schemas/__init__.py +8 -0
  122. tnfr/schemas/grammar.json +94 -0
  123. tnfr/selector.py +25 -19
  124. tnfr/selector.pyi +19 -0
  125. tnfr/sense.py +72 -62
  126. tnfr/sense.pyi +23 -0
  127. tnfr/structural.py +522 -262
  128. tnfr/structural.pyi +69 -0
  129. tnfr/telemetry/__init__.py +35 -0
  130. tnfr/telemetry/cache_metrics.py +226 -0
  131. tnfr/telemetry/nu_f.py +423 -0
  132. tnfr/telemetry/nu_f.pyi +123 -0
  133. tnfr/telemetry/verbosity.py +37 -0
  134. tnfr/tokens.py +1 -3
  135. tnfr/tokens.pyi +36 -0
  136. tnfr/trace.py +270 -113
  137. tnfr/trace.pyi +40 -0
  138. tnfr/types.py +574 -6
  139. tnfr/types.pyi +331 -0
  140. tnfr/units.py +69 -0
  141. tnfr/units.pyi +16 -0
  142. tnfr/utils/__init__.py +217 -0
  143. tnfr/utils/__init__.pyi +202 -0
  144. tnfr/utils/cache.py +2395 -0
  145. tnfr/utils/cache.pyi +468 -0
  146. tnfr/utils/chunks.py +104 -0
  147. tnfr/utils/chunks.pyi +21 -0
  148. tnfr/{collections_utils.py → utils/data.py} +147 -90
  149. tnfr/utils/data.pyi +64 -0
  150. tnfr/utils/graph.py +85 -0
  151. tnfr/utils/graph.pyi +10 -0
  152. tnfr/utils/init.py +770 -0
  153. tnfr/utils/init.pyi +78 -0
  154. tnfr/utils/io.py +456 -0
  155. tnfr/{helpers → utils}/numeric.py +51 -24
  156. tnfr/utils/numeric.pyi +21 -0
  157. tnfr/validation/__init__.py +113 -0
  158. tnfr/validation/__init__.pyi +77 -0
  159. tnfr/validation/compatibility.py +95 -0
  160. tnfr/validation/compatibility.pyi +6 -0
  161. tnfr/validation/grammar.py +71 -0
  162. tnfr/validation/grammar.pyi +40 -0
  163. tnfr/validation/graph.py +138 -0
  164. tnfr/validation/graph.pyi +17 -0
  165. tnfr/validation/rules.py +281 -0
  166. tnfr/validation/rules.pyi +55 -0
  167. tnfr/validation/runtime.py +263 -0
  168. tnfr/validation/runtime.pyi +31 -0
  169. tnfr/validation/soft_filters.py +170 -0
  170. tnfr/validation/soft_filters.pyi +37 -0
  171. tnfr/validation/spectral.py +159 -0
  172. tnfr/validation/spectral.pyi +46 -0
  173. tnfr/validation/syntax.py +40 -0
  174. tnfr/validation/syntax.pyi +10 -0
  175. tnfr/validation/window.py +39 -0
  176. tnfr/validation/window.pyi +1 -0
  177. tnfr/viz/__init__.py +9 -0
  178. tnfr/viz/matplotlib.py +246 -0
  179. tnfr-7.0.0.dist-info/METADATA +179 -0
  180. tnfr-7.0.0.dist-info/RECORD +185 -0
  181. {tnfr-4.5.2.dist-info → tnfr-7.0.0.dist-info}/licenses/LICENSE.md +1 -1
  182. tnfr/grammar.py +0 -344
  183. tnfr/graph_utils.py +0 -84
  184. tnfr/helpers/__init__.py +0 -71
  185. tnfr/import_utils.py +0 -228
  186. tnfr/json_utils.py +0 -162
  187. tnfr/logging_utils.py +0 -116
  188. tnfr/presets.py +0 -60
  189. tnfr/validators.py +0 -84
  190. tnfr/value_utils.py +0 -59
  191. tnfr-4.5.2.dist-info/METADATA +0 -379
  192. tnfr-4.5.2.dist-info/RECORD +0 -67
  193. {tnfr-4.5.2.dist-info → tnfr-7.0.0.dist-info}/WHEEL +0 -0
  194. {tnfr-4.5.2.dist-info → tnfr-7.0.0.dist-info}/entry_points.txt +0 -0
  195. {tnfr-4.5.2.dist-info → tnfr-7.0.0.dist-info}/top_level.txt +0 -0
@@ -2,32 +2,68 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Any, Callable
6
- from collections.abc import Mapping
7
5
  import copy
6
+ from collections.abc import Mapping
8
7
  from types import MappingProxyType
8
+ from typing import Callable, TypeVar, cast
9
9
 
10
+ from ..immutable import _is_immutable
11
+ from ..types import GraphLike, TNFRConfigValue
10
12
  from .core import CORE_DEFAULTS, REMESH_DEFAULTS
11
13
  from .init import INIT_DEFAULTS
12
14
  from .metric import (
15
+ COHERENCE,
16
+ DIAGNOSIS,
17
+ GRAMMAR_CANON,
13
18
  METRIC_DEFAULTS,
19
+ METRICS,
14
20
  SIGMA,
15
21
  TRACE,
16
- METRICS,
17
- GRAMMAR_CANON,
18
- COHERENCE,
19
- DIAGNOSIS,
20
22
  )
21
23
 
22
- from ..immutable import _is_immutable
24
+ T = TypeVar("T")
25
+
26
+ STATE_STABLE = "stable"
27
+ STATE_TRANSITION = "transition"
28
+ STATE_DISSONANT = "dissonant"
29
+
30
+ CANONICAL_STATE_TOKENS = frozenset({STATE_STABLE, STATE_TRANSITION, STATE_DISSONANT})
31
+
32
+
33
+ def normalise_state_token(token: str) -> str:
34
+ """Return the canonical English token for ``token``.
35
+
36
+ The helper now enforces the English identifiers exclusively. Values that
37
+ do not match the canonical set raise :class:`ValueError` so callers can
38
+ surface explicit migration errors when legacy payloads are encountered.
39
+ """
40
+
41
+ if not isinstance(token, str):
42
+ raise TypeError("state token must be a string")
43
+
44
+ stripped = token.strip()
45
+ lowered = stripped.lower()
46
+
47
+ if stripped in CANONICAL_STATE_TOKENS:
48
+ return stripped
49
+
50
+ if lowered in CANONICAL_STATE_TOKENS:
51
+ return lowered
52
+
53
+ raise ValueError(
54
+ "state token must be one of 'stable', 'transition', or 'dissonant'"
55
+ )
56
+
23
57
 
24
58
  try: # pragma: no cover - optional dependency
25
- from ..cache import ensure_node_offset_map
59
+ from ..utils import ensure_node_offset_map as _ensure_node_offset_map
26
60
  except ImportError: # noqa: BLE001 - allow any import error
27
- ensure_node_offset_map = None
61
+ _ensure_node_offset_map = None
62
+
63
+ ensure_node_offset_map: Callable[[GraphLike], None] | None = _ensure_node_offset_map
28
64
 
29
- # Secciones individuales exportadas
30
- DEFAULT_SECTIONS: Mapping[str, Mapping[str, Any]] = MappingProxyType(
65
+ # Exported sections
66
+ DEFAULT_SECTIONS: Mapping[str, Mapping[str, TNFRConfigValue]] = MappingProxyType(
31
67
  {
32
68
  "core": CORE_DEFAULTS,
33
69
  "init": INIT_DEFAULTS,
@@ -36,21 +72,23 @@ DEFAULT_SECTIONS: Mapping[str, Mapping[str, Any]] = MappingProxyType(
36
72
  }
37
73
  )
38
74
 
39
- # Diccionario combinado exportado
40
- # Unimos los diccionarios en orden de menor a mayor prioridad para que los
41
- # valores de ``METRIC_DEFAULTS`` sobrescriban al resto, como hacía
42
- # ``ChainMap``.
43
- DEFAULTS: Mapping[str, Any] = MappingProxyType(
75
+ # Combined exported dictionary
76
+ # Merge the dictionaries from lowest to highest priority so that
77
+ # ``METRIC_DEFAULTS`` overrides the rest, mirroring the previous ``ChainMap``
78
+ # behaviour.
79
+ DEFAULTS: Mapping[str, TNFRConfigValue] = MappingProxyType(
44
80
  CORE_DEFAULTS | INIT_DEFAULTS | REMESH_DEFAULTS | METRIC_DEFAULTS
45
81
  )
46
82
 
47
83
  # -------------------------
48
- # Utilidades
84
+ # Utilities
49
85
  # -------------------------
50
86
 
51
87
 
52
88
  def inject_defaults(
53
- G, defaults: Mapping[str, Any] = DEFAULTS, override: bool = False
89
+ G: GraphLike,
90
+ defaults: Mapping[str, TNFRConfigValue] = DEFAULTS,
91
+ override: bool = False,
54
92
  ) -> None:
55
93
  """Inject ``defaults`` into ``G.graph``.
56
94
 
@@ -63,13 +101,15 @@ def inject_defaults(
63
101
  G.graph.setdefault("_tnfr_defaults_attached", False)
64
102
  for k, v in defaults.items():
65
103
  if override or k not in G.graph:
66
- G.graph[k] = v if _is_immutable(v) else copy.deepcopy(v)
104
+ G.graph[k] = (
105
+ v if _is_immutable(v) else cast(TNFRConfigValue, copy.deepcopy(v))
106
+ )
67
107
  G.graph["_tnfr_defaults_attached"] = True
68
108
  if ensure_node_offset_map is not None:
69
109
  ensure_node_offset_map(G)
70
110
 
71
111
 
72
- def merge_overrides(G, **overrides) -> None:
112
+ def merge_overrides(G: GraphLike, **overrides: TNFRConfigValue) -> None:
73
113
  """Apply specific changes to ``G.graph``.
74
114
 
75
115
  Non-immutable values are deep-copied to avoid shared state with
@@ -77,20 +117,26 @@ def merge_overrides(G, **overrides) -> None:
77
117
  """
78
118
  for key, value in overrides.items():
79
119
  if key not in DEFAULTS:
80
- raise KeyError(f"Parámetro desconocido: '{key}'")
81
- G.graph[key] = value if _is_immutable(value) else copy.deepcopy(value)
120
+ raise KeyError(f"Unknown parameter: '{key}'")
121
+ G.graph[key] = (
122
+ value
123
+ if _is_immutable(value)
124
+ else cast(TNFRConfigValue, copy.deepcopy(value))
125
+ )
82
126
 
83
127
 
84
- def get_param(G, key: str):
128
+ def get_param(G: GraphLike, key: str) -> TNFRConfigValue:
85
129
  """Retrieve a parameter from ``G.graph`` or fall back to defaults."""
86
130
  if key in G.graph:
87
131
  return G.graph[key]
88
132
  if key not in DEFAULTS:
89
- raise KeyError(f"Parámetro desconocido: '{key}'")
133
+ raise KeyError(f"Unknown parameter: '{key}'")
90
134
  return DEFAULTS[key]
91
135
 
92
136
 
93
- def get_graph_param(G, key: str, cast: Callable[[Any], Any] = float):
137
+ def get_graph_param(
138
+ G: GraphLike, key: str, cast: Callable[[object], T] = float
139
+ ) -> T | None:
94
140
  """Return ``key`` from ``G.graph`` applying ``cast``.
95
141
 
96
142
  The ``cast`` argument must be a function (e.g. ``float``, ``int``,
@@ -101,14 +147,14 @@ def get_graph_param(G, key: str, cast: Callable[[Any], Any] = float):
101
147
  return None if val is None else cast(val)
102
148
 
103
149
 
104
- # Claves canónicas con nombres ASCII
150
+ # Canonical keys with ASCII spellings
105
151
  VF_KEY = "νf"
106
- THETA_KEY = "θ"
152
+ THETA_KEY = "theta"
107
153
 
108
- # Mapa de aliases para atributos nodales
154
+ # Alias map for node attributes
109
155
  ALIASES: dict[str, tuple[str, ...]] = {
110
156
  "VF": (VF_KEY, "nu_f", "nu-f", "nu", "freq", "frequency"),
111
- "THETA": (THETA_KEY, "theta", "fase", "phi", "phase"),
157
+ "THETA": (THETA_KEY, "phase"),
112
158
  "DNFR": ("ΔNFR", "delta_nfr", "dnfr"),
113
159
  "EPI": ("EPI", "psi", "PSI", "value"),
114
160
  "EPI_KIND": ("EPI_kind", "epi_kind", "source_glyph"),
@@ -171,4 +217,9 @@ __all__ = (
171
217
  "dVF_PRIMARY",
172
218
  "D2VF_PRIMARY",
173
219
  "dSI_PRIMARY",
220
+ "STATE_STABLE",
221
+ "STATE_TRANSITION",
222
+ "STATE_DISSONANT",
223
+ "CANONICAL_STATE_TOKENS",
224
+ "normalise_state_token",
174
225
  )
@@ -0,0 +1,92 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Callable, TypeVar
5
+
6
+ from ..types import GraphLike, TNFRConfigValue
7
+ from .core import CORE_DEFAULTS as CORE_DEFAULTS
8
+ from .core import REMESH_DEFAULTS as REMESH_DEFAULTS
9
+ from .init import INIT_DEFAULTS as INIT_DEFAULTS
10
+ from .metric import COHERENCE as COHERENCE
11
+ from .metric import DIAGNOSIS as DIAGNOSIS
12
+ from .metric import GRAMMAR_CANON as GRAMMAR_CANON
13
+ from .metric import METRIC_DEFAULTS as METRIC_DEFAULTS
14
+ from .metric import METRICS as METRICS
15
+ from .metric import SIGMA as SIGMA
16
+ from .metric import TRACE as TRACE
17
+
18
+ T = TypeVar("T")
19
+
20
+ __all__ = (
21
+ "CORE_DEFAULTS",
22
+ "INIT_DEFAULTS",
23
+ "REMESH_DEFAULTS",
24
+ "METRIC_DEFAULTS",
25
+ "SIGMA",
26
+ "TRACE",
27
+ "METRICS",
28
+ "GRAMMAR_CANON",
29
+ "COHERENCE",
30
+ "DIAGNOSIS",
31
+ "DEFAULTS",
32
+ "DEFAULT_SECTIONS",
33
+ "ALIASES",
34
+ "inject_defaults",
35
+ "merge_overrides",
36
+ "get_param",
37
+ "get_graph_param",
38
+ "get_aliases",
39
+ "VF_KEY",
40
+ "THETA_KEY",
41
+ "VF_PRIMARY",
42
+ "THETA_PRIMARY",
43
+ "DNFR_PRIMARY",
44
+ "EPI_PRIMARY",
45
+ "EPI_KIND_PRIMARY",
46
+ "SI_PRIMARY",
47
+ "dEPI_PRIMARY",
48
+ "D2EPI_PRIMARY",
49
+ "dVF_PRIMARY",
50
+ "D2VF_PRIMARY",
51
+ "dSI_PRIMARY",
52
+ "STATE_STABLE",
53
+ "STATE_TRANSITION",
54
+ "STATE_DISSONANT",
55
+ "CANONICAL_STATE_TOKENS",
56
+ "normalise_state_token",
57
+ )
58
+
59
+ ensure_node_offset_map: Callable[[GraphLike], None] | None
60
+ DEFAULT_SECTIONS: Mapping[str, Mapping[str, TNFRConfigValue]]
61
+ DEFAULTS: Mapping[str, TNFRConfigValue]
62
+ ALIASES: dict[str, tuple[str, ...]]
63
+ VF_KEY: str
64
+ THETA_KEY: str
65
+ VF_PRIMARY: str
66
+ THETA_PRIMARY: str
67
+ DNFR_PRIMARY: str
68
+ EPI_PRIMARY: str
69
+ EPI_KIND_PRIMARY: str
70
+ SI_PRIMARY: str
71
+ dEPI_PRIMARY: str
72
+ D2EPI_PRIMARY: str
73
+ dVF_PRIMARY: str
74
+ D2VF_PRIMARY: str
75
+ dSI_PRIMARY: str
76
+ STATE_STABLE: str
77
+ STATE_TRANSITION: str
78
+ STATE_DISSONANT: str
79
+ CANONICAL_STATE_TOKENS: frozenset[str]
80
+
81
+ def inject_defaults(
82
+ G: GraphLike,
83
+ defaults: Mapping[str, TNFRConfigValue] = ...,
84
+ override: bool = ...,
85
+ ) -> None: ...
86
+ def merge_overrides(G: GraphLike, **overrides: TNFRConfigValue) -> None: ...
87
+ def get_param(G: GraphLike, key: str) -> TNFRConfigValue: ...
88
+ def get_graph_param(
89
+ G: GraphLike, key: str, cast: Callable[[object], T] = ...
90
+ ) -> T | None: ...
91
+ def get_aliases(key: str) -> tuple[str, ...]: ...
92
+ def normalise_state_token(token: str) -> str: ...
@@ -0,0 +1,31 @@
1
+ """Shared alias constants for TNFR attributes."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from . import get_aliases
6
+
7
+ ALIAS_VF = get_aliases("VF")
8
+ ALIAS_THETA = get_aliases("THETA")
9
+ ALIAS_DNFR = get_aliases("DNFR")
10
+ ALIAS_EPI = get_aliases("EPI")
11
+ ALIAS_EPI_KIND = get_aliases("EPI_KIND")
12
+ ALIAS_SI = get_aliases("SI")
13
+ ALIAS_DEPI = get_aliases("DEPI")
14
+ ALIAS_D2EPI = get_aliases("D2EPI")
15
+ ALIAS_DVF = get_aliases("DVF")
16
+ ALIAS_D2VF = get_aliases("D2VF")
17
+ ALIAS_DSI = get_aliases("DSI")
18
+
19
+ __all__ = [
20
+ "ALIAS_VF",
21
+ "ALIAS_THETA",
22
+ "ALIAS_DNFR",
23
+ "ALIAS_EPI",
24
+ "ALIAS_EPI_KIND",
25
+ "ALIAS_SI",
26
+ "ALIAS_DEPI",
27
+ "ALIAS_D2EPI",
28
+ "ALIAS_DVF",
29
+ "ALIAS_D2VF",
30
+ "ALIAS_DSI",
31
+ ]
tnfr/constants/core.py CHANGED
@@ -2,10 +2,9 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from dataclasses import dataclass, asdict, field
6
- from typing import Any, Mapping
5
+ from dataclasses import asdict, dataclass, field
7
6
  from types import MappingProxyType
8
-
7
+ from typing import Any, Mapping
9
8
 
10
9
  SELECTOR_THRESHOLD_DEFAULTS: Mapping[str, float] = MappingProxyType(
11
10
  {
@@ -72,6 +71,7 @@ class CoreDefaults:
72
71
  GLYPH_SELECTOR_MARGIN: float = 0.05
73
72
  VF_ADAPT_TAU: int = 5
74
73
  VF_ADAPT_MU: float = 0.1
74
+ HZ_STR_BRIDGE: float = 1.0
75
75
  GLYPH_FACTORS: dict[str, float] = field(
76
76
  default_factory=lambda: {
77
77
  "AL_boost": 0.05,
@@ -134,7 +134,7 @@ class RemeshDefaults:
134
134
  EPS_DNFR_STABLE: float = 1e-3
135
135
  EPS_DEPI_STABLE: float = 1e-3
136
136
  FRACTION_STABLE_REMESH: float = 0.80
137
- REMESH_COOLDOWN_VENTANA: int = 20
137
+ REMESH_COOLDOWN_WINDOW: int = 20
138
138
  REMESH_COOLDOWN_TS: float = 0.0
139
139
  REMESH_REQUIRE_STABILITY: bool = True
140
140
  REMESH_STABILITY_WINDOW: int = 25
@@ -0,0 +1,17 @@
1
+ from typing import Any
2
+
3
+ __all__: Any
4
+
5
+ def __getattr__(name: str) -> Any: ...
6
+
7
+ CORE_DEFAULTS: Any
8
+ CoreDefaults: Any
9
+ Mapping: Any
10
+ MappingProxyType: Any
11
+ REMESH_DEFAULTS: Any
12
+ RemeshDefaults: Any
13
+ SELECTOR_THRESHOLD_DEFAULTS: Any
14
+ annotations: Any
15
+ asdict: Any
16
+ dataclass: Any
17
+ field: Any
tnfr/constants/init.py CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from dataclasses import dataclass, asdict
6
5
  import math
6
+ from dataclasses import asdict, dataclass
7
7
 
8
8
 
9
9
  @dataclass(frozen=True, slots=True)
@@ -0,0 +1,12 @@
1
+ from typing import Any
2
+
3
+ __all__: Any
4
+
5
+ def __getattr__(name: str) -> Any: ...
6
+
7
+ INIT_DEFAULTS: Any
8
+ InitDefaults: Any
9
+ annotations: Any
10
+ asdict: Any
11
+ dataclass: Any
12
+ math: Any
tnfr/constants/metric.py CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from dataclasses import dataclass, asdict, field
6
- from typing import Any
5
+ from dataclasses import asdict, dataclass, field
7
6
  from types import MappingProxyType
7
+ from typing import Any
8
8
 
9
9
 
10
10
  @dataclass(frozen=True, slots=True)
@@ -27,7 +27,7 @@ class MetricDefaults:
27
27
  default_factory=lambda: {
28
28
  "enabled": True,
29
29
  "weight": "Si", # "Si" | "EPI" | "1"
30
- "smooth": 0.0, # EMA sobre el vector global (0=off)
30
+ "smooth": 0.0, # EMA over the global vector (0=off)
31
31
  "history_key": "sigma_global",
32
32
  "per_node": False,
33
33
  }
@@ -35,18 +35,7 @@ class MetricDefaults:
35
35
  TRACE: dict[str, Any] = field(
36
36
  default_factory=lambda: {
37
37
  "enabled": True,
38
- "capture": [
39
- "gamma",
40
- "grammar",
41
- "selector",
42
- "dnfr_weights",
43
- "si_weights",
44
- "callbacks",
45
- "thol_open_nodes",
46
- "sigma",
47
- "kuramoto",
48
- "glyph_counts",
49
- ],
38
+ "verbosity": "debug",
50
39
  "history_key": "trace_meta",
51
40
  }
52
41
  )
@@ -55,6 +44,8 @@ class MetricDefaults:
55
44
  "enabled": True,
56
45
  "save_by_node": True,
57
46
  "normalize_series": False,
47
+ "n_jobs": 1,
48
+ "verbosity": "debug",
58
49
  }
59
50
  )
60
51
  GRAMMAR_CANON: dict[str, Any] = field(
@@ -76,6 +67,7 @@ class MetricDefaults:
76
67
  "self_on_diag": True,
77
68
  "store_mode": "sparse",
78
69
  "threshold": 0.0,
70
+ "n_jobs": 1,
79
71
  "history_key": "W_sparse",
80
72
  "Wi_history_key": "W_i",
81
73
  "stats_history_key": "W_stats",
@@ -0,0 +1,19 @@
1
+ from typing import Any
2
+
3
+ __all__: Any
4
+
5
+ def __getattr__(name: str) -> Any: ...
6
+
7
+ COHERENCE: Any
8
+ DIAGNOSIS: Any
9
+ GRAMMAR_CANON: Any
10
+ METRICS: Any
11
+ METRIC_DEFAULTS: Any
12
+ MappingProxyType: Any
13
+ MetricDefaults: Any
14
+ SIGMA: Any
15
+ TRACE: Any
16
+ annotations: Any
17
+ asdict: Any
18
+ dataclass: Any
19
+ field: Any