bonesistools 1.4.0__tar.gz → 1.6.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 (307) hide show
  1. {bonesistools-1.4.0 → bonesistools-1.6.0}/.gitignore +2 -0
  2. {bonesistools-1.4.0 → bonesistools-1.6.0}/PKG-INFO +6 -9
  3. {bonesistools-1.4.0 → bonesistools-1.6.0}/README.md +2 -2
  4. {bonesistools-1.4.0 → bonesistools-1.6.0}/pyproject.toml +4 -9
  5. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/__init__.py +0 -2
  6. bonesistools-1.6.0/src/bonesistools/_warnings.py +77 -0
  7. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/__init__.py +0 -3
  8. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_algebra/__init__.py +6 -22
  9. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_algebra/__init__.pyi +4 -2
  10. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_algebra/_configuration.py +140 -25
  11. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_algebra/_hypercube.py +228 -6
  12. bonesistools-1.6.0/src/bonesistools/logic/boolean_algebra/_parser.py +9 -0
  13. bonesistools-1.6.0/src/bonesistools/logic/boolean_algebra/_robdd.py +806 -0
  14. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_algebra/_structure.py +270 -220
  15. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_algebra/_typing.py +11 -7
  16. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_network/__init__.py +6 -17
  17. bonesistools-1.6.0/src/bonesistools/logic/boolean_network/_asynchronous.py +372 -0
  18. bonesistools-1.6.0/src/bonesistools/logic/boolean_network/_bdd.py +76 -0
  19. bonesistools-1.6.0/src/bonesistools/logic/boolean_network/_distances.py +883 -0
  20. bonesistools-1.6.0/src/bonesistools/logic/boolean_network/_dynamics.py +1130 -0
  21. bonesistools-1.6.0/src/bonesistools/logic/boolean_network/_general.py +60 -0
  22. bonesistools-1.6.0/src/bonesistools/logic/boolean_network/_most_permissive.py +1009 -0
  23. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_network/_network.py +1212 -1085
  24. bonesistools-1.6.0/src/bonesistools/logic/boolean_network/_symbolic.py +2513 -0
  25. bonesistools-1.6.0/src/bonesistools/logic/boolean_network/_synchronous.py +55 -0
  26. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_network/_typing.py +15 -0
  27. bonesistools-1.6.0/src/bonesistools/logic/influence_graph/_distances.py +244 -0
  28. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/influence_graph/_graphviz.py +81 -5
  29. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/influence_graph/_influence_graph.py +259 -170
  30. bonesistools-1.6.0/src/bonesistools/logic/influence_graph/_parser.py +49 -0
  31. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/influence_graph/_scoring.py +108 -66
  32. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/influence_graph/_styles.py +13 -14
  33. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/input_output/__init__.py +3 -2
  34. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/input_output/_boolean_network.py +1 -1
  35. bonesistools-1.6.0/src/bonesistools/logic/input_output/_booleanization.py +301 -0
  36. bonesistools-1.6.0/src/bonesistools/logic/input_output/_executable_model.py +457 -0
  37. bonesistools-1.6.0/src/bonesistools/logic/input_output/_ginml.py +1810 -0
  38. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/input_output/_hypercube.py +1 -41
  39. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/input_output/_influence_graph.py +38 -35
  40. bonesistools-1.6.0/src/bonesistools/logic/input_output/_sbml.py +847 -0
  41. bonesistools-1.6.0/src/bonesistools/logic/input_output/_zginml.py +1372 -0
  42. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/_typing.py +7 -0
  43. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/input_output/_nestorowa.py +4 -4
  44. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/input_output/_pbmc3k.py +2 -2
  45. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/plotting/_graph.py +31 -2
  46. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/plotting/_scatterplot.py +172 -17
  47. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/preprocessing/_classification.py +68 -50
  48. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/preprocessing/_duplicates.py +4 -1
  49. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/preprocessing/_genename.py +54 -41
  50. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/preprocessing/_hvg.py +54 -31
  51. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/__init__.py +3 -3
  52. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/__init__.pyi +1 -1
  53. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_classification.py +22 -23
  54. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_embedding.py +305 -45
  55. bonesistools-1.4.0/src/bonesistools/omics/tools/_neighbors.py → bonesistools-1.6.0/src/bonesistools/omics/tools/_knnsc.py +6 -996
  56. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_markers.py +403 -76
  57. bonesistools-1.6.0/src/bonesistools/omics/tools/_neighbors.py +1486 -0
  58. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/__init__.py +2 -1
  59. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/__init__.pyi +2 -0
  60. bonesistools-1.6.0/src/bonesistools/resources/cache.py +332 -0
  61. bonesistools-1.6.0/src/bonesistools/resources/cache.pyi +25 -0
  62. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/__init__.py +4 -4
  63. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/__init__.pyi +2 -0
  64. bonesistools-1.6.0/src/bonesistools/resources/hcop/_orthologs.py +2102 -0
  65. bonesistools-1.6.0/src/bonesistools/resources/ncbi/__init__.py +27 -0
  66. bonesistools-1.6.0/src/bonesistools/resources/ncbi/__init__.pyi +7 -0
  67. bonesistools-1.6.0/src/bonesistools/resources/ncbi/_download.py +66 -0
  68. bonesistools-1.6.0/src/bonesistools/resources/ncbi/_genesyn.py +2276 -0
  69. bonesistools-1.4.0/src/bonesistools/resources/ncbi/_genesyn.py → bonesistools-1.6.0/src/bonesistools/resources/ncbi/_identifiers.py +647 -616
  70. bonesistools-1.6.0/src/bonesistools/resources/ncbi/_mapping_cache.py +161 -0
  71. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/ncbi/_typing.py +9 -2
  72. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/omnipath/_archive.py +173 -98
  73. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/omnipath/_collectri.py +80 -59
  74. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/omnipath/_dorothea.py +125 -73
  75. bonesistools-1.6.0/src/bonesistools/resources/omnipath/_graph_cache.py +227 -0
  76. bonesistools-1.6.0/tests/golden/LICENSE.txt +20 -0
  77. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/README.md +82 -6
  78. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/conftest.py +19 -0
  79. bonesistools-1.6.0/tests/golden/generate_expected.py +117 -0
  80. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/logic/_boolean_workflow.py +11 -8
  81. bonesistools-1.6.0/tests/golden/logic/_graph_layout.py +49 -0
  82. bonesistools-1.6.0/tests/golden/logic/data/README.md +67 -0
  83. bonesistools-1.6.0/tests/golden/logic/data/sea_urchin_dorsal_ventral_axis.sbml +1353 -0
  84. bonesistools-1.6.0/tests/golden/logic/expected/aggregated_influence_graph.dot +31 -0
  85. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/logic/expected/death_receptor_cell_fate_mp.npz +0 -0
  86. bonesistools-1.6.0/tests/golden/logic/expected/sea_urchin_dorsal_ventral_axis.bnet +46 -0
  87. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/logic/expected/synthetic_30_node_dynamics.npz +0 -0
  88. bonesistools-1.6.0/tests/golden/logic/test_golden_boolean_workflow.py +53 -0
  89. bonesistools-1.6.0/tests/golden/logic/test_golden_graph_layout.py +11 -0
  90. bonesistools-1.6.0/tests/golden/logic/test_golden_sea_urchin.py +148 -0
  91. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/omics/_omics_workflow.py +49 -2
  92. bonesistools-1.6.0/tests/golden/omics/_tsne_diagnostics.py +262 -0
  93. bonesistools-1.6.0/tests/golden/omics/_umap_diagnostics.py +168 -0
  94. bonesistools-1.6.0/tests/golden/omics/expected/knnsc.npz +0 -0
  95. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/omics/expected/neighbors.npz +0 -0
  96. bonesistools-1.6.0/tests/golden/omics/expected/tsne.npz +0 -0
  97. bonesistools-1.6.0/tests/golden/omics/expected/tsne_diagnostics/checkpoints.npz +0 -0
  98. bonesistools-1.6.0/tests/golden/omics/expected/umap.npz +0 -0
  99. bonesistools-1.6.0/tests/golden/omics/expected/umap_diagnostics/checkpoints.npz +0 -0
  100. bonesistools-1.6.0/tests/golden/omics/test_golden_omics_workflow.py +178 -0
  101. bonesistools-1.6.0/tests/golden/omics/test_golden_tsne_diagnostics.py +181 -0
  102. bonesistools-1.6.0/tests/golden/omics/test_golden_umap_diagnostics.py +54 -0
  103. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ba/test_configuration.py +57 -1
  104. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ba/test_hypercube.py +107 -52
  105. bonesistools-1.6.0/tests/regression/logic/ba/test_robdd.py +194 -0
  106. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ba/test_structure.py +79 -43
  107. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ba/test_typing.py +1 -1
  108. bonesistools-1.6.0/tests/regression/logic/bn/test_boolean_network.py +632 -0
  109. bonesistools-1.6.0/tests/regression/logic/bn/test_boolean_network_ensemble.py +562 -0
  110. bonesistools-1.6.0/tests/regression/logic/bn/test_distances.py +342 -0
  111. bonesistools-1.6.0/tests/regression/logic/bn/test_dynamics.py +1604 -0
  112. bonesistools-1.6.0/tests/regression/logic/bn/test_most_permissive.py +604 -0
  113. bonesistools-1.6.0/tests/regression/logic/bn/test_symbolic.py +732 -0
  114. bonesistools-1.6.0/tests/regression/logic/ig/test_aggregated_influence_graph.py +284 -0
  115. bonesistools-1.6.0/tests/regression/logic/ig/test_aggregated_visualization.py +427 -0
  116. bonesistools-1.6.0/tests/regression/logic/ig/test_collapsing.py +596 -0
  117. bonesistools-1.6.0/tests/regression/logic/ig/test_distances.py +345 -0
  118. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ig/test_influence_graph.py +126 -4
  119. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ig/test_parser.py +63 -20
  120. bonesistools-1.6.0/tests/regression/logic/io/test_ginml.py +1232 -0
  121. bonesistools-1.6.0/tests/regression/logic/io/test_sbml.py +250 -0
  122. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/conftest.py +17 -18
  123. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/io/test_nestorowa.py +5 -5
  124. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/io/test_registry.py +6 -0
  125. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pl/test_graph.py +22 -0
  126. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pl/test_scatterplot.py +103 -0
  127. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pp/test_classification.py +31 -12
  128. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pp/test_duplicates.py +23 -0
  129. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pp/test_genename.py +35 -10
  130. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pp/test_hvg.py +45 -6
  131. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_embedding.py +227 -30
  132. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_knnsc.py +10 -11
  133. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_markers.py +124 -0
  134. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_neighbors.py +372 -67
  135. bonesistools-1.6.0/tests/regression/resources/test_cache.py +338 -0
  136. bonesistools-1.6.0/tests/regression/resources/test_hcop.py +1118 -0
  137. bonesistools-1.6.0/tests/regression/resources/test_ncbi.py +1348 -0
  138. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/resources/test_omnipath.py +432 -32
  139. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/test_import.py +10 -3
  140. bonesistools-1.6.0/tests/reproducibility/dorothea_modern_mouse_A_2025-08-13.sha256 +1 -0
  141. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/reproducibility/test_reproducibility_boolean_backends.py +16 -8
  142. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/reproducibility/test_reproducibility_omnipath.py +5 -4
  143. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/reproducibility/test_reproducibility_workflow.py +2 -0
  144. bonesistools-1.4.0/src/bonesistools/_warnings.py +0 -31
  145. bonesistools-1.4.0/src/bonesistools/logic/boolean_algebra/_parser.py +0 -9
  146. bonesistools-1.4.0/src/bonesistools/logic/boolean_network/_dynamics.py +0 -960
  147. bonesistools-1.4.0/src/bonesistools/logic/boolean_network/_most_permissive.py +0 -399
  148. bonesistools-1.4.0/src/bonesistools/logic/influence_graph/_distances.py +0 -187
  149. bonesistools-1.4.0/src/bonesistools/logic/influence_graph/_parser.py +0 -44
  150. bonesistools-1.4.0/src/bonesistools/logic/input_output/_executable_model.py +0 -83
  151. bonesistools-1.4.0/src/bonesistools/logic/input_output/_ginml.py +0 -877
  152. bonesistools-1.4.0/src/bonesistools/resources/hcop/_orthologs.py +0 -1305
  153. bonesistools-1.4.0/src/bonesistools/resources/ncbi/__init__.py +0 -25
  154. bonesistools-1.4.0/src/bonesistools/resources/ncbi/__init__.pyi +0 -5
  155. bonesistools-1.4.0/tests/.placeholder +0 -0
  156. bonesistools-1.4.0/tests/golden/LICENSE.txt +0 -36
  157. bonesistools-1.4.0/tests/golden/generate_expected.py +0 -63
  158. bonesistools-1.4.0/tests/golden/logic/death_receptor_cell_fate.zginml +0 -0
  159. bonesistools-1.4.0/tests/golden/logic/synthetic_30_node_dynamics.zginml +0 -0
  160. bonesistools-1.4.0/tests/golden/logic/test_golden_boolean_workflow.py +0 -30
  161. bonesistools-1.4.0/tests/golden/omics/expected/knnsc.npz +0 -0
  162. bonesistools-1.4.0/tests/golden/omics/expected/tsne.npz +0 -0
  163. bonesistools-1.4.0/tests/golden/omics/expected/umap.npz +0 -0
  164. bonesistools-1.4.0/tests/golden/omics/test_golden_omics_workflow.py +0 -94
  165. bonesistools-1.4.0/tests/regression/logic/bn/test_boolean_network.py +0 -1342
  166. bonesistools-1.4.0/tests/regression/logic/bn/test_boolean_network_ensemble.py +0 -323
  167. bonesistools-1.4.0/tests/regression/logic/ig/test_aggregated_influence_graph.py +0 -1220
  168. bonesistools-1.4.0/tests/regression/logic/ig/test_distances.py +0 -222
  169. bonesistools-1.4.0/tests/regression/logic/io/test_ginml.py +0 -308
  170. bonesistools-1.4.0/tests/regression/resources/test_hcop.py +0 -491
  171. bonesistools-1.4.0/tests/regression/resources/test_ncbi.py +0 -723
  172. bonesistools-1.4.0/tests/reproducibility/dorothea_current_mouse_A.sha256 +0 -1
  173. {bonesistools-1.4.0 → bonesistools-1.6.0}/LICENSE +0 -0
  174. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/__init__.pyi +0 -0
  175. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/_compat.py +0 -0
  176. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/_metadata.py +0 -0
  177. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/_typing.py +0 -0
  178. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/_validation.py +0 -0
  179. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/__init__.pyi +0 -0
  180. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_algebra/_algebra.py +0 -0
  181. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_algebra/_boolean.py +0 -0
  182. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_algebra/_kleene.py +0 -0
  183. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_algebra/_representation.py +0 -0
  184. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/boolean_network/_parser.py +0 -0
  185. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/influence_graph/__init__.py +0 -0
  186. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/influence_graph/_algorithms.py +0 -0
  187. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/influence_graph/_svg.py +0 -0
  188. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/logic/influence_graph/_typing.py +0 -0
  189. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/__init__.py +0 -0
  190. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/__init__.pyi +0 -0
  191. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/_dependencies.py +0 -0
  192. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/_metadata.py +0 -0
  193. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/_stats.py +0 -0
  194. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/_validation.py +0 -0
  195. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/datasets/__init__.py +0 -0
  196. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/datasets/__init__.pyi +0 -0
  197. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/input_output/__init__.py +0 -0
  198. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/input_output/__init__.pyi +0 -0
  199. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/input_output/_geo.py +0 -0
  200. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/input_output/_metadata.py +0 -0
  201. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/input_output/_registry.py +0 -0
  202. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/input_output/_write.py +0 -0
  203. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/input_output/datasets.json +0 -0
  204. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/plotting/__init__.py +0 -0
  205. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/plotting/__init__.pyi +0 -0
  206. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/plotting/_barplot.py +0 -0
  207. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/plotting/_colors.py +0 -0
  208. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/plotting/_density.py +0 -0
  209. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/plotting/_distribution.py +0 -0
  210. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/plotting/_figure.py +0 -0
  211. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/plotting/_typing.py +0 -0
  212. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/plotting/_utils.py +0 -0
  213. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/preprocessing/__init__.py +0 -0
  214. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/preprocessing/__init__.pyi +0 -0
  215. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/preprocessing/_filter.py +0 -0
  216. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/preprocessing/_qc.py +0 -0
  217. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/preprocessing/_simple.py +0 -0
  218. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/preprocessing/_transfer.py +0 -0
  219. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/preprocessing/_transform.py +0 -0
  220. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_binarize.py +0 -0
  221. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_clustering.py +0 -0
  222. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_conversion.py +0 -0
  223. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_graph.py +0 -0
  224. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_maths.py +0 -0
  225. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_regress.py +0 -0
  226. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_stats.py +0 -0
  227. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_utils.py +0 -0
  228. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/omics/tools/_write.py +0 -0
  229. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/py.typed +0 -0
  230. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_anole_lizard_hcop.tsv.gz +0 -0
  231. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_c.elegans_hcop.tsv.gz +0 -0
  232. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_cat_hcop.tsv.gz +0 -0
  233. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_cattle_hcop.tsv.gz +0 -0
  234. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_chicken_hcop.tsv.gz +0 -0
  235. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_chimpanzee_hcop.tsv.gz +0 -0
  236. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_dog_hcop.tsv.gz +0 -0
  237. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_fruitfly_hcop.tsv.gz +0 -0
  238. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_horse_hcop.tsv.gz +0 -0
  239. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_macaque_hcop.tsv.gz +0 -0
  240. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_mouse_hcop.tsv.gz +0 -0
  241. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_opossum_hcop.tsv.gz +0 -0
  242. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_pig_hcop.tsv.gz +0 -0
  243. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_platypus_hcop.tsv.gz +0 -0
  244. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_rat_hcop.tsv.gz +0 -0
  245. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_s.cerevisiae_hcop.tsv.gz +0 -0
  246. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_s.pombe_hcop.tsv.gz +0 -0
  247. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_xenopus_hcop.tsv.gz +0 -0
  248. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/hcop/data/human_zebrafish_hcop.tsv.gz +0 -0
  249. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/ncbi/data/gi/escherichia_coli_gene_info.tsv.gz +0 -0
  250. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/ncbi/data/gi/homo_sapiens_gene_info.tsv.gz +0 -0
  251. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/ncbi/data/gi/mus_musculus_gene_info.tsv.gz +0 -0
  252. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/omnipath/__init__.py +0 -0
  253. {bonesistools-1.4.0 → bonesistools-1.6.0}/src/bonesistools/resources/omnipath/__init__.pyi +0 -0
  254. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/__init__.py +0 -0
  255. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/__init__.py +0 -0
  256. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/logic/__init__.py +0 -0
  257. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/omics/__init__.py +0 -0
  258. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/omics/expected/hvg_binning.npz +0 -0
  259. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/omics/expected/hvg_loess.npz +0 -0
  260. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/omics/expected/pca.npz +0 -0
  261. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/omics/expected/qc.npz +0 -0
  262. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/omics/expected/spectral.npz +0 -0
  263. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/omics/pbmc3k.h5ad +0 -0
  264. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/golden/omics/test_pbmc3k.py +0 -0
  265. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/__init__.py +0 -0
  266. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/__init__.py +0 -0
  267. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ba/__init__.py +0 -0
  268. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ba/test_algebra.py +0 -0
  269. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ba/test_boolean.py +0 -0
  270. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ba/test_kleene.py +0 -0
  271. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/bn/__init__.py +0 -0
  272. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/conftest.py +0 -0
  273. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ig/__init__.py +0 -0
  274. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ig/test_scoring.py +0 -0
  275. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/ig/test_styles.py +0 -0
  276. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/logic/io/__init__.py +0 -0
  277. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/__init__.py +0 -0
  278. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/io/__init__.py +0 -0
  279. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/io/test_geo.py +0 -0
  280. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/io/test_write.py +0 -0
  281. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pl/__init__.py +0 -0
  282. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pl/test_barplot.py +0 -0
  283. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pl/test_colors.py +0 -0
  284. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pl/test_density.py +0 -0
  285. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pl/test_distribution.py +0 -0
  286. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pl/test_figure.py +0 -0
  287. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pl/test_utils.py +0 -0
  288. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pp/__init__.py +0 -0
  289. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pp/test_qc.py +0 -0
  290. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pp/test_simple.py +0 -0
  291. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pp/test_transfer_obs.py +0 -0
  292. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/pp/test_transform.py +0 -0
  293. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/test_typing.py +0 -0
  294. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/__init__.py +0 -0
  295. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_binarize.py +0 -0
  296. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_clustering.py +0 -0
  297. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_conversion.py +0 -0
  298. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_maths.py +0 -0
  299. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_paga.py +0 -0
  300. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_regress.py +0 -0
  301. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_stats.py +0 -0
  302. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/tl/test_utils.py +0 -0
  303. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/omics/toy_data.py +0 -0
  304. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/regression/test_validation.py +0 -0
  305. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/reproducibility/__init__.py +0 -0
  306. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/reproducibility/dorothea_legacy_mouse.sha256 +0 -0
  307. {bonesistools-1.4.0 → bonesistools-1.6.0}/tests/reproducibility/test_reproducibility_stats.py +0 -0
