compiled-knowledge 4.0.0a21__tar.gz → 4.0.0a22__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.

Potentially problematic release.


This version of compiled-knowledge might be problematic. Click here for more details.

Files changed (181) hide show
  1. {compiled_knowledge-4.0.0a21/src/compiled_knowledge.egg-info → compiled_knowledge-4.0.0a22}/PKG-INFO +1 -1
  2. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/pyproject.toml +1 -1
  3. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/interpret_compiler.py +1 -0
  4. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/llvm_compiler.py +4 -4
  5. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm.py +1 -1
  6. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_circuit/mpe_program.py +2 -2
  7. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_circuit/support/compile_circuit.py +4 -7
  8. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/named_pgm_compilers.py +0 -3
  9. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/support/clusters.py +8 -4
  10. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/program/raw_program.py +1 -2
  11. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/utils/np_extras.py +5 -5
  12. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22/src/compiled_knowledge.egg-info}/PKG-INFO +1 -1
  13. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/LICENSE.txt +0 -0
  14. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/MANIFEST.in +0 -0
  15. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/README.md +0 -0
  16. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/setup.cfg +0 -0
  17. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/setup.py +0 -0
  18. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/__init__.py +0 -0
  19. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit/__init__.py +0 -0
  20. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit/_circuit_cy.c +0 -0
  21. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit/_circuit_cy.pxd +0 -0
  22. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit/_circuit_cy.pyx +0 -0
  23. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit/_circuit_py.py +0 -0
  24. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit/tmp_const.py +0 -0
  25. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/__init__.py +0 -0
  26. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/circuit_compiler.py +0 -0
  27. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/cython_vm_compiler/__init__.py +0 -0
  28. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/cython_vm_compiler/_compiler.c +0 -0
  29. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/cython_vm_compiler/_compiler.pyx +0 -0
  30. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/cython_vm_compiler/cython_vm_compiler.py +0 -0
  31. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/llvm_vm_compiler.py +0 -0
  32. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/named_circuit_compilers.py +0 -0
  33. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/support/__init__.py +0 -0
  34. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/support/circuit_analyser/__init__.py +0 -0
  35. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.c +0 -0
  36. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_cy.pyx +0 -0
  37. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/support/circuit_analyser/_circuit_analyser_py.py +0 -0
  38. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/support/input_vars.py +0 -0
  39. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/circuit_compiler/support/llvm_ir_function.py +0 -0
  40. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/__init__.py +0 -0
  41. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/alarm.py +0 -0
  42. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/asia.py +0 -0
  43. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/binary_clique.py +0 -0
  44. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/bow_tie.py +0 -0
  45. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/cancer.py +0 -0
  46. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/chain.py +0 -0
  47. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/child.py +0 -0
  48. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/clique.py +0 -0
  49. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/cnf_pgm.py +0 -0
  50. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/diamond_square.py +0 -0
  51. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/earthquake.py +0 -0
  52. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/empty.py +0 -0
  53. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/hailfinder.py +0 -0
  54. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/hepar2.py +0 -0
  55. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/insurance.py +0 -0
  56. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/loop.py +0 -0
  57. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/mildew.py +0 -0
  58. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/munin.py +0 -0
  59. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/pathfinder.py +0 -0
  60. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/rain.py +0 -0
  61. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/rectangle.py +0 -0
  62. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/run.py +0 -0
  63. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/sachs.py +0 -0
  64. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/sprinkler.py +0 -0
  65. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/star.py +0 -0
  66. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/stress.py +0 -0
  67. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/student.py +0 -0
  68. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/survey.py +0 -0
  69. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/triangle_square.py +0 -0
  70. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/example/truss.py +0 -0
  71. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/in_out/__init__.py +0 -0
  72. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/in_out/parse_ace_lmap.py +0 -0
  73. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/in_out/parse_ace_nnf.py +0 -0
  74. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/in_out/parse_net.py +0 -0
  75. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/in_out/parser_utils.py +0 -0
  76. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/in_out/pgm_pickle.py +0 -0
  77. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/in_out/pgm_python.py +0 -0
  78. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/in_out/render_bugs.py +0 -0
  79. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/in_out/render_net.py +0 -0
  80. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/in_out/render_pomegranate.py +0 -0
  81. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_circuit/__init__.py +0 -0
  82. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_circuit/marginals_program.py +0 -0
  83. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_circuit/pgm_circuit.py +0 -0
  84. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_circuit/program_with_slotmap.py +0 -0
  85. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_circuit/slot_map.py +0 -0
  86. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_circuit/support/__init__.py +0 -0
  87. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_circuit/target_marginals_program.py +0 -0
  88. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_circuit/wmc_program.py +0 -0
  89. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/__init__.py +0 -0
  90. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/ace/__init__.py +0 -0
  91. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/ace/ace.py +0 -0
  92. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/factor_elimination.py +0 -0
  93. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/pgm_compiler.py +0 -0
  94. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/recursive_conditioning.py +0 -0
  95. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/support/__init__.py +0 -0
  96. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/support/circuit_table/__init__.py +0 -0
  97. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/support/circuit_table/_circuit_table_cy.c +0 -0
  98. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/support/circuit_table/_circuit_table_cy.pyx +0 -0
  99. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/support/circuit_table/_circuit_table_py.py +0 -0
  100. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/support/factor_tables.py +0 -0
  101. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/support/join_tree.py +0 -0
  102. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/support/named_compiler_maker.py +0 -0
  103. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/pgm_compiler/variable_elimination.py +0 -0
  104. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/probability/__init__.py +0 -0
  105. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/probability/empirical_probability_space.py +0 -0
  106. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/probability/pgm_probability_space.py +0 -0
  107. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/probability/probability_space.py +0 -0
  108. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/program/__init__.py +0 -0
  109. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/program/program.py +0 -0
  110. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/program/program_buffer.py +0 -0
  111. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/sampling/__init__.py +0 -0
  112. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/sampling/forward_sampler.py +0 -0
  113. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/sampling/marginals_direct_sampler.py +0 -0
  114. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/sampling/sampler.py +0 -0
  115. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/sampling/sampler_support.py +0 -0
  116. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/sampling/uniform_sampler.py +0 -0
  117. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/sampling/wmc_direct_sampler.py +0 -0
  118. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/sampling/wmc_gibbs_sampler.py +0 -0
  119. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/sampling/wmc_metropolis_sampler.py +0 -0
  120. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/sampling/wmc_rejection_sampler.py +0 -0
  121. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/utils/__init__.py +0 -0
  122. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/utils/iter_extras.py +0 -0
  123. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/utils/local_config.py +0 -0
  124. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/utils/map_list.py +0 -0
  125. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/utils/map_set.py +0 -0
  126. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/utils/random_extras.py +0 -0
  127. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck/utils/tmp_dir.py +0 -0
  128. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/__init__.py +0 -0
  129. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/ace/__init__.py +0 -0
  130. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/ace/copy_ace_to_ck.py +0 -0
  131. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/ace/demo_ace.py +0 -0
  132. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/all_demos.py +0 -0
  133. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/circuit/__init__.py +0 -0
  134. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/circuit/demo_circuit_dump.py +0 -0
  135. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/circuit/demo_derivatives.py +0 -0
  136. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/circuit_compiler/__init__.py +0 -0
  137. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/circuit_compiler/compare_circuit_compilers.py +0 -0
  138. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/circuit_compiler/show_llvm_program.py +0 -0
  139. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm/__init__.py +0 -0
  140. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm/demo_pgm_dump.py +0 -0
  141. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm/demo_pgm_dump_stress.py +0 -0
  142. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm/demo_pgm_string_rendering.py +0 -0
  143. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm/show_examples.py +0 -0
  144. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/__init__.py +0 -0
  145. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/compare_pgm_compilers.py +0 -0
  146. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/demo_compiler_dump.py +0 -0
  147. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/demo_factor_elimination.py +0 -0
  148. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/demo_join_tree.py +0 -0
  149. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/demo_marginals_program.py +0 -0
  150. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/demo_mpe_program.py +0 -0
  151. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/demo_pgm_compiler.py +0 -0
  152. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/demo_recursive_conditioning.py +0 -0
  153. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/demo_variable_elimination.py +0 -0
  154. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/demo_wmc_program.py +0 -0
  155. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_compiler/time_fe_compiler.py +0 -0
  156. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_inference/__init__.py +0 -0
  157. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_inference/demo_inferencing_basic.py +0 -0
  158. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_inference/demo_inferencing_mpe_cancer.py +0 -0
  159. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_inference/demo_inferencing_wmc_and_mpe_sprinkler.py +0 -0
  160. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/pgm_inference/demo_inferencing_wmc_student.py +0 -0
  161. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/programs/__init__.py +0 -0
  162. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/programs/demo_program_buffer.py +0 -0
  163. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/programs/demo_program_multi.py +0 -0
  164. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/programs/demo_program_none.py +0 -0
  165. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/programs/demo_program_single.py +0 -0
  166. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/programs/demo_raw_program_interpreted.py +0 -0
  167. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/programs/demo_raw_program_llvm.py +0 -0
  168. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/sampling/__init__.py +0 -0
  169. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/sampling/check_sampler.py +0 -0
  170. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/sampling/demo_marginal_direct_sampler.py +0 -0
  171. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/sampling/demo_uniform_sampler.py +0 -0
  172. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/sampling/demo_wmc_direct_sampler.py +0 -0
  173. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/utils/__init__.py +0 -0
  174. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/utils/compare.py +0 -0
  175. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/utils/convert_network.py +0 -0
  176. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/utils/sample_model.py +0 -0
  177. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/ck_demos/utils/stop_watch.py +0 -0
  178. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/compiled_knowledge.egg-info/SOURCES.txt +0 -0
  179. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/compiled_knowledge.egg-info/dependency_links.txt +0 -0
  180. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/compiled_knowledge.egg-info/requires.txt +0 -0
  181. {compiled_knowledge-4.0.0a21 → compiled_knowledge-4.0.0a22}/src/compiled_knowledge.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compiled-knowledge
