cimba 0.1.0__tar.gz

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 (281) hide show
  1. cimba-0.1.0/.codex +0 -0
  2. cimba-0.1.0/.github/dependabot.yml +13 -0
  3. cimba-0.1.0/.github/workflows/ci.yml +85 -0
  4. cimba-0.1.0/.github/workflows/release.yml +151 -0
  5. cimba-0.1.0/.gitignore +21 -0
  6. cimba-0.1.0/.gitmodules +3 -0
  7. cimba-0.1.0/.python-version +1 -0
  8. cimba-0.1.0/LICENSE +201 -0
  9. cimba-0.1.0/NOTICE +15 -0
  10. cimba-0.1.0/PKG-INFO +188 -0
  11. cimba-0.1.0/README.md +163 -0
  12. cimba-0.1.0/benchmarks/AMD_Ryzen_7_9700X_WSL.ods +0 -0
  13. cimba-0.1.0/benchmarks/MM1_multi.py +140 -0
  14. cimba-0.1.0/benchmarks/MM1_single.py +87 -0
  15. cimba-0.1.0/main.py +4 -0
  16. cimba-0.1.0/meson.build +93 -0
  17. cimba-0.1.0/pyproject.toml +73 -0
  18. cimba-0.1.0/src/cimba/__init__.py +114 -0
  19. cimba-0.1.0/src/cimba/__init__.pyi +61 -0
  20. cimba-0.1.0/src/cimba/_cimba.pyi +57 -0
  21. cimba-0.1.0/src/cimba/_cimba.pyx +23 -0
  22. cimba-0.1.0/src/cimba/_cython/cimba.pxi +375 -0
  23. cimba-0.1.0/src/cimba/_cython/cmb_buffer.pxi +77 -0
  24. cimba-0.1.0/src/cimba/_cython/cmb_condition.pxi +64 -0
  25. cimba-0.1.0/src/cimba/_cython/cmb_dataset.pxi +62 -0
  26. cimba-0.1.0/src/cimba/_cython/cmb_datasummary.pxi +85 -0
  27. cimba-0.1.0/src/cimba/_cython/cmb_event.pxi +125 -0
  28. cimba-0.1.0/src/cimba/_cython/cmb_logger.pxi +10 -0
  29. cimba-0.1.0/src/cimba/_cython/cmb_objectqueue.pxi +93 -0
  30. cimba-0.1.0/src/cimba/_cython/cmb_priorityqueue.pxi +122 -0
  31. cimba-0.1.0/src/cimba/_cython/cmb_process.pxi +197 -0
  32. cimba-0.1.0/src/cimba/_cython/cmb_random.pxi +73 -0
  33. cimba-0.1.0/src/cimba/_cython/cmb_resource.pxi +75 -0
  34. cimba-0.1.0/src/cimba/_cython/cmb_resourcepool.pxi +82 -0
  35. cimba-0.1.0/src/cimba/_cython/cmb_timeseries.pxi +82 -0
  36. cimba-0.1.0/src/cimba/_cython/cmb_wtdsummary.pxi +90 -0
  37. cimba-0.1.0/src/cimba/_types.pyi +24 -0
  38. cimba-0.1.0/src/cimba/cimba.py +5 -0
  39. cimba-0.1.0/src/cimba/cimba.pyi +5 -0
  40. cimba-0.1.0/src/cimba/cmb_buffer.py +5 -0
  41. cimba-0.1.0/src/cimba/cmb_buffer.pyi +68 -0
  42. cimba-0.1.0/src/cimba/cmb_condition.py +5 -0
  43. cimba-0.1.0/src/cimba/cmb_condition.pyi +31 -0
  44. cimba-0.1.0/src/cimba/cmb_dataset.py +5 -0
  45. cimba-0.1.0/src/cimba/cmb_dataset.pyi +47 -0
  46. cimba-0.1.0/src/cimba/cmb_datasummary.py +5 -0
  47. cimba-0.1.0/src/cimba/cmb_datasummary.pyi +58 -0
  48. cimba-0.1.0/src/cimba/cmb_event.py +5 -0
  49. cimba-0.1.0/src/cimba/cmb_event.pyi +77 -0
  50. cimba-0.1.0/src/cimba/cmb_logger.py +19 -0
  51. cimba-0.1.0/src/cimba/cmb_logger.pyi +22 -0
  52. cimba-0.1.0/src/cimba/cmb_objectqueue.py +5 -0
  53. cimba-0.1.0/src/cimba/cmb_objectqueue.pyi +59 -0
  54. cimba-0.1.0/src/cimba/cmb_priorityqueue.py +5 -0
  55. cimba-0.1.0/src/cimba/cmb_priorityqueue.pyi +77 -0
  56. cimba-0.1.0/src/cimba/cmb_process.py +35 -0
  57. cimba-0.1.0/src/cimba/cmb_process.pyi +122 -0
  58. cimba-0.1.0/src/cimba/cmb_random.py +41 -0
  59. cimba-0.1.0/src/cimba/cmb_random.pyi +69 -0
  60. cimba-0.1.0/src/cimba/cmb_resource.py +5 -0
  61. cimba-0.1.0/src/cimba/cmb_resource.pyi +59 -0
  62. cimba-0.1.0/src/cimba/cmb_resourcepool.py +5 -0
  63. cimba-0.1.0/src/cimba/cmb_resourcepool.pyi +64 -0
  64. cimba-0.1.0/src/cimba/cmb_timeseries.py +5 -0
  65. cimba-0.1.0/src/cimba/cmb_timeseries.pyi +51 -0
  66. cimba-0.1.0/src/cimba/cmb_wtdsummary.py +5 -0
  67. cimba-0.1.0/src/cimba/cmb_wtdsummary.pyi +63 -0
  68. cimba-0.1.0/src/cimba/py.typed +0 -0
  69. cimba-0.1.0/subprojects/cimba/.clang-format +58 -0
  70. cimba-0.1.0/subprojects/cimba/.clangd +3 -0
  71. cimba-0.1.0/subprojects/cimba/.gitattributes +5 -0
  72. cimba-0.1.0/subprojects/cimba/.github/workflows/ci.yml +54 -0
  73. cimba-0.1.0/subprojects/cimba/.gitignore +176 -0
  74. cimba-0.1.0/subprojects/cimba/.readthedocs.yaml +16 -0
  75. cimba-0.1.0/subprojects/cimba/CHANGELOG.md +19 -0
  76. cimba-0.1.0/subprojects/cimba/LICENSE +201 -0
  77. cimba-0.1.0/subprojects/cimba/NOTICE +84 -0
  78. cimba-0.1.0/subprojects/cimba/README.md +352 -0
  79. cimba-0.1.0/subprojects/cimba/benchmark/AMD_Threadripper_3970x.ods +0 -0
  80. cimba-0.1.0/subprojects/cimba/benchmark/MM1_multi.c +164 -0
  81. cimba-0.1.0/subprojects/cimba/benchmark/MM1_multi.py +58 -0
  82. cimba-0.1.0/subprojects/cimba/benchmark/MM1_single.c +139 -0
  83. cimba-0.1.0/subprojects/cimba/benchmark/MM1_single.py +42 -0
  84. cimba-0.1.0/subprojects/cimba/benchmark/meson.build +19 -0
  85. cimba-0.1.0/subprojects/cimba/codegen/calc.h +76 -0
  86. cimba-0.1.0/subprojects/cimba/codegen/calc_exponential.c +243 -0
  87. cimba-0.1.0/subprojects/cimba/codegen/calc_normal.c +320 -0
  88. cimba-0.1.0/subprojects/cimba/codegen/calc_utils.c +58 -0
  89. cimba-0.1.0/subprojects/cimba/codegen/meson.build +33 -0
  90. cimba-0.1.0/subprojects/cimba/config/AddToEnv.ps1 +50 -0
  91. cimba-0.1.0/subprojects/cimba/config/mingw.ini +8 -0
  92. cimba-0.1.0/subprojects/cimba/docs/Doxyfile +22 -0
  93. cimba-0.1.0/subprojects/cimba/docs/Doxyfile.in +25 -0
  94. cimba-0.1.0/subprojects/cimba/docs/background.rst +1468 -0
  95. cimba-0.1.0/subprojects/cimba/docs/conf.py +63 -0
  96. cimba-0.1.0/subprojects/cimba/docs/conf.py.in +42 -0
  97. cimba-0.1.0/subprojects/cimba/docs/index.rst +14 -0
  98. cimba-0.1.0/subprojects/cimba/docs/installation.rst +122 -0
  99. cimba-0.1.0/subprojects/cimba/docs/meson.build +55 -0
  100. cimba-0.1.0/subprojects/cimba/docs/requirements.txt +4 -0
  101. cimba-0.1.0/subprojects/cimba/docs/static/custom.css +17 -0
  102. cimba-0.1.0/subprojects/cimba/docs/tutorial.rst +3138 -0
  103. cimba-0.1.0/subprojects/cimba/docs/welcome.rst +127 -0
  104. cimba-0.1.0/subprojects/cimba/images/MG1 example.png +0 -0
  105. cimba-0.1.0/subprojects/cimba/images/Speed_test_AMD_3970x.png +0 -0
  106. cimba-0.1.0/subprojects/cimba/images/crossplot_random.png +0 -0
  107. cimba-0.1.0/subprojects/cimba/images/debugger_assert.png +0 -0
  108. cimba-0.1.0/subprojects/cimba/images/logo_large.jpg +0 -0
  109. cimba-0.1.0/subprojects/cimba/images/logo_small.png +0 -0
  110. cimba-0.1.0/subprojects/cimba/images/stack illustrations.odg +0 -0
  111. cimba-0.1.0/subprojects/cimba/images/stack_1.png +0 -0
  112. cimba-0.1.0/subprojects/cimba/images/stack_2.png +0 -0
  113. cimba-0.1.0/subprojects/cimba/images/stack_3.png +0 -0
  114. cimba-0.1.0/subprojects/cimba/images/stack_4.png +0 -0
  115. cimba-0.1.0/subprojects/cimba/images/stack_5.png +0 -0
  116. cimba-0.1.0/subprojects/cimba/images/stack_6.png +0 -0
  117. cimba-0.1.0/subprojects/cimba/images/stack_7.png +0 -0
  118. cimba-0.1.0/subprojects/cimba/images/test_suite.png +0 -0
  119. cimba-0.1.0/subprojects/cimba/images/tut_1_6.png +0 -0
  120. cimba-0.1.0/subprojects/cimba/images/tut_4_2.png +0 -0
  121. cimba-0.1.0/subprojects/cimba/images/tut_5_1.png +0 -0
  122. cimba-0.1.0/subprojects/cimba/include/cimba.h +198 -0
  123. cimba-0.1.0/subprojects/cimba/include/cmb_assert.h +94 -0
  124. cimba-0.1.0/subprojects/cimba/include/cmb_buffer.h +242 -0
  125. cimba-0.1.0/subprojects/cimba/include/cmb_condition.h +208 -0
  126. cimba-0.1.0/subprojects/cimba/include/cmb_dataset.h +310 -0
  127. cimba-0.1.0/subprojects/cimba/include/cmb_datasummary.h +259 -0
  128. cimba-0.1.0/subprojects/cimba/include/cmb_event.h +325 -0
  129. cimba-0.1.0/subprojects/cimba/include/cmb_logger.h +215 -0
  130. cimba-0.1.0/subprojects/cimba/include/cmb_objectqueue.h +237 -0
  131. cimba-0.1.0/subprojects/cimba/include/cmb_priorityqueue.h +269 -0
  132. cimba-0.1.0/subprojects/cimba/include/cmb_process.h +515 -0
  133. cimba-0.1.0/subprojects/cimba/include/cmb_random.h +942 -0
  134. cimba-0.1.0/subprojects/cimba/include/cmb_resource.h +222 -0
  135. cimba-0.1.0/subprojects/cimba/include/cmb_resourceguard.h +180 -0
  136. cimba-0.1.0/subprojects/cimba/include/cmb_resourcepool.h +267 -0
  137. cimba-0.1.0/subprojects/cimba/include/cmb_timeseries.h +353 -0
  138. cimba-0.1.0/subprojects/cimba/include/cmb_wtdsummary.h +260 -0
  139. cimba-0.1.0/subprojects/cimba/include/meson.build +24 -0
  140. cimba-0.1.0/subprojects/cimba/meson.build +120 -0
  141. cimba-0.1.0/subprojects/cimba/meson_options.txt +12 -0
  142. cimba-0.1.0/subprojects/cimba/setup_MinGW.bat +70 -0
  143. cimba-0.1.0/subprojects/cimba/src/cimba.c +188 -0
  144. cimba-0.1.0/subprojects/cimba/src/cmb_assert.c +36 -0
  145. cimba-0.1.0/subprojects/cimba/src/cmb_buffer.c +348 -0
  146. cimba-0.1.0/subprojects/cimba/src/cmb_condition.c +191 -0
  147. cimba-0.1.0/subprojects/cimba/src/cmb_dataset.c +805 -0
  148. cimba-0.1.0/subprojects/cimba/src/cmb_datasummary.c +250 -0
  149. cimba-0.1.0/subprojects/cimba/src/cmb_event.c +508 -0
  150. cimba-0.1.0/subprojects/cimba/src/cmb_logger.c +287 -0
  151. cimba-0.1.0/subprojects/cimba/src/cmb_objectqueue.c +337 -0
  152. cimba-0.1.0/subprojects/cimba/src/cmb_priorityqueue.c +321 -0
  153. cimba-0.1.0/subprojects/cimba/src/cmb_process.c +760 -0
  154. cimba-0.1.0/subprojects/cimba/src/cmb_random.c +766 -0
  155. cimba-0.1.0/subprojects/cimba/src/cmb_resource.c +320 -0
  156. cimba-0.1.0/subprojects/cimba/src/cmb_resourceguard.c +339 -0
  157. cimba-0.1.0/subprojects/cimba/src/cmb_resourcepool.c +605 -0
  158. cimba-0.1.0/subprojects/cimba/src/cmb_timeseries.c +543 -0
  159. cimba-0.1.0/subprojects/cimba/src/cmb_wtdsummary.c +205 -0
  160. cimba-0.1.0/subprojects/cimba/src/cmi_config.h +68 -0
  161. cimba-0.1.0/subprojects/cimba/src/cmi_coroutine.c +316 -0
  162. cimba-0.1.0/subprojects/cimba/src/cmi_coroutine.h +280 -0
  163. cimba-0.1.0/subprojects/cimba/src/cmi_dataset.h +68 -0
  164. cimba-0.1.0/subprojects/cimba/src/cmi_hashheap.c +899 -0
  165. cimba-0.1.0/subprojects/cimba/src/cmi_hashheap.h +380 -0
  166. cimba-0.1.0/subprojects/cimba/src/cmi_holdable.c +36 -0
  167. cimba-0.1.0/subprojects/cimba/src/cmi_holdable.h +96 -0
  168. cimba-0.1.0/subprojects/cimba/src/cmi_mempool.c +215 -0
  169. cimba-0.1.0/subprojects/cimba/src/cmi_mempool.h +161 -0
  170. cimba-0.1.0/subprojects/cimba/src/cmi_memutils.h +115 -0
  171. cimba-0.1.0/subprojects/cimba/src/cmi_process.h +85 -0
  172. cimba-0.1.0/subprojects/cimba/src/cmi_resourcebase.c +64 -0
  173. cimba-0.1.0/subprojects/cimba/src/cmi_resourcebase.h +76 -0
  174. cimba-0.1.0/subprojects/cimba/src/cmi_slist.h +94 -0
  175. cimba-0.1.0/subprojects/cimba/src/meson.build +67 -0
  176. cimba-0.1.0/subprojects/cimba/src/port/meson.build +2 -0
  177. cimba-0.1.0/subprojects/cimba/src/port/x86-64/linux/cmb_random_hwseed.c +65 -0
  178. cimba-0.1.0/subprojects/cimba/src/port/x86-64/linux/cmi_coroutine_context.asm +148 -0
  179. cimba-0.1.0/subprojects/cimba/src/port/x86-64/linux/cmi_coroutine_context.c +256 -0
  180. cimba-0.1.0/subprojects/cimba/src/port/x86-64/linux/cmi_cpu_cores.c +26 -0
  181. cimba-0.1.0/subprojects/cimba/src/port/x86-64/linux/cmi_memutils.c +98 -0
  182. cimba-0.1.0/subprojects/cimba/src/port/x86-64/linux/cmi_random_hwseed.asm +65 -0
  183. cimba-0.1.0/subprojects/cimba/src/port/x86-64/linux/meson.build +13 -0
  184. cimba-0.1.0/subprojects/cimba/src/port/x86-64/meson.build +9 -0
  185. cimba-0.1.0/subprojects/cimba/src/port/x86-64/windows/cmb_random_hwseed.c +63 -0
  186. cimba-0.1.0/subprojects/cimba/src/port/x86-64/windows/cmi_coroutine_context.asm +232 -0
  187. cimba-0.1.0/subprojects/cimba/src/port/x86-64/windows/cmi_coroutine_context.c +227 -0
  188. cimba-0.1.0/subprojects/cimba/src/port/x86-64/windows/cmi_cpu_cores.c +29 -0
  189. cimba-0.1.0/subprojects/cimba/src/port/x86-64/windows/cmi_memutils.c +96 -0
  190. cimba-0.1.0/subprojects/cimba/src/port/x86-64/windows/cmi_random_hwseed.asm +79 -0
  191. cimba-0.1.0/subprojects/cimba/src/port/x86-64/windows/meson.build +13 -0
  192. cimba-0.1.0/subprojects/cimba/test/meson.build +221 -0
  193. cimba-0.1.0/subprojects/cimba/test/random_crossplot.c +38 -0
  194. cimba-0.1.0/subprojects/cimba/test/reference/buffer.txt +31 -0
  195. cimba-0.1.0/subprojects/cimba/test/reference/condition.txt +100 -0
  196. cimba-0.1.0/subprojects/cimba/test/reference/data.txt +467 -0
  197. cimba-0.1.0/subprojects/cimba/test/reference/event.txt +174 -0
  198. cimba-0.1.0/subprojects/cimba/test/reference/hashheap.txt +207 -0
  199. cimba-0.1.0/subprojects/cimba/test/reference/objectqueue.txt +31 -0
  200. cimba-0.1.0/subprojects/cimba/test/reference/priorityqueue.txt +30 -0
  201. cimba-0.1.0/subprojects/cimba/test/reference/random.txt +1025 -0
  202. cimba-0.1.0/subprojects/cimba/test/reference/resource.txt +27 -0
  203. cimba-0.1.0/subprojects/cimba/test/reference/resourcepool.txt +40 -0
  204. cimba-0.1.0/subprojects/cimba/test/test.h +49 -0
  205. cimba-0.1.0/subprojects/cimba/test/test_assert.c +67 -0
  206. cimba-0.1.0/subprojects/cimba/test/test_buffer.c +336 -0
  207. cimba-0.1.0/subprojects/cimba/test/test_cimba.c +501 -0
  208. cimba-0.1.0/subprojects/cimba/test/test_condition.c +699 -0
  209. cimba-0.1.0/subprojects/cimba/test/test_coroutine.c +175 -0
  210. cimba-0.1.0/subprojects/cimba/test/test_data.c +695 -0
  211. cimba-0.1.0/subprojects/cimba/test/test_event.c +248 -0
  212. cimba-0.1.0/subprojects/cimba/test/test_hashheap.c +247 -0
  213. cimba-0.1.0/subprojects/cimba/test/test_logger.c +138 -0
  214. cimba-0.1.0/subprojects/cimba/test/test_mempool.c +109 -0
  215. cimba-0.1.0/subprojects/cimba/test/test_objectqueue.c +322 -0
  216. cimba-0.1.0/subprojects/cimba/test/test_priorityqueue.c +313 -0
  217. cimba-0.1.0/subprojects/cimba/test/test_process.c +241 -0
  218. cimba-0.1.0/subprojects/cimba/test/test_random.c +1042 -0
  219. cimba-0.1.0/subprojects/cimba/test/test_resource.c +222 -0
  220. cimba-0.1.0/subprojects/cimba/test/test_resourcepool.c +445 -0
  221. cimba-0.1.0/subprojects/cimba/test/tools/test_assert.py +20 -0
  222. cimba-0.1.0/subprojects/cimba/test/tools/test_stochastic.py +269 -0
  223. cimba-0.1.0/subprojects/cimba/tutorial/hello.c +6 -0
  224. cimba-0.1.0/subprojects/cimba/tutorial/meson.build +125 -0
  225. cimba-0.1.0/subprojects/cimba/tutorial/tut_1_1.c +62 -0
  226. cimba-0.1.0/subprojects/cimba/tutorial/tut_1_2.c +77 -0
  227. cimba-0.1.0/subprojects/cimba/tutorial/tut_1_3.c +88 -0
  228. cimba-0.1.0/subprojects/cimba/tutorial/tut_1_4.c +97 -0
  229. cimba-0.1.0/subprojects/cimba/tutorial/tut_1_5.c +177 -0
  230. cimba-0.1.0/subprojects/cimba/tutorial/tut_1_6.c +258 -0
  231. cimba-0.1.0/subprojects/cimba/tutorial/tut_1_7.c +350 -0
  232. cimba-0.1.0/subprojects/cimba/tutorial/tut_2_1.c +326 -0
  233. cimba-0.1.0/subprojects/cimba/tutorial/tut_3_1.c +694 -0
  234. cimba-0.1.0/subprojects/cimba/tutorial/tut_4_0.c +184 -0
  235. cimba-0.1.0/subprojects/cimba/tutorial/tut_4_1.c +617 -0
  236. cimba-0.1.0/subprojects/cimba/tutorial/tut_4_2.c +948 -0
  237. cimba-0.1.0/subprojects/cimba/tutorial/tut_5_1.c +1978 -0
  238. cimba-0.1.0/tests/conftest.py +7 -0
  239. cimba-0.1.0/tests/test_buffer.py +79 -0
  240. cimba-0.1.0/tests/test_cimba.py +37 -0
  241. cimba-0.1.0/tests/test_condition.py +72 -0
  242. cimba-0.1.0/tests/test_data.py +35 -0
  243. cimba-0.1.0/tests/test_event.py +35 -0
  244. cimba-0.1.0/tests/test_logger.py +10 -0
  245. cimba-0.1.0/tests/test_objectqueue.py +70 -0
  246. cimba-0.1.0/tests/test_priorityqueue.py +78 -0
  247. cimba-0.1.0/tests/test_process.py +57 -0
  248. cimba-0.1.0/tests/test_random.py +25 -0
  249. cimba-0.1.0/tests/test_resource.py +62 -0
  250. cimba-0.1.0/tests/test_resourcepool.py +60 -0
  251. cimba-0.1.0/tests/test_smoke.py +83 -0
  252. cimba-0.1.0/tests/tutorial/test_hello.py +5 -0
  253. cimba-0.1.0/tests/tutorial/test_tut_1_1.py +9 -0
  254. cimba-0.1.0/tests/tutorial/test_tut_1_2.py +9 -0
  255. cimba-0.1.0/tests/tutorial/test_tut_1_3.py +9 -0
  256. cimba-0.1.0/tests/tutorial/test_tut_1_4.py +10 -0
  257. cimba-0.1.0/tests/tutorial/test_tut_1_5.py +11 -0
  258. cimba-0.1.0/tests/tutorial/test_tut_1_6.py +7 -0
  259. cimba-0.1.0/tests/tutorial/test_tut_1_7.py +22 -0
  260. cimba-0.1.0/tests/tutorial/test_tut_2_1.py +14 -0
  261. cimba-0.1.0/tests/tutorial/test_tut_3_1.py +17 -0
  262. cimba-0.1.0/tests/tutorial/test_tut_4_0.py +8 -0
  263. cimba-0.1.0/tests/tutorial/test_tut_4_1.py +10 -0
  264. cimba-0.1.0/tests/tutorial/test_tut_4_2.py +7 -0
  265. cimba-0.1.0/tests/tutorial/test_tut_5_1.py +8 -0
  266. cimba-0.1.0/tutorial/__init__.py +1 -0
  267. cimba-0.1.0/tutorial/hello.py +13 -0
  268. cimba-0.1.0/tutorial/tut_1_1.py +67 -0
  269. cimba-0.1.0/tutorial/tut_1_2.py +25 -0
  270. cimba-0.1.0/tutorial/tut_1_3.py +84 -0
  271. cimba-0.1.0/tutorial/tut_1_4.py +75 -0
  272. cimba-0.1.0/tutorial/tut_1_5.py +77 -0
  273. cimba-0.1.0/tutorial/tut_1_6.py +84 -0
  274. cimba-0.1.0/tutorial/tut_1_7.py +93 -0
  275. cimba-0.1.0/tutorial/tut_2_1.py +62 -0
  276. cimba-0.1.0/tutorial/tut_3_1.py +121 -0
  277. cimba-0.1.0/tutorial/tut_4_0.py +16 -0
  278. cimba-0.1.0/tutorial/tut_4_1.py +105 -0
  279. cimba-0.1.0/tutorial/tut_4_2.py +52 -0
  280. cimba-0.1.0/tutorial/tut_5_1.py +45 -0
  281. cimba-0.1.0/uv.lock +181 -0