@@ -69,6 +69,7 @@ Thumbs.db
69
69
 
70
70
  # Generated figures / graph exports
71
71
  *.dot
72
+ !tests/golden/logic/expected/*.dot
72
73
  *.dot.pdf
73
74
  *.gv
74
75
  *.gv.pdf
@@ -128,3 +129,4 @@ tests/reproducibility/*.json
128
129
  scripts/
129
130
  *.zginml
130
131
  !tests/golden/*.zginml
132
+ test_*/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bonesistools
3
- Version: 1.4.0
3
+ Version: 1.6.0
4
4
  Summary: Bioinformatics toolkit for upstream and downstream analyses around the BoNesis framework
5
5
  Project-URL: Repository, https://github.com/bnediction/bonesistools
6
6
  Author: Théo Roncalli
@@ -34,7 +34,9 @@ Requires-Python: >=3.7
34
34
  Requires-Dist: anndata>=0.8
35
35
  Requires-Dist: boolean-py>=4.0
36
36
  Requires-Dist: clingo>=5.6
37
- Requires-Dist: h5py>=3.7
37
+ Requires-Dist: dd<0.6,>=0.5.7; python_version < '3.11' and python_version != '3.9'
38
+ Requires-Dist: dd==0.5.6; python_version == '3.9'
39
+ Requires-Dist: dd>=0.6; python_version >= '3.11'
38
40
  Requires-Dist: importlib-metadata; python_version < '3.8'
