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.
Files changed (144) hide show
  1. decision_graph/__init__.py +26 -0
  2. decision_graph/decision_tree/__init__.py +85 -0
  3. decision_graph/decision_tree/bake/__infra__.pxd +502 -0
  4. decision_graph/decision_tree/bake/__init__.pxd +502 -0
  5. decision_graph/decision_tree/bake/__init__.py +29 -0
  6. decision_graph/decision_tree/bake/c_action.cp313-win_amd64.pyd +0 -0
  7. decision_graph/decision_tree/bake/c_action.h +324 -0
  8. decision_graph/decision_tree/bake/c_action.pxd +54 -0
  9. decision_graph/decision_tree/bake/c_action.pyi +126 -0
  10. decision_graph/decision_tree/bake/c_action.pyx +65 -0
  11. decision_graph/decision_tree/bake/c_allocator_protocol.cp313-win_amd64.pyd +0 -0
  12. decision_graph/decision_tree/bake/c_allocator_protocol.pxd +24 -0
  13. decision_graph/decision_tree/bake/c_allocator_protocol.pyi +61 -0
  14. decision_graph/decision_tree/bake/c_allocator_protocol.pyx +109 -0
  15. decision_graph/decision_tree/bake/c_bake.cp313-win_amd64.pyd +0 -0
  16. decision_graph/decision_tree/bake/c_bake.h +629 -0
  17. decision_graph/decision_tree/bake/c_bake.pxd +52 -0
  18. decision_graph/decision_tree/bake/c_bake.pyi +151 -0
  19. decision_graph/decision_tree/bake/c_bake.pyx +142 -0
  20. decision_graph/decision_tree/bake/c_collections.cp313-win_amd64.pyd +0 -0
  21. decision_graph/decision_tree/bake/c_collections.h +692 -0
  22. decision_graph/decision_tree/bake/c_collections.pxd +52 -0
  23. decision_graph/decision_tree/bake/c_collections.pyi +193 -0
  24. decision_graph/decision_tree/bake/c_collections.pyx +161 -0
  25. decision_graph/decision_tree/bake/c_const.cp313-win_amd64.pyd +0 -0
  26. decision_graph/decision_tree/bake/c_const.h +395 -0
  27. decision_graph/decision_tree/bake/c_const.pxd +56 -0
  28. decision_graph/decision_tree/bake/c_const.pyi +305 -0
  29. decision_graph/decision_tree/bake/c_const.pyx +278 -0
  30. decision_graph/decision_tree/bake/c_edge.cp313-win_amd64.pyd +0 -0
  31. decision_graph/decision_tree/bake/c_edge.h +511 -0
  32. decision_graph/decision_tree/bake/c_edge.pxd +117 -0
  33. decision_graph/decision_tree/bake/c_edge.pyi +192 -0
  34. decision_graph/decision_tree/bake/c_edge.pyx +270 -0
  35. decision_graph/decision_tree/bake/c_eval.h +848 -0
  36. decision_graph/decision_tree/bake/c_eval.pxd +40 -0
  37. decision_graph/decision_tree/bake/c_expr.cp313-win_amd64.pyd +0 -0
  38. decision_graph/decision_tree/bake/c_expr.h +1900 -0
  39. decision_graph/decision_tree/bake/c_expr.pxd +129 -0
  40. decision_graph/decision_tree/bake/c_expr.pyi +280 -0
  41. decision_graph/decision_tree/bake/c_expr.pyx +272 -0
  42. decision_graph/decision_tree/bake/c_hierarchy.cp313-win_amd64.pyd +0 -0
  43. decision_graph/decision_tree/bake/c_hierarchy.h +731 -0
  44. decision_graph/decision_tree/bake/c_hierarchy.pxd +71 -0
  45. decision_graph/decision_tree/bake/c_hierarchy.pyi +409 -0
  46. decision_graph/decision_tree/bake/c_hierarchy.pyx +277 -0
  47. decision_graph/decision_tree/bake/c_logic_group.cp313-win_amd64.pyd +0 -0
  48. decision_graph/decision_tree/bake/c_logic_group.h +1226 -0
  49. decision_graph/decision_tree/bake/c_logic_group.pxd +162 -0
  50. decision_graph/decision_tree/bake/c_logic_group.pyi +264 -0
  51. decision_graph/decision_tree/bake/c_logic_group.pyx +308 -0
  52. decision_graph/decision_tree/bake/c_node.cp313-win_amd64.pyd +0 -0
  53. decision_graph/decision_tree/bake/c_node.h +2660 -0
  54. decision_graph/decision_tree/bake/c_node.pxd +381 -0
  55. decision_graph/decision_tree/bake/c_node.pyi +438 -0
  56. decision_graph/decision_tree/bake/c_node.pyx +639 -0
  57. decision_graph/decision_tree/bake/c_reconstruct.cp313-win_amd64.pyd +0 -0
  58. decision_graph/decision_tree/bake/c_reconstruct.pxd +63 -0
  59. decision_graph/decision_tree/bake/c_reconstruct.pyi +60 -0
  60. decision_graph/decision_tree/bake/c_reconstruct.pyx +252 -0
  61. decision_graph/decision_tree/bake/c_var.cp313-win_amd64.pyd +0 -0
  62. decision_graph/decision_tree/bake/c_var.h +2054 -0
  63. decision_graph/decision_tree/bake/c_var.pxd +205 -0
  64. decision_graph/decision_tree/bake/c_var.pyi +271 -0
  65. decision_graph/decision_tree/bake/c_var.pyx +228 -0
  66. decision_graph/decision_tree/capi/__init__.pxd +33 -0
  67. decision_graph/decision_tree/capi/__init__.py +57 -0
  68. decision_graph/decision_tree/capi/c_abc.cp313-win_amd64.pyd +0 -0
  69. decision_graph/decision_tree/capi/c_abc.pxd +246 -0
  70. decision_graph/decision_tree/capi/c_abc.pyi +770 -0
  71. decision_graph/decision_tree/capi/c_abc.pyx +1529 -0
  72. decision_graph/decision_tree/capi/c_collection.cp313-win_amd64.pyd +0 -0
  73. decision_graph/decision_tree/capi/c_collection.pxd +22 -0
  74. decision_graph/decision_tree/capi/c_collection.pyi +245 -0
  75. decision_graph/decision_tree/capi/c_collection.pyx +138 -0
  76. decision_graph/decision_tree/capi/c_node.cp313-win_amd64.pyd +0 -0
  77. decision_graph/decision_tree/capi/c_node.pxd +95 -0
  78. decision_graph/decision_tree/capi/c_node.pyi +492 -0
  79. decision_graph/decision_tree/capi/c_node.pyx +551 -0
  80. decision_graph/decision_tree/exc.py +189 -0
  81. decision_graph/decision_tree/native/__init__.py +57 -0
  82. decision_graph/decision_tree/native/abc.py +1164 -0
  83. decision_graph/decision_tree/native/collection.py +134 -0
  84. decision_graph/decision_tree/native/node.py +521 -0
  85. decision_graph/includes/decision_graph/decision_tree/bake/c_action.c +16320 -0
  86. decision_graph/includes/decision_graph/decision_tree/bake/c_action.h +324 -0
  87. decision_graph/includes/decision_graph/decision_tree/bake/c_allocator_protocol.c +12473 -0
  88. decision_graph/includes/decision_graph/decision_tree/bake/c_bake.c +16485 -0
  89. decision_graph/includes/decision_graph/decision_tree/bake/c_bake.h +629 -0
  90. decision_graph/includes/decision_graph/decision_tree/bake/c_collections.c +17381 -0
  91. decision_graph/includes/decision_graph/decision_tree/bake/c_collections.h +692 -0
  92. decision_graph/includes/decision_graph/decision_tree/bake/c_const.c +20815 -0
  93. decision_graph/includes/decision_graph/decision_tree/bake/c_const.h +395 -0
  94. decision_graph/includes/decision_graph/decision_tree/bake/c_edge.c +20696 -0
  95. decision_graph/includes/decision_graph/decision_tree/bake/c_edge.h +511 -0
  96. decision_graph/includes/decision_graph/decision_tree/bake/c_eval.h +848 -0
  97. decision_graph/includes/decision_graph/decision_tree/bake/c_expr.c +22065 -0
  98. decision_graph/includes/decision_graph/decision_tree/bake/c_expr.h +1900 -0
  99. decision_graph/includes/decision_graph/decision_tree/bake/c_hierarchy.c +23267 -0
  100. decision_graph/includes/decision_graph/decision_tree/bake/c_hierarchy.h +731 -0
  101. decision_graph/includes/decision_graph/decision_tree/bake/c_logic_group.c +22434 -0
  102. decision_graph/includes/decision_graph/decision_tree/bake/c_logic_group.h +1226 -0
  103. decision_graph/includes/decision_graph/decision_tree/bake/c_node.c +28385 -0
  104. decision_graph/includes/decision_graph/decision_tree/bake/c_node.h +2660 -0
  105. decision_graph/includes/decision_graph/decision_tree/bake/c_reconstruct.c +15955 -0
  106. decision_graph/includes/decision_graph/decision_tree/bake/c_var.c +16881 -0
  107. decision_graph/includes/decision_graph/decision_tree/bake/c_var.h +2054 -0
  108. decision_graph/includes/decision_graph/decision_tree/capi/c_abc.c +59143 -0
  109. decision_graph/includes/decision_graph/decision_tree/capi/c_collection.c +19967 -0
  110. decision_graph/includes/decision_graph/decision_tree/capi/c_node.c +39220 -0
  111. decision_graph/logic_group/__init__.py +25 -0
  112. decision_graph/logic_group/base.py +100 -0
  113. decision_graph/logic_group/pending_request.py +384 -0
  114. decision_graph/webui/__init__.py +24 -0
  115. decision_graph/webui/bake/__init__.py +65 -0
  116. decision_graph/webui/bake/app.py +488 -0
  117. decision_graph/webui/bake/static/d3.v7.min.js +2 -0
  118. decision_graph/webui/bake/static/script.js +1440 -0
  119. decision_graph/webui/bake/static/style.css +920 -0
  120. decision_graph/webui/bake/templates/index.html +183 -0
  121. decision_graph/webui/bake/templates/offline.html +184 -0
  122. decision_graph/webui/capi/__init__.py +54 -0
  123. decision_graph/webui/capi/app.py +366 -0
  124. decision_graph/webui/capi/main.py +53 -0
  125. decision_graph/webui/capi/static/d3.v7.min.js +2 -0
  126. decision_graph/webui/capi/static/script.js +1026 -0
  127. decision_graph/webui/capi/static/style.css +656 -0
  128. decision_graph/webui/capi/templates/index.html +93 -0
  129. decision_graph/webui/capi/templates/offline.html +94 -0
  130. decision_graph/webui/native/__init__.py +54 -0
  131. decision_graph/webui/native/app.py +366 -0
  132. decision_graph/webui/native/main.py +53 -0
  133. decision_graph/webui/native/static/d3.v7.min.js +2 -0
  134. decision_graph/webui/native/static/script.js +1026 -0
  135. decision_graph/webui/native/static/style.css +656 -0
  136. decision_graph/webui/native/templates/index.html +93 -0
  137. decision_graph/webui/native/templates/offline.html +94 -0
  138. pydecisiongraph-0.3.1.post2.dist-info/METADATA +130 -0
  139. pydecisiongraph-0.3.1.post2.dist-info/RECORD +144 -0
  140. pydecisiongraph-0.3.1.post2.dist-info/WHEEL +5 -0
  141. pydecisiongraph-0.3.1.post2.dist-info/licenses/LICENSE +373 -0
  142. pydecisiongraph-0.3.1.post2.dist-info/top_level.txt +2 -0
  143. tests/bake_c_evaluator.cp313-win_amd64.pyd +0 -0
  144. 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()