tnfr 6.0.0__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 (176) hide show
  1. tnfr/__init__.py +50 -5
  2. tnfr/__init__.pyi +0 -7
  3. tnfr/_compat.py +0 -1
  4. tnfr/_generated_version.py +34 -0
  5. tnfr/_version.py +44 -2
  6. tnfr/alias.py +14 -13
  7. tnfr/alias.pyi +5 -37
  8. tnfr/cache.py +9 -729
  9. tnfr/cache.pyi +8 -224
  10. tnfr/callback_utils.py +16 -31
  11. tnfr/callback_utils.pyi +3 -29
  12. tnfr/cli/__init__.py +17 -11
  13. tnfr/cli/__init__.pyi +0 -21
  14. tnfr/cli/arguments.py +175 -14
  15. tnfr/cli/arguments.pyi +5 -11
  16. tnfr/cli/execution.py +434 -48
  17. tnfr/cli/execution.pyi +14 -24
  18. tnfr/cli/utils.py +20 -3
  19. tnfr/cli/utils.pyi +5 -5
  20. tnfr/config/__init__.py +2 -1
  21. tnfr/config/__init__.pyi +2 -0
  22. tnfr/config/feature_flags.py +83 -0
  23. tnfr/config/init.py +1 -1
  24. tnfr/config/operator_names.py +1 -14
  25. tnfr/config/presets.py +6 -26
  26. tnfr/constants/__init__.py +10 -13
  27. tnfr/constants/__init__.pyi +10 -22
  28. tnfr/constants/aliases.py +31 -0
  29. tnfr/constants/core.py +4 -3
  30. tnfr/constants/init.py +1 -1
  31. tnfr/constants/metric.py +3 -3
  32. tnfr/dynamics/__init__.py +64 -10
  33. tnfr/dynamics/__init__.pyi +3 -4
  34. tnfr/dynamics/adaptation.py +79 -13
  35. tnfr/dynamics/aliases.py +10 -9
  36. tnfr/dynamics/coordination.py +77 -35
  37. tnfr/dynamics/dnfr.py +575 -274
  38. tnfr/dynamics/dnfr.pyi +1 -10
  39. tnfr/dynamics/integrators.py +47 -33
  40. tnfr/dynamics/integrators.pyi +0 -1
  41. tnfr/dynamics/runtime.py +489 -129
  42. tnfr/dynamics/sampling.py +2 -0
  43. tnfr/dynamics/selectors.py +101 -62
  44. tnfr/execution.py +15 -8
  45. tnfr/execution.pyi +5 -25
  46. tnfr/flatten.py +7 -3
  47. tnfr/flatten.pyi +1 -8
  48. tnfr/gamma.py +22 -26
  49. tnfr/gamma.pyi +0 -6
  50. tnfr/glyph_history.py +37 -26
  51. tnfr/glyph_history.pyi +1 -19
  52. tnfr/glyph_runtime.py +16 -0
  53. tnfr/glyph_runtime.pyi +9 -0
  54. tnfr/immutable.py +20 -15
  55. tnfr/immutable.pyi +4 -7
  56. tnfr/initialization.py +5 -7
  57. tnfr/initialization.pyi +1 -9
  58. tnfr/io.py +6 -305
  59. tnfr/io.pyi +13 -8
  60. tnfr/mathematics/__init__.py +81 -0
  61. tnfr/mathematics/backend.py +426 -0
  62. tnfr/mathematics/dynamics.py +398 -0
  63. tnfr/mathematics/epi.py +254 -0
  64. tnfr/mathematics/generators.py +222 -0
  65. tnfr/mathematics/metrics.py +119 -0
  66. tnfr/mathematics/operators.py +233 -0
  67. tnfr/mathematics/operators_factory.py +71 -0
  68. tnfr/mathematics/projection.py +78 -0
  69. tnfr/mathematics/runtime.py +173 -0
  70. tnfr/mathematics/spaces.py +247 -0
  71. tnfr/mathematics/transforms.py +292 -0
  72. tnfr/metrics/__init__.py +10 -10
  73. tnfr/metrics/coherence.py +123 -94
  74. tnfr/metrics/common.py +22 -13
  75. tnfr/metrics/common.pyi +42 -11
  76. tnfr/metrics/core.py +72 -14
  77. tnfr/metrics/diagnosis.py +48 -57
  78. tnfr/metrics/diagnosis.pyi +3 -7
  79. tnfr/metrics/export.py +3 -5
  80. tnfr/metrics/glyph_timing.py +41 -31
  81. tnfr/metrics/reporting.py +13 -6
  82. tnfr/metrics/sense_index.py +884 -114
  83. tnfr/metrics/trig.py +167 -11
  84. tnfr/metrics/trig.pyi +1 -0
  85. tnfr/metrics/trig_cache.py +112 -15
  86. tnfr/node.py +400 -17
  87. tnfr/node.pyi +55 -38
  88. tnfr/observers.py +111 -8
  89. tnfr/observers.pyi +0 -15
  90. tnfr/ontosim.py +9 -6
  91. tnfr/ontosim.pyi +0 -5
  92. tnfr/operators/__init__.py +529 -42
  93. tnfr/operators/__init__.pyi +14 -0
  94. tnfr/operators/definitions.py +350 -18
  95. tnfr/operators/definitions.pyi +0 -14
  96. tnfr/operators/grammar.py +760 -0
  97. tnfr/operators/jitter.py +28 -22
  98. tnfr/operators/registry.py +7 -12
  99. tnfr/operators/registry.pyi +0 -2
  100. tnfr/operators/remesh.py +38 -61
  101. tnfr/rng.py +17 -300
  102. tnfr/schemas/__init__.py +8 -0
  103. tnfr/schemas/grammar.json +94 -0
  104. tnfr/selector.py +3 -4
  105. tnfr/selector.pyi +1 -1
  106. tnfr/sense.py +22 -24
  107. tnfr/sense.pyi +0 -7
  108. tnfr/structural.py +504 -21
  109. tnfr/structural.pyi +41 -18
  110. tnfr/telemetry/__init__.py +23 -1
  111. tnfr/telemetry/cache_metrics.py +226 -0
  112. tnfr/telemetry/nu_f.py +423 -0
  113. tnfr/telemetry/nu_f.pyi +123 -0
  114. tnfr/tokens.py +1 -4
  115. tnfr/tokens.pyi +1 -6
  116. tnfr/trace.py +20 -53
  117. tnfr/trace.pyi +9 -37
  118. tnfr/types.py +244 -15
  119. tnfr/types.pyi +200 -14
  120. tnfr/units.py +69 -0
  121. tnfr/units.pyi +16 -0
  122. tnfr/utils/__init__.py +107 -48
  123. tnfr/utils/__init__.pyi +80 -11
  124. tnfr/utils/cache.py +1705 -65
  125. tnfr/utils/cache.pyi +370 -58
  126. tnfr/utils/chunks.py +104 -0
  127. tnfr/utils/chunks.pyi +21 -0
  128. tnfr/utils/data.py +95 -5
  129. tnfr/utils/data.pyi +8 -17
  130. tnfr/utils/graph.py +2 -4
  131. tnfr/utils/init.py +31 -7
  132. tnfr/utils/init.pyi +4 -11
  133. tnfr/utils/io.py +313 -14
  134. tnfr/{helpers → utils}/numeric.py +50 -24
  135. tnfr/utils/numeric.pyi +21 -0
  136. tnfr/validation/__init__.py +92 -4
  137. tnfr/validation/__init__.pyi +77 -17
  138. tnfr/validation/compatibility.py +79 -43
  139. tnfr/validation/compatibility.pyi +4 -6
  140. tnfr/validation/grammar.py +55 -133
  141. tnfr/validation/grammar.pyi +37 -8
  142. tnfr/validation/graph.py +138 -0
  143. tnfr/validation/graph.pyi +17 -0
  144. tnfr/validation/rules.py +161 -74
  145. tnfr/validation/rules.pyi +55 -18
  146. tnfr/validation/runtime.py +263 -0
  147. tnfr/validation/runtime.pyi +31 -0
  148. tnfr/validation/soft_filters.py +170 -0
  149. tnfr/validation/soft_filters.pyi +37 -0
  150. tnfr/validation/spectral.py +159 -0
  151. tnfr/validation/spectral.pyi +46 -0
  152. tnfr/validation/syntax.py +28 -139
  153. tnfr/validation/syntax.pyi +7 -4
  154. tnfr/validation/window.py +39 -0
  155. tnfr/validation/window.pyi +1 -0
  156. tnfr/viz/__init__.py +9 -0
  157. tnfr/viz/matplotlib.py +246 -0
  158. {tnfr-6.0.0.dist-info → tnfr-7.0.0.dist-info}/METADATA +63 -19
  159. tnfr-7.0.0.dist-info/RECORD +185 -0
  160. {tnfr-6.0.0.dist-info → tnfr-7.0.0.dist-info}/licenses/LICENSE.md +1 -1
  161. tnfr/constants_glyphs.py +0 -16
  162. tnfr/constants_glyphs.pyi +0 -12
  163. tnfr/grammar.py +0 -25
  164. tnfr/grammar.pyi +0 -13
  165. tnfr/helpers/__init__.py +0 -151
  166. tnfr/helpers/__init__.pyi +0 -66
  167. tnfr/helpers/numeric.pyi +0 -12
  168. tnfr/presets.py +0 -15
  169. tnfr/presets.pyi +0 -7
  170. tnfr/utils/io.pyi +0 -10
  171. tnfr/utils/validators.py +0 -130
  172. tnfr/utils/validators.pyi +0 -19
  173. tnfr-6.0.0.dist-info/RECORD +0 -157
  174. {tnfr-6.0.0.dist-info → tnfr-7.0.0.dist-info}/WHEEL +0 -0
  175. {tnfr-6.0.0.dist-info → tnfr-7.0.0.dist-info}/entry_points.txt +0 -0
  176. {tnfr-6.0.0.dist-info → tnfr-7.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,123 @@
1
+ from __future__ import annotations
2
+
3
+ from collections import deque
4
+ from collections.abc import MutableMapping
5
+ from dataclasses import dataclass
6
+ from typing import Any, Mapping, Sequence
7
+
8
+ from ..types import GraphLike
9
+
10
+ __all__ = (
11
+ "NuFWindow",
12
+ "NuFSnapshot",
13
+ "NuFTelemetryAccumulator",
14
+ "ensure_nu_f_telemetry",
15
+ "record_nu_f_window",
16
+ )
17
+
18
+
19
+ @dataclass
20
+ class NuFWindow:
21
+ reorganisations: int
22
+ duration: float
23
+ start: float | None = ...
24
+ end: float | None = ...
25
+
26
+ def __post_init__(self) -> None: ...
27
+
28
+ @classmethod
29
+ def from_bounds(cls, reorganisations: int, start: float, end: float) -> NuFWindow: ...
30
+
31
+ def as_payload(self) -> Mapping[str, float | int | None]: ...
32
+
33
+
34
+ @dataclass
35
+ class NuFSnapshot:
36
+ windows: Sequence[NuFWindow]
37
+ total_reorganisations: int
38
+ total_duration: float
39
+ rate_hz_str: float | None
40
+ rate_hz: float | None
41
+ variance_hz_str: float | None
42
+ variance_hz: float | None
43
+ confidence_level: float | None
44
+ ci_lower_hz_str: float | None
45
+ ci_upper_hz_str: float | None
46
+ ci_lower_hz: float | None
47
+ ci_upper_hz: float | None
48
+
49
+ def as_payload(self) -> dict[str, Any]: ...
50
+
51
+
52
+ class NuFTelemetryAccumulator:
53
+ _windows: deque[NuFWindow]
54
+
55
+ def __init__(
56
+ self,
57
+ *,
58
+ confidence_level: float = ...,
59
+ history_limit: int | None = ...,
60
+ window_limit: int | None = ...,
61
+ graph: GraphLike | MutableMapping[str, Any] | None = ...,
62
+ ) -> None: ...
63
+
64
+ @property
65
+ def confidence_level(self) -> float: ...
66
+
67
+ @property
68
+ def history_limit(self) -> int | None: ...
69
+
70
+ @property
71
+ def window_limit(self) -> int | None: ...
72
+
73
+ def attach_graph(
74
+ self, graph: GraphLike | MutableMapping[str, Any] | None
75
+ ) -> None: ...
76
+
77
+ def record_window(
78
+ self,
79
+ window: NuFWindow,
80
+ *,
81
+ graph: GraphLike | MutableMapping[str, Any] | None = ...,
82
+ ) -> NuFSnapshot: ...
83
+
84
+ def record_counts(
85
+ self,
86
+ reorganisations: int,
87
+ duration: float,
88
+ *,
89
+ start: float | None = ...,
90
+ end: float | None = ...,
91
+ graph: GraphLike | MutableMapping[str, Any] | None = ...,
92
+ ) -> NuFSnapshot: ...
93
+
94
+ def reset(self) -> None: ...
95
+
96
+ def snapshot(
97
+ self,
98
+ *,
99
+ graph: GraphLike | MutableMapping[str, Any] | None = ...,
100
+ ) -> NuFSnapshot: ...
101
+
102
+
103
+ def ensure_nu_f_telemetry(
104
+ graph: GraphLike,
105
+ *,
106
+ confidence_level: float | None = ...,
107
+ history_limit: int | None = ...,
108
+ window_limit: int | None = ...,
109
+ ) -> NuFTelemetryAccumulator: ...
110
+
111
+
112
+ def record_nu_f_window(
113
+ graph: GraphLike,
114
+ reorganisations: int,
115
+ duration: float,
116
+ *,
117
+ start: float | None = ...,
118
+ end: float | None = ...,
119
+ confidence_level: float | None = ...,
120
+ history_limit: int | None = ...,
121
+ window_limit: int | None = ...,
122
+ ) -> NuFSnapshot: ...
123
+
tnfr/tokens.py CHANGED
@@ -6,10 +6,7 @@ from dataclasses import dataclass
6
6
  from enum import Enum, auto
7
7
  from typing import Any, Iterable, Optional, Sequence, Union
8
8
 
9
- from .types import Glyph, NodeId
10
-
11
- Node = NodeId
12
- #: Alias maintained for backwards compatibility with historical token helpers.
9
+ from .types import Glyph, Node
13
10
 
14
11
 
15
12
  @dataclass(slots=True)
tnfr/tokens.pyi CHANGED
@@ -4,36 +4,31 @@ from dataclasses import dataclass
4
4
  from enum import Enum
5
5
  from typing import Iterable, Optional, Sequence
6
6
 
7
- from .types import Glyph, NodeId
8
7
  from ._compat import TypeAlias
8
+ from .types import Glyph, NodeId
9
9
 
10
10
  __all__: tuple[str, ...]
11
11
 
12
12
  Node: TypeAlias = NodeId
13
13
 
14
-
15
14
  @dataclass(slots=True)
16
15
  class WAIT:
17
16
  steps: int = 1
18
17
 
19
-
20
18
  @dataclass(slots=True)
21
19
  class TARGET:
22
20
  nodes: Optional[Iterable[Node]] = None
23
21
 
24
-
25
22
  @dataclass(slots=True)
26
23
  class THOL:
27
24
  body: Sequence["Token"]
28
25
  repeat: int = 1
29
26
  force_close: Optional[Glyph] = None
30
27
 
31
-
32
28
  Token: TypeAlias = Glyph | WAIT | TARGET | THOL | str
33
29
 
34
30
  THOL_SENTINEL: object
35
31
 
36
-
37
32
  class OpTag(Enum):
38
33
  TARGET = ...
39
34
  WAIT = ...
tnfr/trace.py CHANGED
@@ -8,18 +8,16 @@ structures as immutable snapshots.
8
8
  from __future__ import annotations
9
9
 
10
10
  import warnings
11
-
12
- from typing import Any, Callable, Protocol, NamedTuple, TypedDict, cast
13
11
  from collections.abc import Iterable, Mapping
14
12
  from types import MappingProxyType
13
+ from typing import Any, Callable, NamedTuple, Protocol, cast
15
14
 
16
15
  from .constants import TRACE
17
- from .glyph_history import ensure_history, count_glyphs, append_metric
18
- from .utils import cached_import, get_graph_mapping, is_non_string_sequence
16
+ from .glyph_history import append_metric, count_glyphs, ensure_history
19
17
  from .metrics.sense_index import _normalise_si_sensitivity_mapping
20
18
  from .telemetry.verbosity import (
21
- TelemetryVerbosity,
22
19
  TELEMETRY_VERBOSITY_DEFAULT,
20
+ TelemetryVerbosity,
23
21
  )
24
22
  from .types import (
25
23
  SigmaVector,
@@ -28,19 +26,18 @@ from .types import (
28
26
  TraceFieldFn,
29
27
  TraceFieldMap,
30
28
  TraceFieldRegistry,
29
+ TraceMetadata,
30
+ TraceSnapshot,
31
31
  )
32
+ from .utils import cached_import, get_graph_mapping, is_non_string_sequence
32
33
 
33
34
 
34
35
  class _KuramotoFn(Protocol):
35
- def __call__(self, G: TNFRGraph) -> tuple[float, float]:
36
- ...
36
+ def __call__(self, G: TNFRGraph) -> tuple[float, float]: ...
37
37
 
38
38
 
39
39
  class _SigmaVectorFn(Protocol):
40
- def __call__(
41
- self, G: TNFRGraph, weight_mode: str | None = None
42
- ) -> SigmaVector:
43
- ...
40
+ def __call__(self, G: TNFRGraph, weight_mode: str | None = None) -> SigmaVector: ...
44
41
 
45
42
 
46
43
  class CallbackSpec(NamedTuple):
@@ -50,29 +47,6 @@ class CallbackSpec(NamedTuple):
50
47
  func: Callable[..., Any]
51
48
 
52
49
 
53
- class TraceMetadata(TypedDict, total=False):
54
- """Metadata captured by trace field functions."""
55
-
56
- gamma: Mapping[str, Any]
57
- grammar: Mapping[str, Any]
58
- selector: str | None
59
- dnfr_weights: Mapping[str, Any]
60
- si_weights: Mapping[str, Any]
61
- si_sensitivity: Mapping[str, Any]
62
- callbacks: Mapping[str, list[str] | None]
63
- thol_open_nodes: int
64
- kuramoto: Mapping[str, float]
65
- sigma: Mapping[str, float]
66
- glyphs: Mapping[str, int]
67
-
68
-
69
- class TraceSnapshot(TraceMetadata, total=False):
70
- """Trace snapshot stored in the history."""
71
-
72
- t: float
73
- phase: str
74
-
75
-
76
50
  class TraceFieldSpec(NamedTuple):
77
51
  """Declarative specification for a trace field producer."""
78
52
 
@@ -153,9 +127,7 @@ kuramoto_R_psi: _KuramotoFn = cast(
153
127
  )
154
128
 
155
129
 
156
- def _sigma_fallback(
157
- G: TNFRGraph, _weight_mode: str | None = None
158
- ) -> SigmaVector:
130
+ def _sigma_fallback(G: TNFRGraph, _weight_mode: str | None = None) -> SigmaVector:
159
131
  """Return a null sigma vector regardless of ``_weight_mode``."""
160
132
 
161
133
  return {"x": 0.0, "y": 0.0, "mag": 0.0, "angle": 0.0, "n": 0}
@@ -187,7 +159,7 @@ def _trace_setup(
187
159
  dict[str, Any] | None,
188
160
  str | None,
189
161
  ]:
190
- """Common configuration for trace snapshots.
162
+ """Prepare common configuration for trace snapshots.
191
163
 
192
164
  Returns the active configuration, capture set, history and key under
193
165
  which metadata will be stored. If tracing is disabled returns
@@ -212,9 +184,7 @@ def _callback_names(
212
184
  if isinstance(callbacks, Mapping):
213
185
  callbacks = callbacks.values()
214
186
  return [
215
- cb.name
216
- if cb.name is not None
217
- else str(getattr(cb.func, "__name__", "fn"))
187
+ cb.name if cb.name is not None else str(getattr(cb.func, "__name__", "fn"))
218
188
  for cb in callbacks
219
189
  ]
220
190
 
@@ -223,7 +193,7 @@ EMPTY_MAPPING: Mapping[str, Any] = MappingProxyType({})
223
193
 
224
194
 
225
195
  def mapping_field(G: TNFRGraph, graph_key: str, out_key: str) -> TraceMetadata:
226
- """Helper to copy mappings from ``G.graph`` into trace output."""
196
+ """Copy mappings from ``G.graph`` into trace output."""
227
197
  mapping = get_graph_mapping(
228
198
  G, graph_key, f"G.graph[{graph_key!r}] is not a mapping; ignoring"
229
199
  )
@@ -259,9 +229,7 @@ def _new_trace_meta(
259
229
  # -------------------------
260
230
 
261
231
 
262
- def _trace_capture(
263
- G: TNFRGraph, phase: str, fields: TraceFieldMap
264
- ) -> None:
232
+ def _trace_capture(G: TNFRGraph, phase: str, fields: TraceFieldMap) -> None:
265
233
  """Capture ``fields`` for ``phase`` and store the snapshot.
266
234
 
267
235
  A :class:`TraceSnapshot` is appended to the configured history when
@@ -292,19 +260,21 @@ def _trace_capture(
292
260
  TRACE_FIELDS: TraceFieldRegistry = {}
293
261
 
294
262
 
295
- def register_trace_field(
296
- phase: str, name: str, func: TraceFieldFn
297
- ) -> None:
263
+ def register_trace_field(phase: str, name: str, func: TraceFieldFn) -> None:
298
264
  """Register ``func`` to populate trace field ``name`` during ``phase``."""
299
265
 
300
266
  TRACE_FIELDS.setdefault(phase, {})[name] = func
301
267
 
302
268
 
303
269
  def gamma_field(G: TNFRGraph) -> TraceMetadata:
270
+ """Expose γ-field metadata stored under ``G.graph['GAMMA']``."""
271
+
304
272
  return mapping_field(G, "GAMMA", "gamma")
305
273
 
306
274
 
307
275
  def grammar_field(G: TNFRGraph) -> TraceMetadata:
276
+ """Expose canonical grammar metadata for trace emission."""
277
+
308
278
  return mapping_field(G, "GRAMMAR_CANON", "grammar")
309
279
 
310
280
 
@@ -500,9 +470,7 @@ TRACE_FIELD_SPECS: tuple[TraceFieldSpec, ...] = (
500
470
  )
501
471
 
502
472
  TRACE_VERBOSITY_PRESETS = {
503
- level.value: tuple(
504
- spec.name for spec in TRACE_FIELD_SPECS if level in spec.tiers
505
- )
473
+ level.value: tuple(spec.name for spec in TRACE_FIELD_SPECS if level in spec.tiers)
506
474
  for level in TelemetryVerbosity
507
475
  }
508
476
 
@@ -516,8 +484,7 @@ for spec in TRACE_FIELD_SPECS:
516
484
 
517
485
 
518
486
  def register_trace(G: TNFRGraph) -> None:
519
- """Enable before/after-step snapshots and dump operational metadata
520
- to history.
487
+ """Enable before/after-step snapshots and dump operational metadata to history.
521
488
 
522
489
  Trace snapshots are stored as :class:`TraceSnapshot` entries in
523
490
  ``G.graph['history'][TRACE.history_key]`` with:
tnfr/trace.pyi CHANGED
@@ -1,68 +1,40 @@
1
- from typing import Any, Callable, NamedTuple, TypedDict
2
1
  from collections.abc import Iterable, Mapping
2
+ from typing import Any, Callable, NamedTuple
3
3
 
4
- from .types import TNFRGraph, TraceFieldFn, TraceFieldMap, TraceFieldRegistry
4
+ from .types import (
5
+ TNFRGraph,
6
+ TraceFieldFn,
7
+ TraceFieldMap,
8
+ TraceFieldRegistry,
9
+ TraceMetadata,
10
+ TraceSnapshot,
11
+ )
5
12
 
6
13
  __all__: tuple[str, ...]
7
14
 
8
15
  def __getattr__(name: str) -> Any: ...
9
16
 
10
-
11
17
  class CallbackSpec(NamedTuple):
12
18
  name: str | None
13
19
  func: Callable[..., Any]
14
20
 
15
-
16
- class TraceMetadata(TypedDict, total=False):
17
- gamma: Mapping[str, Any]
18
- grammar: Mapping[str, Any]
19
- selector: str | None
20
- dnfr_weights: Mapping[str, Any]
21
- si_weights: Mapping[str, Any]
22
- si_sensitivity: Mapping[str, Any]
23
- callbacks: Mapping[str, list[str] | None]
24
- thol_open_nodes: int
25
- kuramoto: Mapping[str, float]
26
- sigma: Mapping[str, float]
27
- glyphs: Mapping[str, int]
28
-
29
-
30
- class TraceSnapshot(TraceMetadata, total=False):
31
- t: float
32
- phase: str
33
-
34
-
35
21
  kuramoto_R_psi: Callable[[TNFRGraph], tuple[float, float]]
36
22
  TRACE_FIELDS: TraceFieldRegistry
37
23
 
38
24
  def _callback_names(
39
25
  callbacks: Mapping[str, CallbackSpec] | Iterable[CallbackSpec],
40
26
  ) -> list[str]: ...
41
-
42
27
  def mapping_field(G: TNFRGraph, graph_key: str, out_key: str) -> TraceMetadata: ...
43
-
44
28
  def _trace_capture(G: TNFRGraph, phase: str, fields: TraceFieldMap) -> None: ...
45
-
46
29
  def register_trace_field(phase: str, name: str, func: TraceFieldFn) -> None: ...
47
-
48
30
  def gamma_field(G: TNFRGraph) -> TraceMetadata: ...
49
-
50
31
  def grammar_field(G: TNFRGraph) -> TraceMetadata: ...
51
-
52
32
  def dnfr_weights_field(G: TNFRGraph) -> TraceMetadata: ...
53
-
54
33
  def selector_field(G: TNFRGraph) -> TraceMetadata: ...
55
-
56
34
  def si_weights_field(G: TNFRGraph) -> TraceMetadata: ...
57
-
58
35
  def callbacks_field(G: TNFRGraph) -> TraceMetadata: ...
59
-
60
36
  def thol_state_field(G: TNFRGraph) -> TraceMetadata: ...
61
-
62
37
  def kuramoto_field(G: TNFRGraph) -> TraceMetadata: ...
63
-
64
38
  def sigma_field(G: TNFRGraph) -> TraceMetadata: ...
65
-
66
39
  def glyph_counts_field(G: TNFRGraph) -> TraceMetadata: ...
67
-
68
40
  def register_trace(G: TNFRGraph) -> None: ...