39
41
  Requires-Dist: importlib-resources; python_version < '3.9'
40
42
  Requires-Dist: matplotlib>=3.5
@@ -45,8 +47,6 @@ Requires-Dist: scikit-learn>=1.0
45
47
  Requires-Dist: scipy>=1.7
46
48
  Requires-Dist: typing-extensions>=4.0
47
49
  Provides-Extra: all
48
- Requires-Dist: dd<0.6,>=0.5.7; (python_version < '3.11') and extra == 'all'
49
- Requires-Dist: dd>=0.6; (python_version >= '3.11') and extra == 'all'
50
50
  Requires-Dist: graphviz>=0.20; extra == 'all'
51
51
  Requires-Dist: igraph>=0.10; extra == 'all'
52
52
  Requires-Dist: leidenalg>=0.10; extra == 'all'
@@ -58,9 +58,6 @@ Requires-Dist: pydot>=3.0.2; extra == 'all'
58
58
  Requires-Dist: scikit-misc>=0.5; (python_version >= '3.10') and extra == 'all'
59
59
  Requires-Dist: seaborn>=0.11; extra == 'all'
60
60
  Requires-Dist: umap-learn>=0.5; extra == 'all'
61
- Provides-Extra: bdd
62
- Requires-Dist: dd<0.6,>=0.5.7; (python_version < '3.11') and extra == 'bdd'
63
- Requires-Dist: dd>=0.6; (python_version >= '3.11') and extra == 'bdd'
64
61
  Provides-Extra: bn