3
- Version: 4.0.0a21
3
+ Version: 4.0.0a22
4
4
  Summary: A Python package for compiling and querying discrete probabilistic graphical models.
5
5
  Author-email: Barry Drake <barry@compiledknowledge.org>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "compiled-knowledge"
3
- version = "4.0.0a21"
3
+ version = "4.0.0a22"
4
4
  description = "A Python package for compiling and querying discrete probabilistic graphical models."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -139,6 +139,7 @@ def _make_instructions(
139
139
  for node_id, const_idx in node_to_const_idx.items():
140
140
  node_to_element[node_id] = _ElementID(_CONSTS, const_idx)
141
141
  # var nodes
142
+ var_node: VarNode
142
143
  for i, var_node in enumerate(analysis.var_nodes):
143
144
  if var_node.is_const():
144
145
  node_to_element[id(var_node)] = node_to_element[id(var_node.const)]
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from dataclasses import dataclass
4
4
  from enum import Enum
5
- from typing import Sequence, Optional, Tuple, Dict, Protocol
5
+ from typing import Sequence, Optional, Tuple, Dict, Protocol, assert_never
6
6
 
7
7
  import llvmlite.binding as llvm
8
8
  import llvmlite.ir as ir
@@ -238,7 +238,7 @@ class _FunctionBuilderTmps(_FunctionBuilder):
238
238
  if idx is not None:
239
239
  return builder.load(builder.gep(self.out_args, [ir.Constant(self.llvm_idx_type, idx)]))
240
240
 
241
- assert False, 'not reached'
241
+ assert_never('not reached')
242
242
 
243
243
  def store_calculation(self, value: ir.Value, op_node: OpNode) -> None:
244
244
  """
@@ -262,7 +262,7 @@ class _FunctionBuilderTmps(_FunctionBuilder):
262
262
  builder.store(value, ptr)
263
263
  return
264
264
 
265
- assert False, 'not reached'
265
+ assert_never('not reached')
266
266
 
267
267
  def store_result(self, value: ir.Value, idx: int) -> None:
268
268
  """
@@ -359,7 +359,7 @@ class _FunctionBuilderStack(_FunctionBuilder):
359
359
  if idx is not None:
360
360
  return builder.load(builder.gep(self.out_args, [ir.Constant(self.llvm_idx_type, idx)]))
361
361
 
362
- assert False, 'not reached'
362
+ assert_never('not reached')
363
363
 
364
364
  def store_calculation(self, value: ir.Value, op_node: OpNode) -> None:
365
365
  """
@@ -2935,7 +2935,7 @@ class CPTPotentialFunction(PotentialFunction):
2935
2935
  return True
2936
2936
  else:
2937
2937
  # The requested tolerance is tighter than ensured.
2938
- # Need to use the default method
2938
+ # Need to use the default method.
2939
2939
  return super().is_cpt(tolerance)
2940
2940
 
2941
2941
  @property
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from dataclasses import dataclass
4
4
  from functools import partial
5
- from typing import Sequence, Optional, Tuple, List, Dict, Set
5
+ from typing import Sequence, Optional, Tuple, List, Dict, Set, assert_never
6
6
 
7
7
  from ck.circuit import CircuitNode, Circuit, VarNode, OpNode, ADD, MUL
8
8
  from ck.circuit_compiler import llvm_vm_compiler, CircuitCompiler
@@ -207,7 +207,7 @@ class MPEProgram(ProgramWithSlotmap):
207
207
  self._trace_var(child, states)
208
208
  return
209
209
  # No child value equaled the value for node! We should never get here
210
- assert False, 'not reached'
210
+ assert_never('not reached')
211
211
  elif node.symbol == MUL:
212
212
  # Recurse though each child node
213
213
  for child in node.args:
@@ -2,7 +2,6 @@ from typing import Optional, Sequence
2
2
 
3
3
  from ck.circuit import CircuitNode, TmpConst, Circuit
4
4
  from ck.circuit_compiler import CircuitCompiler
5
- from ck.circuit_compiler.llvm_compiler import DataType, DEFAULT_TYPE_INFO, compile_circuit
6
5
  from ck.circuit_compiler import DEFAULT_CIRCUIT_COMPILER
7
6
  from ck.pgm_circuit import PGMCircuit
8
7
  from ck.program import RawProgram
@@ -48,7 +47,7 @@ def compile_param_derivatives(
48
47
  pgm_circuit: PGMCircuit,
49
48
  self_multiply: bool = False,
50
49
  params_value: Optional[float | int] = 1,
51
- data_type: DataType = DEFAULT_TYPE_INFO,
50
+ compiler: CircuitCompiler = DEFAULT_CIRCUIT_COMPILER,
52
51
  ) -> RawProgram:
53
52
  """
54
53
  Compile the circuit to a program for computing the partial derivatives of the parameters.
@@ -56,14 +55,12 @@ def compile_param_derivatives(
56
55
 
57
56
  Typically, this will grow the circuit by the addition of circuit nodes to compute the derivatives.
58
57
 
59
- This uses the LLVM circuit compiler.
60
-
61
58
  Args:
62
59
  pgm_circuit: The circuit (and PGM) that will be compiled to a program.
63
60
  self_multiply: if true then each partial derivative df/dx will be multiplied by x.
64
61
  params_value: if not None, then circuit vars representing parameters will be temporarily
65
62
  set to this value for compiling the program. Default is 1.
66
- data_type: What data type to use for arithmetic calculations. Either a DataType member or TypeInfo.
63
+ compiler: function from circuit nodes to raw program.
67
64
  """
68
65
  top: CircuitNode = pgm_circuit.circuit_top
69
66
  circuit: Circuit = top.circuit
@@ -76,8 +73,8 @@ def compile_param_derivatives(
76
73
  if params_value is not None:
77
74
  with TmpConst(circuit) as tmp:
78
75
  tmp.set_const(param_vars, params_value)
79
- raw_program: RawProgram = compile_circuit(*derivatives, circuit=circuit, data_type=data_type)
76
+ raw_program: RawProgram = compiler(*derivatives, circuit=circuit)
80
77
  else:
81
- raw_program: RawProgram = compile_circuit(*derivatives, circuit=circuit, data_type=data_type)
78
+ raw_program: RawProgram = compiler(*derivatives, circuit=circuit)
82
79
 
83
80
  return raw_program
@@ -16,7 +16,6 @@ class NamedPGMCompiler(Enum):
16
16
  Wrapping in a tuple is needed otherwise Python erases the type of the member, which can cause problems.
17
17
  Each member itself is callable, confirming to the PGMCompiler protocol, delegating to the compiler function.
18
18
  """
19
- # @formatter:off
20
19
 
21
20
  VE_MIN_DEGREE = _get_compiler_algorithm(variable_elimination, 'MIN_DEGREE')
22
21
  VE_MIN_DEGREE_THEN_FILL = _get_compiler_algorithm(variable_elimination, 'MIN_DEGREE_THEN_FILL')
@@ -45,8 +44,6 @@ class NamedPGMCompiler(Enum):
45
44
 
46
45
  ACE = _get_compiler(ace)
47
46
 
48
- # @formatter:on
49
-
50
47
  def __call__(self, pgm: PGM, const_parameters: bool = True) -> PGMCircuit:
51
48
  """
52
49
  Each member of the enum is a PGMCompiler function.
@@ -295,7 +295,7 @@ class Clusters:
295
295
  Returns:
296
296
  the maximum `len(cluster)` over all clusters.
297
297
  """
298
- return max(len(cluster) for cluster in self.clusters)
298
+ return max((len(cluster) for cluster in self.clusters), default=0)
299
299
 
300
300
  def max_cluster_weighted_size(self, rv_log_sizes: Sequence[float]) -> float:
301
301
  """
@@ -303,13 +303,17 @@ class Clusters:
303
303
 
304
304
  Args:
305
305
  rv_log_sizes: is an array of random variable sizes, such that
306
- for a random variable `rv`, `rv_log_sizes[rv.idx] = log2(len(rv))`.
306
+ for a random variable `rv`, `rv_log_sizes[rv.idx] = log2(len(rv))`,
307
+ e.g., `self.pgm.rv_log_sizes`.
307
308
  Returns:
308
309
  the maximum `sum(rv_log_sizes[rv_idx] for rv_idx in cluster)` over all clusters.
309
310
  """
310
311
  return max(
311
- sum(rv_log_sizes[rv_idx] for rv_idx in cluster)
312
- for cluster in self.clusters
312
+ (
313
+ sum(rv_log_sizes[rv_idx] for rv_idx in cluster)
314
+ for cluster in self.clusters
315
+ ),
316
+ default=0
313
317
  )
314
318
 
315
319
  def eliminate(self, rv_index: int) -> None:
@@ -23,14 +23,13 @@ class RawProgram:
23
23
 
24
24
  A `RawProgram` is a `Callable` with the signature:
25
25
 
26
-
27
26
  Fields:
28
27
  function: is a function of three ctypes arrays, returning nothing.
29
28
  dtype: the numpy data type of the array values.
30
29
  number_of_vars: the number of input values (first function argument).
31
30
  number_of_tmps: the number of working memory values (second function argument).
32
31
  number_of_results: the number of result values (third function argument).
33
- var_indices: maps the index of inputs (from 0 to self.number_of_vars - 1) to the index
32
+ var_indices: maps the index of inputs (from 0 to self.number_of_vars - 1) to the index
34
33
  of the corresponding circuit var.
35
34
  """
36
35
 
@@ -29,17 +29,17 @@ NDArrayNumeric = NDArray[DTypeNumeric]
29
29
 
30
30
 
31
31
  # Constants for maximum number of states.
32
- _MAX_STATES_8: int = 2 ** 8 - 1
33
- _MAX_STATES_16: int = 2 ** 16 - 1
34
- _MAX_STATES_32: int = 2 ** 32 - 1
35
- _MAX_STATES_64: int = 2 ** 64 - 1
32
+ _MAX_STATES_8: int = 2 ** 8
33
+ _MAX_STATES_16: int = 2 ** 16
34
+ _MAX_STATES_32: int = 2 ** 32
35
+ _MAX_STATES_64: int = 2 ** 64
36
36
 
37
37
 
38
38
  def dtype_for_number_of_states(number_of_states: int) -> DTypeStates:
39
39
  """
40
40
  Infer the numpy dtype required to store any state index of the given PGM.
41
41
  """
42
- # Infer the needed size of
42
+ # Infer the needed dtype required to hold a number of states
43
43
  if number_of_states <= _MAX_STATES_8:
44
44
  return np.uint8
45
45
  if number_of_states <= _MAX_STATES_16:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compiled-knowledge
3
- Version: 4.0.0a21
3
+ Version: 4.0.0a22
4
4
  Summary: A Python package for compiling and querying discrete probabilistic graphical models.
5
5
  Author-email: Barry Drake <barry@compiledknowledge.org>
6
6
  License-Expression: MIT