tnfr 4.5.1__py3-none-any.whl → 4.5.2__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 +91 -90
- tnfr/alias.py +546 -0
- tnfr/cache.py +578 -0
- tnfr/callback_utils.py +388 -0
- tnfr/cli/__init__.py +75 -0
- tnfr/cli/arguments.py +177 -0
- tnfr/cli/execution.py +288 -0
- tnfr/cli/utils.py +36 -0
- tnfr/collections_utils.py +300 -0
- tnfr/config.py +19 -28
- tnfr/constants/__init__.py +174 -0
- tnfr/constants/core.py +159 -0
- tnfr/constants/init.py +31 -0
- tnfr/constants/metric.py +110 -0
- tnfr/constants_glyphs.py +98 -0
- tnfr/dynamics/__init__.py +658 -0
- tnfr/dynamics/dnfr.py +733 -0
- tnfr/dynamics/integrators.py +267 -0
- tnfr/dynamics/sampling.py +31 -0
- tnfr/execution.py +201 -0
- tnfr/flatten.py +283 -0
- tnfr/gamma.py +302 -88
- tnfr/glyph_history.py +290 -0
- tnfr/grammar.py +285 -96
- tnfr/graph_utils.py +84 -0
- tnfr/helpers/__init__.py +71 -0
- tnfr/helpers/numeric.py +87 -0
- tnfr/immutable.py +178 -0
- tnfr/import_utils.py +228 -0
- tnfr/initialization.py +197 -0
- tnfr/io.py +246 -0
- tnfr/json_utils.py +162 -0
- tnfr/locking.py +37 -0
- tnfr/logging_utils.py +116 -0
- tnfr/metrics/__init__.py +41 -0
- tnfr/metrics/coherence.py +829 -0
- tnfr/metrics/common.py +151 -0
- tnfr/metrics/core.py +101 -0
- tnfr/metrics/diagnosis.py +234 -0
- tnfr/metrics/export.py +137 -0
- tnfr/metrics/glyph_timing.py +189 -0
- tnfr/metrics/reporting.py +148 -0
- tnfr/metrics/sense_index.py +120 -0
- tnfr/metrics/trig.py +181 -0
- tnfr/metrics/trig_cache.py +109 -0
- tnfr/node.py +214 -159
- tnfr/observers.py +126 -136
- tnfr/ontosim.py +134 -134
- tnfr/operators/__init__.py +420 -0
- tnfr/operators/jitter.py +203 -0
- tnfr/operators/remesh.py +485 -0
- tnfr/presets.py +46 -14
- tnfr/rng.py +254 -0
- tnfr/selector.py +210 -0
- tnfr/sense.py +284 -131
- tnfr/structural.py +207 -79
- tnfr/tokens.py +60 -0
- tnfr/trace.py +329 -94
- tnfr/types.py +43 -17
- tnfr/validators.py +70 -24
- tnfr/value_utils.py +59 -0
- tnfr-4.5.2.dist-info/METADATA +379 -0
- tnfr-4.5.2.dist-info/RECORD +67 -0
- tnfr/cli.py +0 -322
- tnfr/constants.py +0 -277
- tnfr/dynamics.py +0 -814
- tnfr/helpers.py +0 -264
- tnfr/main.py +0 -47
- tnfr/metrics.py +0 -597
- tnfr/operators.py +0 -525
- tnfr/program.py +0 -176
- tnfr/scenarios.py +0 -34
- tnfr-4.5.1.dist-info/METADATA +0 -221
- tnfr-4.5.1.dist-info/RECORD +0 -28
- {tnfr-4.5.1.dist-info → tnfr-4.5.2.dist-info}/WHEEL +0 -0
- {tnfr-4.5.1.dist-info → tnfr-4.5.2.dist-info}/entry_points.txt +0 -0
- {tnfr-4.5.1.dist-info → tnfr-4.5.2.dist-info}/licenses/LICENSE.md +0 -0
- {tnfr-4.5.1.dist-info → tnfr-4.5.2.dist-info}/top_level.txt +0 -0
tnfr/__init__.py
CHANGED
|
@@ -1,90 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from
|
|
16
|
-
|
|
17
|
-
from .
|
|
18
|
-
from .
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
from .
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
1
|
+
"""Minimal public API for :mod:`tnfr`.
|
|
2
|
+
|
|
3
|
+
This package only re-exports a handful of high level helpers. Most
|
|
4
|
+
functionality lives in submodules that should be imported directly, for
|
|
5
|
+
example :mod:`tnfr.metrics`, :mod:`tnfr.observers` or the DSL utilities
|
|
6
|
+
in :mod:`tnfr.tokens`, :mod:`tnfr.flatten` and :mod:`tnfr.execution`.
|
|
7
|
+
Recommended entry points are:
|
|
8
|
+
|
|
9
|
+
- ``step`` and ``run`` in :mod:`tnfr.dynamics`
|
|
10
|
+
- ``preparar_red`` in :mod:`tnfr.ontosim`
|
|
11
|
+
- ``create_nfr`` and ``run_sequence`` in :mod:`tnfr.structural`
|
|
12
|
+
- ``cached_import`` and ``prune_failed_imports`` for optional dependencies
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
from .import_utils import cached_import, prune_failed_imports
|
|
18
|
+
from .ontosim import preparar_red
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _missing_dependency(name: str, exc: ImportError):
|
|
22
|
+
def _stub(*args, **kwargs):
|
|
23
|
+
raise ImportError(
|
|
24
|
+
f"{name} is unavailable because required dependencies could not be imported. "
|
|
25
|
+
f"Original error ({exc.__class__.__name__}): {exc}. "
|
|
26
|
+
"Install the missing packages (e.g. 'networkx' or grammar modules)."
|
|
27
|
+
) from exc
|
|
28
|
+
|
|
29
|
+
return _stub
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
try: # pragma: no cover - exercised in import tests
|
|
33
|
+
from .dynamics import step, run
|
|
34
|
+
except ImportError as exc: # pragma: no cover - no missing deps in CI
|
|
35
|
+
step = _missing_dependency("step", exc)
|
|
36
|
+
run = _missing_dependency("run", exc)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
_HAS_RUN_SEQUENCE = False
|
|
40
|
+
try: # pragma: no cover - exercised in import tests
|
|
41
|
+
from .structural import create_nfr, run_sequence
|
|
42
|
+
except ImportError as exc: # pragma: no cover - no missing deps in CI
|
|
43
|
+
create_nfr = _missing_dependency("create_nfr", exc)
|
|
44
|
+
run_sequence = _missing_dependency("run_sequence", exc)
|
|
45
|
+
else:
|
|
46
|
+
_HAS_RUN_SEQUENCE = True
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
_metadata = cached_import("importlib.metadata")
|
|
50
|
+
if _metadata is None: # pragma: no cover
|
|
51
|
+
_metadata = cached_import("importlib_metadata")
|
|
52
|
+
|
|
53
|
+
if _metadata is not None: # pragma: no cover
|
|
54
|
+
version = _metadata.version # type: ignore[attr-defined]
|
|
55
|
+
PackageNotFoundError = _metadata.PackageNotFoundError # type: ignore[attr-defined]
|
|
56
|
+
else: # pragma: no cover
|
|
57
|
+
|
|
58
|
+
class PackageNotFoundError(Exception):
|
|
59
|
+
pass
|
|
60
|
+
|
|
61
|
+
def version(_: str) -> str:
|
|
62
|
+
raise PackageNotFoundError
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
try:
|
|
66
|
+
__version__ = version("tnfr")
|
|
67
|
+
except PackageNotFoundError: # pragma: no cover
|
|
68
|
+
tomllib = cached_import("tomllib")
|
|
69
|
+
if tomllib is not None:
|
|
70
|
+
from pathlib import Path
|
|
71
|
+
|
|
72
|
+
try:
|
|
73
|
+
with (Path(__file__).resolve().parents[2] / "pyproject.toml").open(
|
|
74
|
+
"rb",
|
|
75
|
+
) as f:
|
|
76
|
+
__version__ = tomllib.load(f)["project"]["version"]
|
|
77
|
+
except (OSError, KeyError, ValueError): # pragma: no cover
|
|
78
|
+
__version__ = "0+unknown"
|
|
79
|
+
else: # pragma: no cover
|
|
80
|
+
__version__ = "0+unknown"
|
|
81
|
+
|
|
82
|
+
__all__ = [
|
|
83
|
+
"__version__",
|
|
84
|
+
"step",
|
|
85
|
+
"run",
|
|
86
|
+
"preparar_red",
|
|
87
|
+
"create_nfr",
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
if _HAS_RUN_SEQUENCE:
|
|
91
|
+
__all__.append("run_sequence")
|