65
62
  Requires-Dist: mpbn>=4.1; extra == 'bn'
66
63
  Provides-Extra: graphviz
@@ -185,11 +182,11 @@ Submodules:
185
182
  Example:
186
183
 
187
184
  ```python
188
- genesyn = bt.resources.ncbi.genesyn()
185
+ gene_identifiers = bt.resources.ncbi.identifiers()
189
186
 
190
187
  grn = bt.resources.omnipath.collectri(
191
188
  organism="mouse",
192
- genesyn=genesyn,
189
+ identifiers=gene_identifiers,
193
190
  )
194
191
  ```
195
192
 
@@ -108,11 +108,11 @@ Submodules:
108
108
  Example:
109
109
 
110
110
  ```python
111
- genesyn = bt.resources.ncbi.genesyn()
111
+ gene_identifiers = bt.resources.ncbi.identifiers()
112
112
 
113
113
  grn = bt.resources.omnipath.collectri(
114
114
  organism="mouse",
115
- genesyn=genesyn,
115
+ identifiers=gene_identifiers,
116
116
  )
117
117
  ```
118
118
 
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
5
5
  [project]
6
6
  name = "bonesistools"
7
7
  description = "Bioinformatics toolkit for upstream and downstream analyses around the BoNesis framework"
8
- version = "1.4.0"
8
+ version = "1.6.0"
9
9
  license = "CECILL-2.1"
