thundergraph-model 1.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.
- tg_model/__init__.py +46 -0
- tg_model/analysis/__init__.py +38 -0
- tg_model/analysis/_coherence.py +91 -0
- tg_model/analysis/compare_variants.py +197 -0
- tg_model/analysis/impact.py +101 -0
- tg_model/analysis/sweep.py +199 -0
- tg_model/execution/__init__.py +122 -0
- tg_model/execution/behavior.py +826 -0
- tg_model/execution/configured_model.py +754 -0
- tg_model/execution/connection_bindings.py +87 -0
- tg_model/execution/dependency_graph.py +217 -0
- tg_model/execution/evaluator.py +419 -0
- tg_model/execution/external_ops.py +153 -0
- tg_model/execution/graph_compiler.py +1110 -0
- tg_model/execution/instances.py +274 -0
- tg_model/execution/requirements.py +104 -0
- tg_model/execution/rollups.py +60 -0
- tg_model/execution/run_context.py +304 -0
- tg_model/execution/solve_groups.py +104 -0
- tg_model/execution/validation.py +211 -0
- tg_model/execution/value_slots.py +63 -0
- tg_model/export/__init__.py +7 -0
- tg_model/integrations/__init__.py +36 -0
- tg_model/integrations/external_compute.py +122 -0
- tg_model/model/__init__.py +39 -0
- tg_model/model/compile_types.py +896 -0
- tg_model/model/declarations/__init__.py +8 -0
- tg_model/model/declarations/behavior.py +37 -0
- tg_model/model/declarations/values.py +53 -0
- tg_model/model/definition_context.py +1742 -0
- tg_model/model/elements.py +159 -0
- tg_model/model/expr.py +75 -0
- tg_model/model/identity.py +63 -0
- tg_model/model/refs.py +319 -0
- thundergraph_model-1.0.0.dist-info/METADATA +82 -0
- thundergraph_model-1.0.0.dist-info/RECORD +38 -0
- thundergraph_model-1.0.0.dist-info/WHEEL +4 -0
- thundergraph_model-1.0.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"""Execution subsystem: frozen topology, dependency graph, validation, and evaluation.
|
|
2
|
+
|
|
3
|
+
Typical pipeline: compile element types (``SomeSystem.compile()``), build a
|
|
4
|
+
:class:`~tg_model.execution.configured_model.ConfiguredModel` with
|
|
5
|
+
:func:`~tg_model.execution.configured_model.instantiate`, then call
|
|
6
|
+
:meth:`~tg_model.execution.configured_model.ConfiguredModel.evaluate` (lazy compile + optional
|
|
7
|
+
validation per call) **or** explicitly :func:`~tg_model.execution.graph_compiler.compile_graph`,
|
|
8
|
+
optionally :func:`~tg_model.execution.validation.validate_graph`, then run
|
|
9
|
+
:class:`~tg_model.execution.evaluator.Evaluator` with a fresh
|
|
10
|
+
:class:`~tg_model.execution.run_context.RunContext`. Per-run values live in ``RunContext``; the
|
|
11
|
+
configured model may cache a compiled graph on the instance.
|
|
12
|
+
|
|
13
|
+
Notes
|
|
14
|
+
-----
|
|
15
|
+
Behavioral APIs (:func:`~tg_model.execution.behavior.dispatch_event`, etc.) mutate
|
|
16
|
+
:class:`~tg_model.execution.run_context.RunContext` discrete state and optional
|
|
17
|
+
:class:`~tg_model.execution.behavior.BehaviorTrace` records; they do not change
|
|
18
|
+
:class:`~tg_model.execution.configured_model.ConfiguredModel` topology.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from tg_model.execution.behavior import (
|
|
22
|
+
BehaviorStep,
|
|
23
|
+
BehaviorTrace,
|
|
24
|
+
DecisionDispatchOutcome,
|
|
25
|
+
DecisionDispatchResult,
|
|
26
|
+
DecisionTraceStep,
|
|
27
|
+
DispatchOutcome,
|
|
28
|
+
DispatchResult,
|
|
29
|
+
ForkJoinTraceStep,
|
|
30
|
+
ItemFlowStep,
|
|
31
|
+
MergeTraceStep,
|
|
32
|
+
SequenceTraceStep,
|
|
33
|
+
behavior_authoring_projection,
|
|
34
|
+
behavior_trace_to_records,
|
|
35
|
+
dispatch_decision,
|
|
36
|
+
dispatch_event,
|
|
37
|
+
dispatch_fork_join,
|
|
38
|
+
dispatch_merge,
|
|
39
|
+
dispatch_sequence,
|
|
40
|
+
emit_item,
|
|
41
|
+
scenario_expected_event_names,
|
|
42
|
+
trace_events_chronological,
|
|
43
|
+
validate_scenario_trace,
|
|
44
|
+
)
|
|
45
|
+
from tg_model.execution.configured_model import ConfiguredModel, instantiate
|
|
46
|
+
from tg_model.execution.connection_bindings import (
|
|
47
|
+
AllocationBinding,
|
|
48
|
+
ConnectionBinding,
|
|
49
|
+
ReferenceBinding,
|
|
50
|
+
)
|
|
51
|
+
from tg_model.execution.dependency_graph import DependencyGraph, DependencyNode, NodeKind
|
|
52
|
+
from tg_model.execution.evaluator import Evaluator, RunResult
|
|
53
|
+
from tg_model.execution.graph_compiler import GraphCompilationError, compile_graph
|
|
54
|
+
from tg_model.execution.instances import (
|
|
55
|
+
ElementInstance,
|
|
56
|
+
PartInstance,
|
|
57
|
+
PortInstance,
|
|
58
|
+
RequirementPackageInstance,
|
|
59
|
+
)
|
|
60
|
+
from tg_model.execution.requirements import (
|
|
61
|
+
RequirementSatisfactionResult,
|
|
62
|
+
RequirementSatisfactionSummary,
|
|
63
|
+
all_requirements_satisfied,
|
|
64
|
+
iter_requirement_satisfaction,
|
|
65
|
+
summarize_requirement_satisfaction,
|
|
66
|
+
)
|
|
67
|
+
from tg_model.execution.run_context import ConstraintResult, RunContext, SlotState
|
|
68
|
+
from tg_model.execution.validation import GraphValidationError, ValidationResult, validate_graph
|
|
69
|
+
from tg_model.execution.value_slots import ValueSlot
|
|
70
|
+
|
|
71
|
+
__all__ = [
|
|
72
|
+
"AllocationBinding",
|
|
73
|
+
"BehaviorStep",
|
|
74
|
+
"BehaviorTrace",
|
|
75
|
+
"ConfiguredModel",
|
|
76
|
+
"ConnectionBinding",
|
|
77
|
+
"ConstraintResult",
|
|
78
|
+
"DecisionDispatchOutcome",
|
|
79
|
+
"DecisionDispatchResult",
|
|
80
|
+
"DecisionTraceStep",
|
|
81
|
+
"DependencyGraph",
|
|
82
|
+
"DependencyNode",
|
|
83
|
+
"DispatchOutcome",
|
|
84
|
+
"DispatchResult",
|
|
85
|
+
"ElementInstance",
|
|
86
|
+
"Evaluator",
|
|
87
|
+
"ForkJoinTraceStep",
|
|
88
|
+
"GraphCompilationError",
|
|
89
|
+
"GraphValidationError",
|
|
90
|
+
"ItemFlowStep",
|
|
91
|
+
"MergeTraceStep",
|
|
92
|
+
"NodeKind",
|
|
93
|
+
"PartInstance",
|
|
94
|
+
"PortInstance",
|
|
95
|
+
"ReferenceBinding",
|
|
96
|
+
"RequirementPackageInstance",
|
|
97
|
+
"RequirementSatisfactionResult",
|
|
98
|
+
"RequirementSatisfactionSummary",
|
|
99
|
+
"RunContext",
|
|
100
|
+
"RunResult",
|
|
101
|
+
"SequenceTraceStep",
|
|
102
|
+
"SlotState",
|
|
103
|
+
"ValidationResult",
|
|
104
|
+
"ValueSlot",
|
|
105
|
+
"all_requirements_satisfied",
|
|
106
|
+
"behavior_authoring_projection",
|
|
107
|
+
"behavior_trace_to_records",
|
|
108
|
+
"compile_graph",
|
|
109
|
+
"dispatch_decision",
|
|
110
|
+
"dispatch_event",
|
|
111
|
+
"dispatch_fork_join",
|
|
112
|
+
"dispatch_merge",
|
|
113
|
+
"dispatch_sequence",
|
|
114
|
+
"emit_item",
|
|
115
|
+
"instantiate",
|
|
116
|
+
"iter_requirement_satisfaction",
|
|
117
|
+
"scenario_expected_event_names",
|
|
118
|
+
"summarize_requirement_satisfaction",
|
|
119
|
+
"trace_events_chronological",
|
|
120
|
+
"validate_graph",
|
|
121
|
+
"validate_scenario_trace",
|
|
122
|
+
]
|