cimba-0.1.0/.codex ADDED
File without changes
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ open-pull-requests-limit: 5
8
+
9
+ - package-ecosystem: uv
10
+ directory: /
11
+ schedule:
12
+ interval: weekly
13
+ open-pull-requests-limit: 5
@@ -0,0 +1,85 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master, main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: ci-${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ test:
17
+ name: Test
18
+ runs-on: ubuntu-24.04
19
+
20
+ steps:
21
+ - name: Check out repository
22
+ uses: actions/checkout@v6
23
+ with:
24
+ submodules: recursive
25
+ persist-credentials: false
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v6
29
+ with:
30
+ python-version-file: .python-version
31
+
32
+ - name: Set up uv
33
+ uses: astral-sh/setup-uv@v8.1.0
34
+ with:
35
+ enable-cache: true
36
+
37
+ - name: Install native build dependencies
38
+ run: sudo apt-get update && sudo apt-get install -y nasm
39
+
40
+ - name: Install Python dependencies
41
+ run: uv sync --locked
42
+
43
+ - name: Run tests
44
+ run: uv run pytest
45
+
46
+ build:
47
+ name: Build distributions
48
+ runs-on: ubuntu-24.04
49
+ needs: test
50
+
51
+ steps:
52
+ - name: Check out repository
53
+ uses: actions/checkout@v6
54
+ with:
55
+ submodules: recursive
56
+ persist-credentials: false
57
+
58
+ - name: Set up Python
59
+ uses: actions/setup-python@v6
60
+ with:
61
+ python-version-file: .python-version
62
+
63
+ - name: Set up uv
64
+ uses: astral-sh/setup-uv@v8.1.0
65
+ with:
66
+ enable-cache: true
67
+
68
+ - name: Install native build dependencies
69
+ run: sudo apt-get update && sudo apt-get install -y nasm
70
+
71
+ - name: Install Python build dependencies
72
+ run: uv sync --locked --only-group build --no-install-project
73
+
74
+ - name: Build source and wheel distributions
75
+ run: uv build
76
+
77
+ - name: Smoke-test built wheel
78
+ run: uv run --no-project --isolated --with dist/*.whl python -c "import cimba; print(cimba.native_version())"
79
+
80
+ - name: Upload distributions
81
+ uses: actions/upload-artifact@v7
82
+ with:
83
+ name: local-distributions
84
+ path: dist/*
85
+ if-no-files-found: error
@@ -0,0 +1,151 @@
1
+ name: Publish package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: publish-${{ github.ref }}
14
+ cancel-in-progress: false
15
+
16
+ jobs:
17
+ validate:
18
+ name: Validate release version
19
+ runs-on: ubuntu-24.04
20
+ outputs:
21
+ version: ${{ steps.version.outputs.version }}
22
+
23
+ steps:
24
+ - name: Check out repository
25
+ uses: actions/checkout@v6
26
+ with:
27
+ persist-credentials: false
28
+
29
+ - name: Set up Python
30
+ uses: actions/setup-python@v6
31
+ with:
32
+ python-version: "3.13"
33
+
34
+ - name: Check package version
35
+ id: version
36
+ run: |
37
+ python - <<'PY'
38
+ import os
39
+ import pathlib
40
+ import re
41
+ import sys
42
+ import tomllib
43
+
44
+ root = pathlib.Path.cwd()
45
+ pyproject_version = tomllib.loads((root / "pyproject.toml").read_text())["project"]["version"]
46
+ meson_text = (root / "meson.build").read_text()
47
+ match = re.search(r"version:\s*'([^']+)'", meson_text)
48
+ if not match:
49
+ sys.exit("Could not find project version in meson.build")
50
+
51
+ meson_version = match.group(1)
52
+ if meson_version != pyproject_version:
53
+ sys.exit(
54
+ f"Version mismatch: pyproject.toml has {pyproject_version}, "
55
+ f"meson.build has {meson_version}"
56
+ )
57
+
58
+ if os.environ.get("GITHUB_REF_TYPE") == "tag":
59
+ tag = os.environ["GITHUB_REF_NAME"]
60
+ expected = f"v{pyproject_version}"
61
+ if tag != expected:
62
+ sys.exit(f"Release tag {tag!r} must match project version {expected!r}")
63
+
64
+ with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output:
65
+ print(f"version={pyproject_version}", file=output)
66
+ PY
67
+
68
+ sdist:
69
+ name: Build source distribution
70
+ runs-on: ubuntu-24.04
71
+ needs: validate
72
+
73
+ steps:
74
+ - name: Check out repository
75
+ uses: actions/checkout@v6
76
+ with:
77
+ submodules: recursive
78
+ persist-credentials: false
79
+
80
+ - name: Set up Python
81
+ uses: actions/setup-python@v6
82
+ with:
83
+ python-version: "3.13"
84
+
85
+ - name: Set up uv
86
+ uses: astral-sh/setup-uv@v8.1.0
87
+ with:
88
+ enable-cache: true
89
+
90
+ - name: Install native build dependencies
91
+ run: sudo apt-get update && sudo apt-get install -y nasm
92
+
93
+ - name: Install Python build dependencies
94
+ run: uv sync --locked --only-group build --no-install-project
95
+
96
+ - name: Build source distribution
97
+ run: uv build --sdist
98
+
99
+ - name: Upload source distribution
100
+ uses: actions/upload-artifact@v7
101
+ with:
102
+ name: dist-sdist
103
+ path: dist/*.tar.gz
104
+ if-no-files-found: error
105
+
106
+ wheels:
107
+ name: Build Linux x86_64 wheel
108
+ runs-on: ubuntu-24.04
109
+ needs: validate
110
+
111
+ steps:
112
+ - name: Check out repository
113
+ uses: actions/checkout@v6
114
+ with:
115
+ submodules: recursive
116
+ persist-credentials: false
117
+
118
+ - name: Build wheels
119
+ uses: pypa/cibuildwheel@v3.4.1
120
+
121
+ - name: Upload wheels
122
+ uses: actions/upload-artifact@v7
123
+ with:
124
+ name: dist-wheels-linux-x86-64
125
+ path: wheelhouse/*.whl
126
+ if-no-files-found: error
127
+
128
+ publish:
129
+ name: Publish to PyPI
130
+ runs-on: ubuntu-24.04
131
+ needs: [validate, sdist, wheels]
132
+ if: startsWith(github.ref, 'refs/tags/v')
133
+ environment:
134
+ name: pypi
135
+ url: https://pypi.org/project/cimba/
136
+ permissions:
137
+ contents: read
138
+ id-token: write
139
+
140
+ steps:
141
+ - name: Download distributions
142
+ uses: actions/download-artifact@v8
143
+ with:
144
+ pattern: dist-*
145
+ path: dist
146
+ merge-multiple: true
147
+
148
+ - name: Publish distributions to PyPI
149
+ uses: pypa/gh-action-pypi-publish@release/v1
150
+ with:
151
+ packages-dir: dist
cimba-0.1.0/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Compiled extension + Cython/Meson build artifacts
10
+ *.so
11
+ *.pyd
12
+ /src/cimba/_cimba.c
13
+ .mesonpy-*/
14
+ builddir/
15
+ /subprojects/*.wraplock
16
+
17
+ # Test / tooling caches
18
+ .pytest_cache/
19
+
20
+ # Virtual environments
21
+ .venv
@@ -0,0 +1,3 @@
1
+ [submodule "subprojects/cimba"]
2
+ path = subprojects/cimba
3
+ url = https://github.com/ambonvik/cimba
@@ -0,0 +1 @@
1
+ 3.13
cimba-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
cimba-0.1.0/NOTICE ADDED
@@ -0,0 +1,15 @@
1
+ cimba (Python wrapper)
2
+ Copyright (c) 2026 FBarrca
3
+ Licensed under the Apache License, Version 2.0 (see LICENSE).
4
+
5
+ This product bundles, in compiled form within its binary wheels, the Cimba
6
+ discrete event simulation library:
7
+
8
+ Cimba discrete event simulation library
9
+ Copyright (c) Asbjørn M. Bonvik 1994, 1995, 2025 - 26.
10
+ Licensed under the Apache License, Version 2.0.
11
+ https://github.com/ambonvik/cimba
12
+
13
+ Cimba's own NOTICE (third-party components it adapts, e.g. the Ziggurat fast
14
+ PRNG and other MIT / public-domain code) applies to that bundled library and is
15
+ distributed at subprojects/cimba/NOTICE in the source tree.
cimba-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,188 @@
1
+ Metadata-Version: 2.4
2
+ Name: cimba
3
+ Version: 0.1.0
4
+ Summary: Python bindings for Cimba, a multithreaded discrete-event-simulation C library
5
+ Keywords: simulation,discrete-event-simulation,cimba,cython
6
+ Author-Email: FBarrca <franbarragan87@gmail.com>
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ License-File: NOTICE
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: Implementation :: CPython
14
+ Classifier: Programming Language :: Cython
15
+ Classifier: Programming Language :: C
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Classifier: Typing :: Typed
19
+ Project-URL: Homepage, https://github.com/FBarrca/cimba_python
20
+ Project-URL: Repository, https://github.com/FBarrca/cimba_python
21
+ Project-URL: Issues, https://github.com/FBarrca/cimba_python/issues
22
+ Project-URL: Upstream C library, https://github.com/ambonvik/cimba
23
+ Requires-Python: >=3.13
24
+ Description-Content-Type: text/markdown
25
+
26
+ # cimba (Python)
27
+
28
+ Python bindings for [**Cimba**](https://github.com/ambonvik/cimba) — a
29
+ multithreaded discrete-event-simulation library written in C (POSIX pthreads for
30
+ parallel replications, stackful coroutines for concurrent processes per thread).
31
+
32
+ > **Status: early bindings.** The package wraps the core single-thread Cimba
33
+ > simulation API: `Simulation`, `Process`, buffers, object/priority queues,
34
+ > resources, conditions, random distributions, and summary/time-series helpers.
35
+ > Parallel experiment orchestration is still a later layer.
36
+
37
+ ## Benchmark
38
+
39
+ The `benchmarks/` folder contains Python-binding versions of Cimba's upstream
40
+ M/M/1 queue benchmarks, so the same workload can be compared across SimPy,
41
+ Cimba's C API, and these Python bindings. The benchmark uses 1,000,000 objects
42
+ per trial; the multi-core case runs 100 independent trials.
43
+
44
+ On an AMD Ryzen 7 9700X under WSL Ubuntu 24.04, averaged over 10 runs:
45
+
46
+ | Benchmark | SimPy | Cimba Python | Cimba C |
47
+ | --- | ---: | ---: | ---: |
48
+ | Single core, single trial | 3.185 s | 0.375 s | 0.095 s |
49
+ | Multicore, 100 trials | 41.820 s | 4.698 s | 1.178 s |
50
+
51
+ Headline speedups:
52
+
53
+ | Benchmark | Cimba Python vs SimPy | Cimba C vs SimPy | Cimba C vs Cimba Python |
54
+ | --- | ---: | ---: | ---: |
55
+ | Single core, single trial | 8.5x faster | 33.7x faster | 4.0x faster |
56
+ | Multicore, 100 trials | 8.9x faster | 35.5x faster | 4.0x faster |
57
+
58
+ In throughput terms, the Python bindings process about 10.7M events/sec in the
59
+ single-trial benchmark and 85.1M events/sec in the 100-trial benchmark. The full
60
+ spreadsheet with samples and charts is
61
+ [`benchmarks/AMD_Ryzen_7_9700X_WSL.ods`](benchmarks/AMD_Ryzen_7_9700X_WSL.ods).
62
+
63
+ ## How it's put together
64
+
65
+ | Piece | Where | Why |
66
+ | --- | --- | --- |
67
+ | Native C library | `subprojects/cimba/` (git submodule) | Lives where Meson expects subprojects; pinned to a commit; updated via git |
68
+ | Build backend | `meson-python` (`pyproject.toml`) | Upstream already uses Meson; reuses its NASM/C23/pthreads build for free |
69
+ | Build wiring | `meson.build` | Pulls the subproject (`my_lib_dep`), builds it **static**, links the extension against it |
70
+ | Python package | `src/cimba/` | `src`-layout; `_cimba.pyx` is the Cython extension |
71
+ | Tests | `tests/` | Smoke test that the extension imports and calls into C |
72
+
73
+ The C library is built as a **static** archive and embedded into the
74
+ `_cimba` extension, so a built wheel is self-contained (one `.so`, nothing to
75
+ ship alongside it).
76
+
77
+ ## Prerequisites
78
+
79
+ `uv` provides Python 3.13, `meson`, `ninja`, `cython`, and `meson-python`. You
80
+ only need these on the system itself:
81
+
82
+ | Tool | Why | Check |
83
+ | --- | --- | --- |
84
+ | **uv** | drives the build/test/run workflow | `uv --version` |
85
+ | **git** | the C library is a submodule | `git --version` |
86
+ | **C compiler** (gcc/clang) | compiles Cimba + the extension | `cc --version` |
87
+ | **NASM** | Cimba's ziggurat RNG is in assembly | `nasm --version` |
88
+
89
+ Cimba also links `pthreads` and `libm`, which are part of the C runtime. On
90
+ Ubuntu/WSL the compiler + NASM come from: `sudo apt install build-essential nasm`.
91
+
92
+ ## Quick start (from a fresh clone)
93
+
94
+ ```bash
95
+ git clone <repo-url> cimba_python
96
+ cd cimba_python
97
+ git submodule update --init --recursive # pulls subprojects/cimba
98
+
99
+ uv sync # creates .venv, installs deps, compiles cimba (~15s first run)
100
+ uv run python -c "import cimba; print(cimba.native_version())" # -> 3.0.0-beta
101
+ uv run pytest # runs the wrapper smoke/behavior tests
102
+ ```
103
+
104
+ No manual `.venv` activation needed — `uv run` handles it. The first `uv sync`
105
+ compiles the C library + Cython extension; later runs are incremental.
106
+
107
+ ## Minimal simulation
108
+
109
+ ```python
110
+ import cimba
111
+
112
+
113
+ def arrival(me, queue):
114
+ while True:
115
+ cimba.hold(cimba.exponential(1.0 / 0.75))
116
+ queue.put(1)
117
+
118
+
119
+ def service(me, queue):
120
+ while True:
121
+ queue.get(1)
122
+ cimba.hold(cimba.exponential(1.0))
123
+
124
+
125
+ with cimba.Simulation(seed=123) as sim:
126
+ queue = cimba.Buffer("Queue")
127
+ queue.start_recording()
128
+
129
+ cimba.Process("Arrival", arrival, queue).start()
130
+ cimba.Process("Service", service, queue).start()
131
+
132
+ sim.stop_at(1000.0)
133
+ sim.execute()
134
+
135
+ queue.stop_recording()
136
+ print(queue.history().summary().mean)
137
+ ```
138
+
139
+ `Simulation` owns Cimba's thread-local event queue and random generator. Objects
140
+ created while a simulation is active are kept alive by the simulation and closed
141
+ in reverse creation order, so `Process(...).start()` is safe even if you do not
142
+ store the process in a local variable.
143
+
144
+ ## Build a wheel
145
+
146
+ ```bash
147
+ uv build --wheel # -> dist/cimba-<ver>-cp313-cp313-<platform>.whl
148
+ # or `uv build` for wheel + sdist
149
+ ```
150
+
151
+ The wheel statically embeds Cimba, so it needs no system Cimba at runtime. Verify
152
+ that in a throwaway environment (no project, no build tools):
153
+
154
+ ```bash
155
+ uv run --no-project --isolated \
156
+ --with dist/cimba-*.whl \
157
+ python -c "import cimba; print(cimba.native_version())" # -> 3.0.0-beta
158
+ ```
159
+
160
+ ## Troubleshooting
161
+
162
+ **`FileNotFoundError: .../build/cp313` on import.** `build/cp313/` is the
163
+ editable dev install's build directory. If it's deleted, `uv sync` won't
164
+ recompile (it reinstalls cimba from uv's cache), so the import breaks. Force a
165
+ real rebuild:
166
+
167
+ ```bash
168
+ uv sync --reinstall-package cimba
169
+ ```
170
+
171
+ Use the same command if a plain `uv sync` doesn't pick up changes to
172
+ `meson.build` or `pyproject.toml`. (A genuine fresh clone with a cold uv cache
173
+ builds correctly with plain `uv sync`; `uv build` wheels are unaffected.)
174
+
175
+ ## Updating the bundled C library
176
+
177
+ ```bash
178
+ cd subprojects/cimba
179
+ git fetch && git checkout <commit-or-tag>
180
+ cd ../..
181
+ git add subprojects/cimba && git commit -m "Bump Cimba to <ref>"
182
+ ```
183
+
184
+ ## License
185
+
186
+ This wrapper is licensed under Apache-2.0 (see [`LICENSE`](LICENSE)). It bundles
187
+ the Apache-2.0 licensed Cimba library in compiled form; see [`NOTICE`](NOTICE)
188
+ and `subprojects/cimba/NOTICE` for attribution.