10
10
  credits = ["BNeDiction", "PEPR Santé Numérique 2030"]
11
11
  authors = [
@@ -50,10 +50,12 @@ dependencies = [
50
50
  "scikit-learn>=1.0",
51
51
  "networkx>=2.1",
52
52
  "matplotlib>=3.5",
53
- "h5py>=3.7",
54
53
  "anndata>=0.8",
55
54
  "boolean.py>=4.0",
56
55
  "clingo>=5.6",
56
+ "dd>=0.5.7,<0.6; python_version < '3.11' and python_version != '3.9'",
57
+ "dd==0.5.6; python_version == '3.9'",
58
+ "dd>=0.6; python_version >= '3.11'",
57
59
  ]
58
60
  keywords = [
59
61
  "bioinformatics",
@@ -73,8 +75,6 @@ paths = ["LICENSE"]
73
75
 
74
76
  [project.optional-dependencies]
75
77
  all = [
76
- "dd>=0.5.7,<0.6; python_version < '3.11'",
77
- "dd>=0.6; python_version >= '3.11'",
78
78
  "graphviz>=0.20",
79
79
  "mudata>=0.3.1",
80
80
  "multiprocess>=0.70.18",
@@ -87,10 +87,6 @@ all = [
87
87
  "umap-learn>=0.5",
88
88
  "mpbn>=4.1",
89
89
  ]
90
- bdd = [
91
- "dd>=0.5.7,<0.6; python_version < '3.11'",
92
- "dd>=0.6; python_version >= '3.11'",
93
- ]
94
90
  graphviz = [ "graphviz>=0.20" ]
95
91
  mudata = [ "mudata>=0.3.1" ]
96
92
  bn = [
@@ -105,7 +101,6 @@ omics = [
105
101
  ]
106
102
 
107
103
  [tool.hatch.build.targets.sdist]
108
- ignore-vcs = true
109
104
  include = [
110
105
  "/LICENSE",
111
106
  "/README.md",
@@ -16,8 +16,6 @@ resources
16
16
  Credits: BNeDiction; PEPR Santé Numérique 2030.
17
17
  """
18
18
 
19
- from __future__ import annotations
20
-
21
19
  import sys as _sys
22
20
  from types import ModuleType as _ModuleType
23
21
  from typing import Dict as _Dict
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env python
2
+
3
+ import warnings
4
+ from functools import wraps
5
+ from typing import Any, Callable, Optional, TypeVar, cast
6
+
7
+ _F = TypeVar("_F", bound=Callable[..., Any])
8
+
9
+
10
+ def _warn_deprecated(
11
+ name: str,
12
+ *,
13
+ replacement: Optional[str] = None,
14
+ stacklevel: int = 2,
15
+ ) -> None:
16
+
17
+ message = f"{name} is deprecated and will be removed in 2.0.0"
18
+ if replacement is not None:
19
+ message = f"{message}; use {replacement} instead"
20
+ warnings.warn(f"{message}.", FutureWarning, stacklevel=stacklevel)
21
+
22
+
23
+ def _warn_deprecated_argument(
24
+ old_name: str,
25
+ new_name: str,
26
+ *,
27
+ stacklevel: int = 2,
28
+ ) -> None:
29
+
30
+ _warn_deprecated(
31
+ f"`{old_name}`",
32
+ replacement=f"`{new_name}`",
33
+ stacklevel=stacklevel,
34
+ )
35
+
36
+
37
+ def _deprecated(*, replacement: Optional[str] = None) -> Callable[[_F], _F]:
38
+ """Mark a callable as deprecated while preserving its public signature."""
39
+
40
+ def decorator(function: _F) -> _F:
41
+ @wraps(function)
42
+ def wrapped(*args: Any, **kwargs: Any) -> Any:
43
+ _warn_deprecated(
44
+ f"`{function.__qualname__}()`",
45
+ replacement=replacement,
46
+ stacklevel=3,
47
+ )
48
+ return function(*args, **kwargs)
49
+
50
+ return cast(_F, wrapped)
51
+
52
+ return decorator
53
+
54
+
55
+ def _rename_deprecated_arguments(**replacements: str) -> Callable[[_F], _F]:
56
+ """Accept deprecated keyword names while exposing the current signature."""
57
+
58
+ def decorator(function: _F) -> _F:
59
+ @wraps(function)
60
+ def wrapped(*args: Any, **kwargs: Any) -> Any:
61
+ for old_name, new_name in replacements.items():
62
+ if old_name not in kwargs:
63
+ continue
64
+
65
+ _warn_deprecated_argument(old_name, new_name, stacklevel=4)
66
+ if new_name in kwargs:
67
+ raise TypeError(
68
+ "invalid argument combination: use either "
69
+ f"'{old_name}' or '{new_name}', not both"
70
+ )
71
+ kwargs[new_name] = kwargs.pop(old_name)
72
+
73
+ return function(*args, **kwargs)
74
+
75
+ return cast(_F, wrapped)
76
+
77
+ return decorator
@@ -18,8 +18,6 @@ io
18
18
  Input/output helpers.
19
19
  """
20
20
 
21
- from __future__ import annotations
22
-
23
21
  import sys as _sys
24
22
  from types import ModuleType as _ModuleType
25
23
  from typing import Dict as _Dict
@@ -57,7 +55,6 @@ _DEPRECATED: _Dict[str, _Tuple[str, str]] = {
57
55
  "BooleanNetworkEnsemble": ("bn", "BooleanNetworkEnsemble"),
58
56
  "Hypercube": ("ba", "Hypercube"),
59
57
  "HypercubeCollection": ("ba", "HypercubeCollection"),
60
- "bn_to_pydot": ("bn", "bn_to_pydot"),
61
58
  }
62
59
 
63
60
  __all__ = [
@@ -5,7 +5,7 @@ Utilities for Boolean algebra and partial Boolean abstractions.
5
5
 
6
6
  The `ba` sub-package provides structures and operations for Boolean algebra,
7
7
  including partial Boolean values, Kleene truth values, hypercubes,
8
- configuration sets, implicants and predecessor inference utilities.
8
+ configuration sets, ROBDDs, implicants and predecessor inference utilities.
9
9
  """
10
10
 
11
11
  from typing import Any as _Any
@@ -26,9 +26,10 @@ from ._kleene import (
26
26
  meet,
27
27
  )
28
28
  from ._representation import rule_to_string
29
+ from ._robdd import ROBDD
29
30
  from ._structure import (
30
31
  dnf_implicants,
31
- expressions_equivalent,
32
+ equivalence,
32
33
  prime_implicants,
33
34
  )
34
35
 
@@ -39,34 +40,17 @@ __all__ = [
39
40
  "ConfigurationSet",
40
41
  "Hypercube",
41
42
  "HypercubeCollection",
43
+ "ROBDD",
42
44
  "diff",
43
45
  "meet",
44
46
  "join",
45
- "expressions_equivalent",
47
+ "equivalence",
46
48
  "dnf_implicants",
47
49
  "prime_implicants",
48
50
  "rule_to_string",
49
51
  ]
50
52
 
51
53
 
52
- def read_hypercube(*args: _Any, **kwargs: _Any) -> Hypercube:
53
- """
54
- Deprecated. Read a hypercube from a JSON file.
55
-
56
- Use `bt.logic.io.read_hypercube(...)` instead.
57
- """
58
-
59
- _warn_deprecated(
60
- "`bt.logic.ba.read_hypercube`",
61
- replacement="`bt.logic.io.read_hypercube`",
62
- stacklevel=2,
63
- )
64
-
65
- from ._parser import read_hypercube as _read_hypercube
66
-
67
- return _read_hypercube(*args, **kwargs)
68
-
69
-
70
54
  def read_hypercubes(*args: _Any, **kwargs: _Any) -> _Dict[str, Hypercube]:
71
55
  """
72
56
  Deprecated. Read named hypercubes from a CSV, TSV or JSON file.
@@ -86,7 +70,7 @@ def read_hypercubes(*args: _Any, **kwargs: _Any) -> _Dict[str, Hypercube]:
86
70
 
87
71
 
88
72
  def __dir__() -> _List[str]:
89
- hidden = {"read_hypercube", "read_hypercubes"}
73
+ hidden = {"read_hypercubes"}
90
74
  return sorted(
91
75
  name for name in (set(globals()) | set(__all__)) - hidden if name[0] != "_"
92
76
  )
@@ -18,11 +18,12 @@ from bonesistools.logic.boolean_algebra._kleene import meet as meet
18
18
  from bonesistools.logic.boolean_algebra._representation import (
19
19
  rule_to_string as rule_to_string,
20
20
  )
21
+ from bonesistools.logic.boolean_algebra._robdd import ROBDD as ROBDD
21
22
  from bonesistools.logic.boolean_algebra._structure import (
22
23
  dnf_implicants as dnf_implicants,
23
24
  )
24
25
  from bonesistools.logic.boolean_algebra._structure import (
25
- expressions_equivalent as expressions_equivalent,
26
+ equivalence as equivalence,
26
27
  )
27
28
  from bonesistools.logic.boolean_algebra._structure import (
28
29
  prime_implicants as prime_implicants,
@@ -35,10 +36,11 @@ __all__ = [
35
36
  "ConfigurationSet",
36
37
  "Hypercube",
37
38
  "HypercubeCollection",
39
+ "ROBDD",
38
40
  "diff",
39
41
  "meet",
40
42
  "join",
41
- "expressions_equivalent",
43
+ "equivalence",
42
44
  "dnf_implicants",
43
45
  "prime_implicants",
44
46
  "rule_to_string",
@@ -2,26 +2,32 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from bisect import bisect_right
5
6
  from collections.abc import Iterable, Iterator, Mapping
6
7
  from itertools import product
7
- from typing import Dict, List, Optional, Sequence, Tuple, Union, overload
8
+ from typing import List, Optional, Sequence, Tuple, Union, overload
8
9
 
9
10
  from ..._typing import RandomStateSeed
10
11
  from ..._validation import _as_positive_integer, _as_seed
11
12
  from ._hypercube import Hypercube
12
- from ._typing import ConfigurationLike, HypercubeLike
13
+ from ._typing import Configuration, ConfigurationLike, HypercubeLike
13
14
 
14
15
  _EncodedHypercube = Tuple[int, int]
15
16
 
17
+ try:
18
+ _INT_BIT_COUNT = int.bit_count
19
+ except AttributeError: # pragma: no cover - Python < 3.8
20
+ _INT_BIT_COUNT = None
21
+
16
22
 
17
23
  class ConfigurationSet:
18
24
  """
19
25
  Exact finite set of Boolean configurations.
20
26
 
21
27
  A ConfigurationSet represents a set of complete Boolean configurations over
22
- a fixed ordered list of components. The internal representation is compact
23
- and intentionally hidden from the public API: users interact with concrete
24
- configurations through membership, iteration, counting and sampling.
28
+ a fixed ordered list of components. Users can interact with complete
29
+ configurations through membership, iteration, counting and sampling, or
30
+ recover an exact decomposition into Boolean subspaces with `hypercubes()`.
25
31
 
26
32
  The stored representation is exact and non-redundant: adding a more general
27
33
  subspace removes more specific stored subspaces that it covers. The
@@ -124,21 +130,30 @@ class ConfigurationSet:
124
130
  if not isinstance(other, ConfigurationSet):
125
131
  return NotImplemented
126
132
 
133
+ if self is other:
134
+ return True
135
+
127
136
  if set(self._components) != set(other._components):
128
137
  return False
129
138
 
139
+ if self._components == other._components:
140
+ if self._hypercubes == other._hypercubes:
141
+ return True
142
+ if set(self._hypercubes) == set(other._hypercubes):
143
+ return True
144
+
130
145
  if self.count() != other.count():
131
146
  return False
132
147
 
133
148
  return self._covers(other) and other._covers(self)
134
149
 
135
- def __iter__(self) -> Iterator[Dict[str, int]]:
150
+ def __iter__(self) -> Iterator[Configuration]:
136
151
  """
137
152
  Iterate over complete configurations.
138
153
 
139
154
  Yields
140
155
  ------
141
- dict[str, int]
156
+ Configuration
142
157
  Complete Boolean configurations ordered by `components`.
143
158
  """
144
159
 
@@ -181,6 +196,33 @@ class ConfigurationSet:
181
196
 
182
197
  return copied
183
198
 
199
+ def hypercubes(self) -> Tuple[Hypercube, ...]:
200
+ """
201
+ Return an exact, pairwise-disjoint hypercube decomposition.
202
+
203
+ The returned hypercubes collectively represent exactly the same
204
+ complete configurations as this set. Their order is unspecified, and
205
+ the decomposition is not guaranteed to use the globally minimal number
206
+ of hypercubes.
207
+
208
+ Examples
209
+ --------
210
+ >>> states = ConfigurationSet(["A", "B"], [{"B": 0}])
211
+ >>> states.hypercubes()
212
+ (Hypercube(B=0),)
213
+
214
+ Returns
215
+ -------
216
+ tuple of Hypercube
217
+ Independent hypercubes whose disjoint union is this configuration
218
+ set.
219
+ """
220
+
221
+ return tuple(
222
+ _decode_hypercube(hypercube, self._components)
223
+ for hypercube in self._hypercubes
224
+ )
225
+
184
226
  def add(
185
227
  self,
186
228
  configuration: Union[ConfigurationLike, HypercubeLike],
@@ -295,7 +337,7 @@ class ConfigurationSet:
295
337
  for hypercube in self._hypercubes
296
338
  )
297
339
 
298
- def enumerate(self) -> Tuple[Dict[str, int], ...]:
340
+ def enumerate(self) -> Tuple[Configuration, ...]:
299
341
  """
300
342
  Return all represented configurations.
301
343
 
@@ -314,7 +356,7 @@ class ConfigurationSet:
314
356
  n: None = None,
315
357
  *,
316
358
  seed: RandomStateSeed = None,
317
- ) -> Dict[str, int]: ...
359
+ ) -> Configuration: ...
318
360
 
319
361
  @overload
320
362
  def sample(
@@ -322,14 +364,14 @@ class ConfigurationSet:
322
364
  n: int,
323
365
  *,
324
366
  seed: RandomStateSeed = None,
325
- ) -> Tuple[Dict[str, int], ...]: ...
367
+ ) -> Tuple[Configuration, ...]: ...
326
368
 
327
369
  def sample(
328
370
  self,
329
371
  n: Optional[int] = None,
330
372
  *,
331
373
  seed: RandomStateSeed = None,
332
- ) -> Union[Dict[str, int], Tuple[Dict[str, int], ...]]:
374
+ ) -> Union[Configuration, Tuple[Configuration, ...]]:
333
375
  """
334
376
  Sample represented configurations with replacement.
335
377
 
@@ -351,7 +393,7 @@ class ConfigurationSet:
351
393
 
352
394
  Returns
353
395
  -------
354
- dict[str, int] or tuple of dict[str, int]
396
+ Configuration or tuple of Configuration
355
397
  One sampled configuration when `n` is omitted, otherwise a tuple of
356
398
  sampled configurations.
357
399
 
@@ -370,9 +412,53 @@ class ConfigurationSet:
370
412
  return self._sample_one(rng)
371
413
 
372
414
  n = _as_positive_integer(n, "n")
373
- return tuple(self._sample_one(rng) for _ in range(n))
415
+ cumulative_sizes = []
416
+ total = 0
417
+ for hypercube in self._hypercubes:
418
+ total += _count_hypercube_configurations(
419
+ hypercube,
420
+ len(self._components),
421
+ )
422
+ cumulative_sizes.append(total)
374
423
 
375
- def _sample_one(self, rng: object) -> Dict[str, int]:
424
+ sampled = []
425
+ for _ in range(n):
426
+ index = int(
427
+ rng.randint(total) # pyright: ignore[reportAttributeAccessIssue]
428
+ )
429
+ hypercube_index = bisect_right(cumulative_sizes, index)
430
+ previous_size = (
431
+ cumulative_sizes[hypercube_index - 1] if hypercube_index > 0 else 0
432
+ )
433
+ sampled.append(
434
+ _configuration_at_index(
435
+ self._hypercubes[hypercube_index],
436
+ self._components,
437
+ index - previous_size,
438
+ )
439
+ )
440
+
441
+ return tuple(sampled)
442
+
443
+ @classmethod
444
+ def _from_encoded_hypercubes(
445
+ cls,
446
+ components: Iterable[str],
447
+ hypercubes: Iterable[_EncodedHypercube],
448
+ ) -> "ConfigurationSet":
449
+ """Build a set from a trusted exact disjoint encoded representation."""
450
+
451
+ resolved_components = tuple(components)
452
+ configurations = cls.__new__(cls)
453
+ configurations._components = resolved_components
454
+ configurations._component_to_index = {
455
+ component: index for index, component in enumerate(resolved_components)
456
+ }
457
+ configurations._hypercubes = list(hypercubes)
458
+
459
+ return configurations
460
+
461
+ def _sample_one(self, rng: object) -> Configuration:
376
462
 
377
463
  total = self.count()
378
464
  index = int(rng.randint(total)) # pyright: ignore[reportAttributeAccessIssue]
@@ -427,12 +513,17 @@ class ConfigurationSet:
427
513
  for hypercube in other._hypercubes
428
514
  )
429
515
 
430
- def _as_hypercubes(self) -> Tuple[Hypercube, ...]:
516
+ def _iter_encoded_hypercubes(self) -> Iterator[_EncodedHypercube]:
431
517
 
432
- return tuple(
433
- _decode_hypercube(hypercube, self._components)
434
- for hypercube in self._hypercubes
435
- )
518
+ return iter(self._hypercubes)
519
+
520
+ def _iter_configuration_bits(self) -> Iterator[int]:
521
+
522
+ for hypercube in self._hypercubes:
523
+ yield from _iter_hypercube_configuration_bits(
524
+ hypercube,
525
+ len(self._components),
526
+ )
436
527
 
437
528
  def _coerce_hypercube(self, configuration: object) -> _EncodedHypercube:
438
529
 
@@ -467,13 +558,18 @@ def _coerce_components(components: Iterable[str]) -> Tuple[str, ...]:
467
558
  if not all(isinstance(component, str) for component in resolved):
468
559
  raise TypeError("components must be an iterable of strings")
469
560
 
470
- duplicated = sorted(
471
- component for component in set(resolved) if resolved.count(component) > 1
472
- )
561
+ seen = set()
562
+ duplicated = set()
563
+ for component in resolved:
564
+ if component in seen:
565
+ duplicated.add(component)
566
+ else:
567
+ seen.add(component)
568
+
473
569
  if duplicated:
474
570
  raise ValueError(
475
571
  "components must be unique; duplicated components: "
476
- f"{', '.join(duplicated)}"
572
+ f"{', '.join(sorted(duplicated))}"
477
573
  )
478
574
 
479
575
  return resolved
@@ -514,7 +610,7 @@ def _count_hypercube_configurations(
514
610
  def _iter_hypercube_configurations(
515
611
  hypercube: _EncodedHypercube,
516
612
  components: Sequence[str],
517
- ) -> Iterator[Dict[str, int]]:
613
+ ) -> Iterator[Configuration]:
518
614
 
519
615
  fixed_mask, value_mask = hypercube
520
616
  free_indices = [
@@ -534,11 +630,27 @@ def _iter_hypercube_configurations(
534
630
  yield configuration
535
631
 
536
632
 
633
+ def _iter_hypercube_configuration_bits(
634
+ hypercube: _EncodedHypercube,
635
+ n_components: int,
636
+ ) -> Iterator[int]:
637
+
638
+ fixed_mask, value_mask = hypercube
639
+ free_mask = ((1 << n_components) - 1) ^ fixed_mask
640
+ free_values = free_mask
641
+
642
+ while True:
643
+ yield value_mask | free_values
644
+ if free_values == 0:
645
+ break
646
+ free_values = (free_values - 1) & free_mask
647
+
648
+
537
649
  def _configuration_at_index(
538
650
  hypercube: _EncodedHypercube,
539
651
  components: Sequence[str],
540
652
  index: int,
541
- ) -> Dict[str, int]:
653
+ ) -> Configuration:
542
654
 
543
655
  fixed_mask, value_mask = hypercube
544
656
  configuration = {}
@@ -695,4 +807,7 @@ def _component_values(
695
807
 
696
808
  def _bit_count(mask: int) -> int:
697
809
 
810
+ if _INT_BIT_COUNT is not None:
811
+ return _INT_BIT_COUNT(mask)
812
+
698
813
  return bin(mask).count("1")