PyDecisionGraph 0.3.1.post2__cp313-cp313-win_amd64.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.
- decision_graph/__init__.py +26 -0
- decision_graph/decision_tree/__init__.py +85 -0
- decision_graph/decision_tree/bake/__infra__.pxd +502 -0
- decision_graph/decision_tree/bake/__init__.pxd +502 -0
- decision_graph/decision_tree/bake/__init__.py +29 -0
- decision_graph/decision_tree/bake/c_action.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_action.h +324 -0
- decision_graph/decision_tree/bake/c_action.pxd +54 -0
- decision_graph/decision_tree/bake/c_action.pyi +126 -0
- decision_graph/decision_tree/bake/c_action.pyx +65 -0
- decision_graph/decision_tree/bake/c_allocator_protocol.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_allocator_protocol.pxd +24 -0
- decision_graph/decision_tree/bake/c_allocator_protocol.pyi +61 -0
- decision_graph/decision_tree/bake/c_allocator_protocol.pyx +109 -0
- decision_graph/decision_tree/bake/c_bake.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_bake.h +629 -0
- decision_graph/decision_tree/bake/c_bake.pxd +52 -0
- decision_graph/decision_tree/bake/c_bake.pyi +151 -0
- decision_graph/decision_tree/bake/c_bake.pyx +142 -0
- decision_graph/decision_tree/bake/c_collections.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_collections.h +692 -0
- decision_graph/decision_tree/bake/c_collections.pxd +52 -0
- decision_graph/decision_tree/bake/c_collections.pyi +193 -0
- decision_graph/decision_tree/bake/c_collections.pyx +161 -0
- decision_graph/decision_tree/bake/c_const.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_const.h +395 -0
- decision_graph/decision_tree/bake/c_const.pxd +56 -0
- decision_graph/decision_tree/bake/c_const.pyi +305 -0
- decision_graph/decision_tree/bake/c_const.pyx +278 -0
- decision_graph/decision_tree/bake/c_edge.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_edge.h +511 -0
- decision_graph/decision_tree/bake/c_edge.pxd +117 -0
- decision_graph/decision_tree/bake/c_edge.pyi +192 -0
- decision_graph/decision_tree/bake/c_edge.pyx +270 -0
- decision_graph/decision_tree/bake/c_eval.h +848 -0
- decision_graph/decision_tree/bake/c_eval.pxd +40 -0
- decision_graph/decision_tree/bake/c_expr.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_expr.h +1900 -0
- decision_graph/decision_tree/bake/c_expr.pxd +129 -0
- decision_graph/decision_tree/bake/c_expr.pyi +280 -0
- decision_graph/decision_tree/bake/c_expr.pyx +272 -0
- decision_graph/decision_tree/bake/c_hierarchy.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_hierarchy.h +731 -0
- decision_graph/decision_tree/bake/c_hierarchy.pxd +71 -0
- decision_graph/decision_tree/bake/c_hierarchy.pyi +409 -0
- decision_graph/decision_tree/bake/c_hierarchy.pyx +277 -0
- decision_graph/decision_tree/bake/c_logic_group.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_logic_group.h +1226 -0
- decision_graph/decision_tree/bake/c_logic_group.pxd +162 -0
- decision_graph/decision_tree/bake/c_logic_group.pyi +264 -0
- decision_graph/decision_tree/bake/c_logic_group.pyx +308 -0
- decision_graph/decision_tree/bake/c_node.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_node.h +2660 -0
- decision_graph/decision_tree/bake/c_node.pxd +381 -0
- decision_graph/decision_tree/bake/c_node.pyi +438 -0
- decision_graph/decision_tree/bake/c_node.pyx +639 -0
- decision_graph/decision_tree/bake/c_reconstruct.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_reconstruct.pxd +63 -0
- decision_graph/decision_tree/bake/c_reconstruct.pyi +60 -0
- decision_graph/decision_tree/bake/c_reconstruct.pyx +252 -0
- decision_graph/decision_tree/bake/c_var.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_var.h +2054 -0
- decision_graph/decision_tree/bake/c_var.pxd +205 -0
- decision_graph/decision_tree/bake/c_var.pyi +271 -0
- decision_graph/decision_tree/bake/c_var.pyx +228 -0
- decision_graph/decision_tree/capi/__init__.pxd +33 -0
- decision_graph/decision_tree/capi/__init__.py +57 -0
- decision_graph/decision_tree/capi/c_abc.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/capi/c_abc.pxd +246 -0
- decision_graph/decision_tree/capi/c_abc.pyi +770 -0
- decision_graph/decision_tree/capi/c_abc.pyx +1529 -0
- decision_graph/decision_tree/capi/c_collection.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/capi/c_collection.pxd +22 -0
- decision_graph/decision_tree/capi/c_collection.pyi +245 -0
- decision_graph/decision_tree/capi/c_collection.pyx +138 -0
- decision_graph/decision_tree/capi/c_node.cp313-win_amd64.pyd +0 -0
- decision_graph/decision_tree/capi/c_node.pxd +95 -0
- decision_graph/decision_tree/capi/c_node.pyi +492 -0
- decision_graph/decision_tree/capi/c_node.pyx +551 -0
- decision_graph/decision_tree/exc.py +189 -0
- decision_graph/decision_tree/native/__init__.py +57 -0
- decision_graph/decision_tree/native/abc.py +1164 -0
- decision_graph/decision_tree/native/collection.py +134 -0
- decision_graph/decision_tree/native/node.py +521 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_action.c +16320 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_action.h +324 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_allocator_protocol.c +12473 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_bake.c +16485 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_bake.h +629 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_collections.c +17381 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_collections.h +692 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_const.c +20815 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_const.h +395 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_edge.c +20696 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_edge.h +511 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_eval.h +848 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_expr.c +22065 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_expr.h +1900 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_hierarchy.c +23267 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_hierarchy.h +731 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_logic_group.c +22434 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_logic_group.h +1226 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_node.c +28385 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_node.h +2660 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_reconstruct.c +15955 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_var.c +16881 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_var.h +2054 -0
- decision_graph/includes/decision_graph/decision_tree/capi/c_abc.c +59143 -0
- decision_graph/includes/decision_graph/decision_tree/capi/c_collection.c +19967 -0
- decision_graph/includes/decision_graph/decision_tree/capi/c_node.c +39220 -0
- decision_graph/logic_group/__init__.py +25 -0
- decision_graph/logic_group/base.py +100 -0
- decision_graph/logic_group/pending_request.py +384 -0
- decision_graph/webui/__init__.py +24 -0
- decision_graph/webui/bake/__init__.py +65 -0
- decision_graph/webui/bake/app.py +488 -0
- decision_graph/webui/bake/static/d3.v7.min.js +2 -0
- decision_graph/webui/bake/static/script.js +1440 -0
- decision_graph/webui/bake/static/style.css +920 -0
- decision_graph/webui/bake/templates/index.html +183 -0
- decision_graph/webui/bake/templates/offline.html +184 -0
- decision_graph/webui/capi/__init__.py +54 -0
- decision_graph/webui/capi/app.py +366 -0
- decision_graph/webui/capi/main.py +53 -0
- decision_graph/webui/capi/static/d3.v7.min.js +2 -0
- decision_graph/webui/capi/static/script.js +1026 -0
- decision_graph/webui/capi/static/style.css +656 -0
- decision_graph/webui/capi/templates/index.html +93 -0
- decision_graph/webui/capi/templates/offline.html +94 -0
- decision_graph/webui/native/__init__.py +54 -0
- decision_graph/webui/native/app.py +366 -0
- decision_graph/webui/native/main.py +53 -0
- decision_graph/webui/native/static/d3.v7.min.js +2 -0
- decision_graph/webui/native/static/script.js +1026 -0
- decision_graph/webui/native/static/style.css +656 -0
- decision_graph/webui/native/templates/index.html +93 -0
- decision_graph/webui/native/templates/offline.html +94 -0
- pydecisiongraph-0.3.1.post2.dist-info/METADATA +130 -0
- pydecisiongraph-0.3.1.post2.dist-info/RECORD +144 -0
- pydecisiongraph-0.3.1.post2.dist-info/WHEEL +5 -0
- pydecisiongraph-0.3.1.post2.dist-info/licenses/LICENSE +373 -0
- pydecisiongraph-0.3.1.post2.dist-info/top_level.txt +2 -0
- tests/bake_c_evaluator.cp313-win_amd64.pyd +0 -0
- tests/bake_eval_probe.cp313-win_amd64.pyd +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
from libc.stdlib cimport calloc
|
|
2
|
+
|
|
3
|
+
from cbase.allocator_protocol cimport AP_SHM_ALLOCATOR_DEFAULT_REGION_SIZE, c_heap_allocator_new, c_shm_allocator_new
|
|
4
|
+
|
|
5
|
+
cdef c_bool DCG_CFG_LOCKED = False
|
|
6
|
+
cdef c_bool DCG_CFG_SHARED = True
|
|
7
|
+
cdef c_bool DCG_CFG_FREELIST = True
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
cdef class ConfigContext(AllocatorConfigContext):
|
|
11
|
+
cdef void c_bind(self, allocator_protocol* schematic=NULL):
|
|
12
|
+
self.allocator_schematic = schematic if schematic else DCG_DEFAULT_ALLOCATOR
|
|
13
|
+
|
|
14
|
+
cdef void c_activate(self):
|
|
15
|
+
if 'locked' in self.overrides:
|
|
16
|
+
global DCG_CFG_LOCKED
|
|
17
|
+
DCG_CFG_LOCKED = self.overrides['locked']
|
|
18
|
+
|
|
19
|
+
if 'shared' in self.overrides:
|
|
20
|
+
global DCG_CFG_SHARED
|
|
21
|
+
DCG_CFG_SHARED = self.overrides['shared']
|
|
22
|
+
|
|
23
|
+
if 'freelist' in self.overrides:
|
|
24
|
+
global DCG_CFG_FREELIST
|
|
25
|
+
DCG_CFG_FREELIST = self.overrides['freelist']
|
|
26
|
+
|
|
27
|
+
AllocatorConfigContext.c_activate(self)
|
|
28
|
+
|
|
29
|
+
cdef void c_deactivate(self):
|
|
30
|
+
if 'locked' in self.originals:
|
|
31
|
+
global DCG_CFG_LOCKED
|
|
32
|
+
DCG_CFG_LOCKED = self.originals.get('locked')
|
|
33
|
+
|
|
34
|
+
if 'shared' in self.originals:
|
|
35
|
+
global DCG_CFG_SHARED
|
|
36
|
+
DCG_CFG_SHARED = self.originals.get('shared')
|
|
37
|
+
|
|
38
|
+
if 'freelist' in self.originals:
|
|
39
|
+
global DCG_CFG_FREELIST
|
|
40
|
+
DCG_CFG_FREELIST = self.originals.get('freelist')
|
|
41
|
+
|
|
42
|
+
AllocatorConfigContext.c_deactivate(self)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
cdef heap_allocator* HEAP_ALLOCATOR = c_heap_allocator_new()
|
|
46
|
+
if not HEAP_ALLOCATOR:
|
|
47
|
+
raise OSError("Initialize DCG heap allocator failed")
|
|
48
|
+
|
|
49
|
+
cdef shm_allocator_ctx* SHM_ALLOCATOR = c_shm_allocator_new(AP_SHM_ALLOCATOR_DEFAULT_REGION_SIZE, <char*> b"c_md_shm")
|
|
50
|
+
if not SHM_ALLOCATOR:
|
|
51
|
+
raise OSError("Initialize DCG SHM allocator failed (prefix='c_md_shm')")
|
|
52
|
+
|
|
53
|
+
cdef allocator_protocol* DCG_DEFAULT_ALLOCATOR = <allocator_protocol*> calloc(1, sizeof(allocator_protocol))
|
|
54
|
+
cdef allocator_protocol* DCG_SHM_ALLOCATOR = <allocator_protocol*> calloc(1, sizeof(allocator_protocol))
|
|
55
|
+
cdef allocator_protocol* DCG_HEAP_ALLOCATOR = <allocator_protocol*> calloc(1, sizeof(allocator_protocol))
|
|
56
|
+
|
|
57
|
+
DCG_DEFAULT_ALLOCATOR.with_lock = DCG_CFG_LOCKED
|
|
58
|
+
DCG_DEFAULT_ALLOCATOR.with_shm = DCG_CFG_SHARED
|
|
59
|
+
DCG_DEFAULT_ALLOCATOR.with_freelist = DCG_CFG_FREELIST
|
|
60
|
+
DCG_DEFAULT_ALLOCATOR.shm_allocator_ctx = SHM_ALLOCATOR
|
|
61
|
+
DCG_DEFAULT_ALLOCATOR.shm_allocator = SHM_ALLOCATOR.shm_allocator
|
|
62
|
+
DCG_DEFAULT_ALLOCATOR.heap_allocator = HEAP_ALLOCATOR
|
|
63
|
+
|
|
64
|
+
DCG_SHM_ALLOCATOR.with_lock = True
|
|
65
|
+
DCG_SHM_ALLOCATOR.with_shm = True
|
|
66
|
+
DCG_SHM_ALLOCATOR.with_freelist = True
|
|
67
|
+
DCG_SHM_ALLOCATOR.shm_allocator_ctx = SHM_ALLOCATOR
|
|
68
|
+
DCG_SHM_ALLOCATOR.shm_allocator = SHM_ALLOCATOR.shm_allocator
|
|
69
|
+
DCG_SHM_ALLOCATOR.heap_allocator = NULL
|
|
70
|
+
|
|
71
|
+
DCG_HEAP_ALLOCATOR.with_lock = True
|
|
72
|
+
DCG_HEAP_ALLOCATOR.with_shm = False
|
|
73
|
+
DCG_HEAP_ALLOCATOR.with_freelist = True
|
|
74
|
+
DCG_HEAP_ALLOCATOR.shm_allocator_ctx = NULL
|
|
75
|
+
DCG_HEAP_ALLOCATOR.shm_allocator = NULL
|
|
76
|
+
DCG_HEAP_ALLOCATOR.heap_allocator = HEAP_ALLOCATOR
|
|
77
|
+
|
|
78
|
+
cdef ConfigContext DCG_SHARED = ConfigContext(shared=True)
|
|
79
|
+
cdef ConfigContext DCG_LOCKED = ConfigContext(locked=True)
|
|
80
|
+
cdef ConfigContext DCG_LOCKFREE = ConfigContext(locked=False)
|
|
81
|
+
cdef ConfigContext DCG_FREELIST = ConfigContext(freelist=True)
|
|
82
|
+
|
|
83
|
+
globals()['DCG_SHARED'] = DCG_SHARED
|
|
84
|
+
globals()['DCG_LOCKED'] = DCG_LOCKED
|
|
85
|
+
globals()['DCG_LOCKFREE'] = DCG_LOCKFREE
|
|
86
|
+
globals()['DCG_FREELIST'] = DCG_FREELIST
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
# -- Runtime config accessor (reads live cdef globals) --------------------
|
|
90
|
+
class _RuntimeAllocatorConfig:
|
|
91
|
+
"""Property-based accessor for live DCG_CFG_* globals.
|
|
92
|
+
|
|
93
|
+
Unlike the compile-time CONFIG mappingproxy, these properties read the
|
|
94
|
+
CURRENT value, which may change when an ConfigContext is active.
|
|
95
|
+
"""
|
|
96
|
+
@property
|
|
97
|
+
def DCG_CFG_LOCKED(self):
|
|
98
|
+
return DCG_CFG_LOCKED
|
|
99
|
+
|
|
100
|
+
@property
|
|
101
|
+
def DCG_CFG_SHARED(self):
|
|
102
|
+
return DCG_CFG_SHARED
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def DCG_CFG_FREELIST(self):
|
|
106
|
+
return DCG_CFG_FREELIST
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
RUNTIME_ALLOCATOR_CONFIG = _RuntimeAllocatorConfig()
|
|
Binary file
|