mapFolding 0.17.1__py3-none-any.whl → 0.18.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. easyRun/NOTcountingFolds.py +7 -11
  2. easyRun/countFolds.py +11 -10
  3. easyRun/meanders.py +6 -8
  4. mapFolding/__init__.py +24 -36
  5. mapFolding/_e/Z0Z_analysisPython/SORTZ0Z_hypothesis.py +189 -0
  6. mapFolding/_e/Z0Z_analysisPython/SORTZ0Z_p2d6.py +143 -0
  7. mapFolding/_e/Z0Z_analysisPython/__init__.py +4 -0
  8. mapFolding/_e/Z0Z_analysisPython/exclusionData/__init__.py +0 -0
  9. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/270/200.py +369 -0
  10. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/270/2001.py +694 -0
  11. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/270/200/344/270/211.py +514 -0
  12. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/270/200/344/270/2111.py +480 -0
  13. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/270/200/344/272/214.py +511 -0
  14. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/270/200/344/272/2141.py +515 -0
  15. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/270/200/344/272/214/344/270/211.py +485 -0
  16. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/270/200/344/272/214/344/270/2111.py +442 -0
  17. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/270/211.py +313 -0
  18. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/270/2111.py +343 -0
  19. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/272/214.py +400 -0
  20. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/272/2141.py +497 -0
  21. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/272/214/344/270/211.py +463 -0
  22. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/344/272/214/344/270/2111.py +441 -0
  23. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266.py +35 -0
  24. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/2661.py +35 -0
  25. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/270/200.py +382 -0
  26. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/270/2001.py +630 -0
  27. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/270/200/344/270/211.py +488 -0
  28. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/270/200/344/270/2111.py +475 -0
  29. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/270/200/344/272/214.py +473 -0
  30. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/270/200/344/272/2141.py +500 -0
  31. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/270/200/344/272/214/344/270/211.py +465 -0
  32. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/270/200/344/272/214/344/270/2111.py +439 -0
  33. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/270/211.py +599 -0
  34. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/270/2111.py +536 -0
  35. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/272/214.py +506 -0
  36. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/272/2141.py +533 -0
  37. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/272/214/344/270/211.py +489 -0
  38. mapFolding/_e/Z0Z_analysisPython/exclusionData/aggregated/351/246/226/351/233/266/344/272/214/344/270/2111.py +474 -0
  39. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200.py +1186 -0
  40. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/2001.py +2158 -0
  41. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/2001Negative.py +2158 -0
  42. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200Negative.py +1186 -0
  43. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/270/211.py +1397 -0
  44. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/270/2111.py +1291 -0
  45. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/270/2111Negative.py +1291 -0
  46. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/270/211Negative.py +1397 -0
  47. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/272/214.py +1240 -0
  48. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/272/2141.py +1420 -0
  49. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/272/2141Negative.py +1420 -0
  50. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/272/214Negative.py +1240 -0
  51. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/272/214/344/270/211.py +1366 -0
  52. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/272/214/344/270/2111.py +1274 -0
  53. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/272/214/344/270/2111Negative.py +1274 -0
  54. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/200/344/272/214/344/270/211Negative.py +1366 -0
  55. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/211.py +1186 -0
  56. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/2111.py +1186 -0
  57. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/2111Negative.py +1186 -0
  58. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/270/211Negative.py +1186 -0
  59. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/272/214.py +1102 -0
  60. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/272/2141.py +1422 -0
  61. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/272/2141Negative.py +1422 -0
  62. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/272/214Negative.py +1102 -0
  63. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/272/214/344/270/211.py +1240 -0
  64. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/272/214/344/270/2111.py +1228 -0
  65. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/272/214/344/270/2111Negative.py +1228 -0
  66. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/344/272/214/344/270/211Negative.py +1240 -0
  67. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266.py +32 -0
  68. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/2661.py +1162 -0
  69. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/2661Negative.py +1162 -0
  70. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266Negative.py +32 -0
  71. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200.py +1186 -0
  72. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/2001.py +1926 -0
  73. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/2001Negative.py +1926 -0
  74. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200Negative.py +1186 -0
  75. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/270/211.py +1291 -0
  76. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/270/2111.py +1176 -0
  77. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/270/2111Negative.py +1176 -0
  78. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/270/211Negative.py +1291 -0
  79. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/272/214.py +1228 -0
  80. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/272/2141.py +1324 -0
  81. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/272/2141Negative.py +1324 -0
  82. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/272/214Negative.py +1228 -0
  83. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/272/214/344/270/211.py +1274 -0
  84. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/272/214/344/270/2111.py +1038 -0
  85. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/272/214/344/270/2111Negative.py +1038 -0
  86. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/200/344/272/214/344/270/211Negative.py +1274 -0
  87. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/211.py +2158 -0
  88. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/2111.py +1926 -0
  89. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/2111Negative.py +1926 -0
  90. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/270/211Negative.py +2158 -0
  91. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/272/214.py +1422 -0
  92. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/272/2141.py +1364 -0
  93. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/272/2141Negative.py +1364 -0
  94. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/272/214Negative.py +1422 -0
  95. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/272/214/344/270/211.py +1420 -0
  96. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/272/214/344/270/2111.py +1324 -0
  97. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/272/214/344/270/2111Negative.py +1324 -0
  98. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d5/351/246/226/351/233/266/344/272/214/344/270/211Negative.py +1420 -0
  99. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200.py +3133 -0
  100. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/2001.py +6039 -0
  101. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/2001Negative.py +6039 -0
  102. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200Negative.py +3133 -0
  103. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/270/211.py +3527 -0
  104. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/270/2111.py +2300 -0
  105. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/270/2111Negative.py +2300 -0
  106. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/270/211Negative.py +3527 -0
  107. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/272/214.py +3597 -0
  108. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/272/2141.py +3317 -0
  109. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/272/2141Negative.py +3317 -0
  110. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/272/214Negative.py +3597 -0
  111. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/272/214/344/270/211.py +3161 -0
  112. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/272/214/344/270/2111.py +2877 -0
  113. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/272/214/344/270/2111Negative.py +2877 -0
  114. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/200/344/272/214/344/270/211Negative.py +3161 -0
  115. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/211.py +2981 -0
  116. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/2111.py +3055 -0
  117. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/2111Negative.py +3055 -0
  118. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/270/211Negative.py +2981 -0
  119. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/272/214.py +3221 -0
  120. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/272/2141.py +3988 -0
  121. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/272/2141Negative.py +3988 -0
  122. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/272/214Negative.py +3221 -0
  123. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/272/214/344/270/211.py +3652 -0
  124. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/272/214/344/270/2111.py +2863 -0
  125. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/272/214/344/270/2111Negative.py +2863 -0
  126. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/344/272/214/344/270/211Negative.py +3652 -0
  127. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200.py +2485 -0
  128. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/2001.py +4566 -0
  129. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/2001Negative.py +4566 -0
  130. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200Negative.py +2485 -0
  131. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/270/211.py +3006 -0
  132. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/270/2111.py +2485 -0
  133. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/270/2111Negative.py +2485 -0
  134. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/270/211Negative.py +3006 -0
  135. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/272/214.py +3304 -0
  136. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/272/2141.py +3015 -0
  137. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/272/2141Negative.py +3015 -0
  138. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/272/214Negative.py +3304 -0
  139. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/272/214/344/270/211.py +2939 -0
  140. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/272/214/344/270/2111.py +2589 -0
  141. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/272/214/344/270/2111Negative.py +2589 -0
  142. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/200/344/272/214/344/270/211Negative.py +2939 -0
  143. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/211.py +3899 -0
  144. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/2111.py +2996 -0
  145. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/2111Negative.py +2996 -0
  146. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/270/211Negative.py +3899 -0
  147. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/272/214.py +3223 -0
  148. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/272/2141.py +3020 -0
  149. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/272/2141Negative.py +3020 -0
  150. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/272/214Negative.py +3223 -0
  151. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/272/214/344/270/211.py +3250 -0
  152. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/272/214/344/270/2111.py +2667 -0
  153. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/272/214/344/270/2111Negative.py +2667 -0
  154. mapFolding/_e/Z0Z_analysisPython/exclusionData/collatedp2d6/351/246/226/351/233/266/344/272/214/344/270/211Negative.py +3250 -0
  155. mapFolding/_e/Z0Z_analysisPython/measure.py +162 -0
  156. mapFolding/_e/Z0Z_analysisPython/positionAnalysis.py +403 -0
  157. mapFolding/_e/Z0Z_analysisPython/positionAnalysisPileRanges2d6.py +110 -0
  158. mapFolding/_e/Z0Z_analysisPython/theExcluderBeast.py +640 -0
  159. mapFolding/_e/Z0Z_analysisPython/toolkit.py +166 -0
  160. mapFolding/_e/Z0Z_analysisPython/toolkitCSVsequences.py +188 -0
  161. mapFolding/_e/Z0Z_analysisPython/workBenchPatternFinder.py +284 -0
  162. mapFolding/_e/Z0Z_notes/__init__.py +0 -0
  163. mapFolding/_e/Z0Z_notes/knowledgeDump.py +214 -0
  164. mapFolding/_e/__init__.py +45 -0
  165. mapFolding/_e/_beDRY.py +547 -0
  166. mapFolding/_e/_dataDynamic.py +1164 -0
  167. mapFolding/_e/_measure.py +579 -0
  168. mapFolding/_e/_semiotics.py +363 -0
  169. mapFolding/_e/_theTypes.py +31 -0
  170. mapFolding/_e/algorithms/__init__.py +1 -0
  171. mapFolding/_e/algorithms/constraintPropagation.py +158 -0
  172. mapFolding/_e/algorithms/elimination.py +118 -0
  173. mapFolding/_e/algorithms/eliminationCrease.py +66 -0
  174. mapFolding/_e/algorithms/iff.py +584 -0
  175. mapFolding/_e/basecamp.py +89 -0
  176. mapFolding/_e/dataBaskets.py +123 -0
  177. mapFolding/_e/dataRaw/__init__.py +0 -0
  178. mapFolding/_e/easyRun/__init__.py +0 -0
  179. mapFolding/_e/easyRun/eliminateFolds.py +72 -0
  180. mapFolding/_e/easyRun/pinning.py +62 -0
  181. mapFolding/_e/filters.py +384 -0
  182. mapFolding/_e/pin2/344/270/212nDimensions.py +882 -0
  183. mapFolding/_e/pin2/344/270/212nDimensionsAnnex.py +551 -0
  184. mapFolding/_e/pin2/344/270/212nDimensionsByCrease.py +190 -0
  185. mapFolding/_e/pin2/344/270/212nDimensionsByDomain.py +459 -0
  186. mapFolding/_e/pinIt.py +436 -0
  187. mapFolding/_semiotics.py +42 -0
  188. mapFolding/_theSSOT.py +11 -56
  189. mapFolding/_theTypes.py +52 -67
  190. mapFolding/algorithms/matrixMeandersNumPyndas.py +18 -18
  191. mapFolding/algorithms/oeisIDbyFormula.py +4 -4
  192. mapFolding/algorithms/zCuzDocStoopidoeisIDbyFormula.py +3 -3
  193. mapFolding/basecamp.py +11 -80
  194. mapFolding/beDRY.py +107 -111
  195. mapFolding/dataBaskets.py +0 -56
  196. mapFolding/filesystemToolkit.py +15 -11
  197. mapFolding/oeis.py +17 -16
  198. mapFolding/reference/matrixMeandersAnalysis/prefixNotationNotes.py +2 -2
  199. mapFolding/reference/meandersDumpingGround/matrixMeandersBaselineV2.py +0 -1
  200. mapFolding/reference/meandersDumpingGround/matrixMeandersNumPyV1finalForm.py +8 -10
  201. mapFolding/someAssemblyRequired/RecipeJob.py +5 -5
  202. mapFolding/someAssemblyRequired/makeJobTheorem2Numba.py +5 -2
  203. mapFolding/someAssemblyRequired/makeJobTheorem2codon.py +9 -11
  204. mapFolding/someAssemblyRequired/mapFoldingModules/makeMapFoldingModules.py +2 -1
  205. mapFolding/someAssemblyRequired/transformationTools.py +1 -1
  206. mapFolding/tests/Z0Z_test_e_excluder.py +155 -0
  207. mapFolding/tests/conftest.py +193 -314
  208. mapFolding/tests/dataSamples/A001417.py +455 -0
  209. mapFolding/tests/dataSamples/__init__.py +1 -0
  210. mapFolding/tests/dataSamples/measurementData.py +1818 -0
  211. mapFolding/tests/dataSamples/p2DnDomain3_2_/351/246/226/344/270/200_/351/246/226/351/233/266/344/270/200.py +17 -0
  212. mapFolding/tests/dataSamples/p2DnDomain3_/351/246/226/344/270/200.py +17 -0
  213. mapFolding/tests/dataSamples/p2DnDomain5_4.py +17 -0
  214. mapFolding/tests/dataSamples/p2DnDomain6_5.py +17 -0
  215. mapFolding/tests/dataSamples/p2DnDomain6_7_5_4.py +17 -0
  216. mapFolding/tests/dataSamples/p2DnDomain7_6.py +17 -0
  217. mapFolding/tests/dataSamples/p2DnDomain/351/246/226/344/272/214_/351/246/226/351/233/266/344/270/200/344/272/214.py +17 -0
  218. mapFolding/tests/dataSamples/p2DnDomain/351/246/226/344/272/214_/351/246/226/351/233/266/344/272/214_/351/246/226/351/233/266/344/270/200/344/272/214_/351/246/226/344/270/200/344/272/214.py +17 -0
  219. mapFolding/tests/dataSamples/p2DnDomain/351/246/226/351/233/266/344/270/200/344/272/214_/351/246/226/344/270/200/344/272/214.py +15 -0
  220. mapFolding/tests/dataSamples/p2DnDomain/351/246/226/351/233/266/344/272/214_/351/246/226/344/272/214.py +15 -0
  221. mapFolding/tests/dataSamples/semioticsData.py +135 -0
  222. mapFolding/tests/test_computations.py +134 -80
  223. mapFolding/tests/test_e_computations.py +42 -0
  224. mapFolding/tests/test_e_dataDynamic.py +189 -0
  225. mapFolding/tests/test_e_measurements.py +257 -0
  226. mapFolding/tests/test_e_pinning.py +61 -0
  227. mapFolding/tests/test_e_semiotics.py +128 -0
  228. mapFolding/tests/test_filesystem.py +39 -17
  229. mapFolding/tests/{test_other.py → test_parameterValidation.py} +3 -3
  230. mapFolding/tests/{test_tasks.py → test_taskDivisions.py} +42 -23
  231. mapFolding/zCuzDocStoopid/makeDocstrings.py +3 -2
  232. {mapfolding-0.17.1.dist-info → mapfolding-0.18.0.dist-info}/METADATA +11 -8
  233. mapfolding-0.18.0.dist-info/RECORD +305 -0
  234. {mapfolding-0.17.1.dist-info → mapfolding-0.18.0.dist-info}/WHEEL +1 -1
  235. easyRun/eliminateFolds.py +0 -60
  236. mapFolding/algorithms/constraintPropagation.py +0 -184
  237. mapFolding/algorithms/elimination.py +0 -131
  238. mapFolding/algorithms/eliminationCount.py +0 -26
  239. mapFolding/algorithms/eliminationPinned.py +0 -35
  240. mapFolding/algorithms/iff.py +0 -206
  241. mapFolding/algorithms/patternFinder.py +0 -280
  242. mapFolding/algorithms/pinning2Dn.py +0 -345
  243. mapFolding/algorithms/pinning2DnAnnex.py +0 -43
  244. mapFolding/tests/verify.py +0 -323
  245. mapfolding-0.17.1.dist-info/RECORD +0 -112
  246. {mapfolding-0.17.1.dist-info → mapfolding-0.18.0.dist-info}/entry_points.txt +0 -0
  247. {mapfolding-0.17.1.dist-info → mapfolding-0.18.0.dist-info}/licenses/LICENSE +0 -0
  248. {mapfolding-0.17.1.dist-info → mapfolding-0.18.0.dist-info}/top_level.txt +0 -0
mapFolding/_e/pinIt.py ADDED
@@ -0,0 +1,436 @@
1
+ """Generalized pinning functions in the "Elimination" algorithm for any `mapShape`.
2
+
3
+ Functions for 2^n-dimensional maps must go in other modules.
4
+
5
+ The development of this generalized module is severely hampered, however. Functions for 2^n-dimensional maps have a "beans and
6
+ cornbread" problem that was difficult for me to "solve"--due to my programming skills. If I were able to decouple the "beans and
7
+ cornbread" solution from the 2^n-dimensional functions, I would generalize more functions and move them here.
8
+ """
9
+ from collections.abc import Callable, Iterable, Iterator
10
+ from cytoolz.dicttoolz import assoc as associate
11
+ from cytoolz.functoolz import compose, curry as syntacticCurry
12
+ from cytoolz.itertoolz import groupby as toolz_groupby
13
+ from functools import partial
14
+ from gmpy2 import bit_mask
15
+ from hunterMakesPy import raiseIfNone
16
+ from itertools import repeat
17
+ from mapFolding import inclusive
18
+ from mapFolding._e import (
19
+ DOTgetPileIfLeaf, DOTgetPileIfPileRangeOfLeaves, DOTvalues, Folding, getLeafDomain, getPileRange, Leaf,
20
+ PermutationSpace, Pile, PileRangeOfLeaves)
21
+ from mapFolding._e.dataBaskets import EliminationState
22
+ from mapFolding._e.filters import (
23
+ between, extractPinnedLeaves, leafIsInPileRange, leafIsNotPinned, leafIsPinned, leafIsPinnedAtPile, pileIsNotOpen,
24
+ pileIsOpen, thisIsALeaf)
25
+ from more_itertools import flatten, ilen
26
+ from operator import getitem
27
+
28
+ #======== Boolean filters =======================
29
+
30
+ @syntacticCurry
31
+ def atPilePinLeafSafetyFilter(permutationSpace: PermutationSpace, pile: Pile, leaf: Leaf) -> bool:
32
+ """Return `True` if it is safe to call `atPilePinLeaf(permutationSpace, pile, leaf)`.
33
+
34
+ For performance, you probably can and probably *should* create a set of filters for your circumstances.
35
+
36
+ Parameters
37
+ ----------
38
+ permutationSpace : PermutationSpace
39
+ A mapping of each `pile` with a pinned `leaf`.
40
+ pile : int
41
+ `pile` at which to pin.
42
+ leaf : int
43
+ `leaf` to pin.
44
+
45
+ Returns
46
+ -------
47
+ isSafeToPin : bool
48
+ True if it is safe to pin `leaf` at `pile` in `permutationSpace`.
49
+ """
50
+ return leafIsPinnedAtPile(permutationSpace, leaf, pile) or (pileIsOpen(permutationSpace, pile) and leafIsNotPinned(permutationSpace, leaf))
51
+
52
+ @syntacticCurry
53
+ def disqualifyAppendingLeafAtPile(state: EliminationState, leaf: Leaf) -> bool:
54
+ return any([state.pile not in getLeafDomain(state, leaf), leafIsPinned(state.permutationSpace, leaf), pileIsNotOpen(state.permutationSpace, state.pile)])
55
+
56
+ #======== Group by =======================
57
+
58
+ def _segregateLeafPinnedAtPile(listPermutationSpace: list[PermutationSpace], leaf: Leaf, pile: Pile) -> tuple[list[PermutationSpace], list[PermutationSpace]]:
59
+ """Partition `listPermutationSpace` into (notPinned, isPinned) groups for `leaf` pinned at `pile`.
60
+
61
+ Parameters
62
+ ----------
63
+ listPermutationSpace : list[PermutationSpace]
64
+ Collection of partial folding dictionaries.
65
+ leaf : int
66
+ `leaf` to test.
67
+ pile : int
68
+ `pile` index.
69
+
70
+ Returns
71
+ -------
72
+ segregatedLists : tuple[list[PermutationSpace], list[PermutationSpace]]
73
+ First element: dictionaries where `leaf` is NOT pinned at `pile`.
74
+ Second element: dictionaries where `leaf` IS pinned at `pile`.
75
+ """
76
+ isPinned: Callable[[PermutationSpace], bool] = leafIsPinnedAtPile(leaf=leaf, pile=pile)
77
+ grouped: dict[bool, list[PermutationSpace]] = toolz_groupby(isPinned, listPermutationSpace)
78
+ return (grouped.get(False, []), grouped.get(True, []))
79
+
80
+ def moveFoldingToListFolding(state: EliminationState) -> EliminationState:
81
+ listPermutationSpace: list[PermutationSpace] = state.listPermutationSpace.copy()
82
+ state.listPermutationSpace = []
83
+ for permutationSpace in listPermutationSpace:
84
+ if any(map(leafIsNotPinned(permutationSpace), range(state.leavesTotal))):
85
+ state.listPermutationSpace.append(permutationSpace)
86
+ else:
87
+ folding: Folding = makeFolding(permutationSpace, ())
88
+ state.listFolding.append(folding)
89
+ return state
90
+
91
+ #======== Pin a `leaf` in a `PermutationSpace` or `Folding` =======================
92
+ # NOTE This section ought to contain all functions based on the "Elimination" algorithm that pin a `leaf` in a `PermutationSpace` or `Folding`.
93
+
94
+ @syntacticCurry
95
+ def atPilePinLeaf(permutationSpace: PermutationSpace, pile: Pile, leaf: Leaf) -> PermutationSpace:
96
+ """Return a new `PermutationSpace` with `leaf` pinned at `pile` without modifying `permutationSpace`.
97
+
98
+ Warning
99
+ -------
100
+ This function assumes either 1. `leaf` is not pinned and `pile` is open or 2. `leaf` is pinned at `pile`. Overwriting a
101
+ different `leaf` pinned at `pile` corrupts the permutation space.
102
+
103
+ Parameters
104
+ ----------
105
+ permutationSpace : PermutationSpace
106
+ Dictionary of `pile` with pinned `leaf` or pile-range of leaves, if a `leaf` is pinned at `pile` or the pile-range of
107
+ leaves is defined.
108
+ pile : int
109
+ `pile` at which to pin `leaf`.
110
+ leaf : int
111
+ `leaf` to pin.
112
+
113
+ Returns
114
+ -------
115
+ dictionaryPermutationSpace : PermutationSpace
116
+ New dictionary with `pile` mapped to `leaf`.
117
+
118
+ See Also
119
+ --------
120
+ deconstructPermutationSpaceAtPile
121
+ """
122
+ return associate(permutationSpace, pile, leaf)
123
+
124
+ # TODO more flexible.
125
+ def makeFolding(permutationSpace: PermutationSpace, leavesToInsert: tuple[Leaf, ...]) -> Folding:
126
+ if leavesToInsert:
127
+ permutand: Iterator[Leaf] = iter(leavesToInsert)
128
+ pilesTotal: int = ilen(filter(thisIsALeaf, DOTvalues(permutationSpace))) + len(leavesToInsert)
129
+ # pilesTotal: int = len(extractPinnedLeaves(permutationSpace)) + len(leavesToInsert) # noqa: ERA001
130
+ folding: Folding = tuple([
131
+ leafOrLeafRange if (leafOrLeafRange := DOTgetPileIfLeaf(permutationSpace, pile)) else next(permutand)
132
+ for pile in range(pilesTotal)
133
+ ])
134
+ else:
135
+ folding = tuple(DOTvalues(extractPinnedLeaves(permutationSpace)))
136
+ return folding
137
+
138
+ #======== Deconstruct a `PermutationSpace` dictionary =======
139
+ def deconstructPermutationSpaceAtPile(permutationSpace: PermutationSpace, pile: Pile, leavesToPin: Iterable[Leaf]) -> dict[Leaf, PermutationSpace]:
140
+ """Deconstruct an open `pile` to the `leaf` range of `pile`.
141
+
142
+ Return a dictionary of `PermutationSpace` with either `permutationSpace` because it already has a `leaf` pinned at `pile` or one
143
+ `PermutationSpace` for each `leaf` in `leavesToPin` pinned at `pile`.
144
+
145
+ Parameters
146
+ ----------
147
+ permutationSpace : PermutationSpace
148
+ Dictionary to divide and replace.
149
+ pile : int
150
+ `pile` at which to pin a `leaf`.
151
+ leavesToPin : list[int]
152
+ List of `leaves` to pin at `pile`.
153
+
154
+ Returns
155
+ -------
156
+ deconstructedPermutationSpace : dict[int, PermutationSpace]
157
+ Dictionary mapping from `leaf` pinned at `pile` to the `PermutationSpace` dictionary with the `leaf` pinned at `pile`.
158
+ """
159
+ if (leaf := DOTgetPileIfLeaf(permutationSpace, pile)):
160
+ deconstructedPermutationSpace: dict[Leaf, PermutationSpace] = {leaf: permutationSpace}
161
+ else:
162
+ pin: Callable[[Leaf], PermutationSpace] = atPilePinLeaf(permutationSpace, pile)
163
+ leafCanBePinned: Callable[[Leaf], bool] = leafIsNotPinned(permutationSpace)
164
+ deconstructedPermutationSpace = {leaf: pin(leaf) for leaf in filter(leafCanBePinned, leavesToPin)}
165
+ return deconstructedPermutationSpace
166
+
167
+ def deconstructPermutationSpaceByDomainOfLeaf(permutationSpace: PermutationSpace, leaf: Leaf, leafDomain: Iterable[Pile]) -> list[PermutationSpace]:
168
+ """Pin `leaf` at each open `pile` in the domain of `leaf`.
169
+
170
+ Return a `list` of `PermutationSpace` with either `permutationSpace` because `leaf` is already pinned or one `PermutationSpace` for each
171
+ open `pile` in `leafDomain` with `leaf` pinned at `pile`.
172
+
173
+ Parameters
174
+ ----------
175
+ permutationSpace : PermutationSpace
176
+ Dictionary to divide and replace.
177
+ leaf : int
178
+ `leaf` to pin.
179
+ leafDomain : Iterable[int]
180
+ Domain of `pile` indices for `leaf`.
181
+
182
+ Returns
183
+ -------
184
+ deconstructedPermutationSpace : list[PermutationSpace]
185
+ List of `PermutationSpace` dictionaries with `leaf` pinned at each open `pile` in `leafDomain`.
186
+ """
187
+ if leafIsNotPinned(permutationSpace, leaf):
188
+ pileOpen: Callable[[int], bool] = pileIsOpen(permutationSpace)
189
+ leafInPileRange: Callable[[int], bool] = compose(leafIsInPileRange(leaf), partial(DOTgetPileIfPileRangeOfLeaves, permutationSpace, default=bit_mask(len(permutationSpace))))
190
+ pinLeafAt: Callable[[int], PermutationSpace] = atPilePinLeaf(permutationSpace, leaf=leaf)
191
+ deconstructedPermutationSpace: list[PermutationSpace] = list(map(pinLeafAt, filter(leafInPileRange, filter(pileOpen, leafDomain))))
192
+ else:
193
+ deconstructedPermutationSpace = [permutationSpace]
194
+ return deconstructedPermutationSpace
195
+
196
+ def deconstructPermutationSpaceByDomainsCombined(permutationSpace: PermutationSpace, leaves: tuple[Leaf, ...], leavesDomain: Iterable[tuple[Pile, ...]]) -> list[PermutationSpace]:
197
+ """Prototype."""
198
+ deconstructedPermutationSpace: list[PermutationSpace] = []
199
+
200
+ def pileOpenByIndex(index: int) -> Callable[[tuple[Pile, ...]], bool]:
201
+ def workhorse(domain: tuple[Pile, ...]) -> bool:
202
+ return pileIsOpen(permutationSpace, domain[index])
203
+ return workhorse
204
+
205
+ def leafInPileRangeByIndex(index: int) -> Callable[[tuple[Pile, ...]], bool]:
206
+ def workhorse(domain: tuple[Pile, ...]) -> bool:
207
+ pileRangeOfLeaves: PileRangeOfLeaves = raiseIfNone(DOTgetPileIfPileRangeOfLeaves(permutationSpace, domain[index], default=bit_mask(len(permutationSpace))))
208
+ return leafIsInPileRange(leaves[index], pileRangeOfLeaves)
209
+ return workhorse
210
+
211
+ def isPinnedAtPileByIndex(leaf: Leaf, index: int) -> Callable[[tuple[Pile, ...]], bool]:
212
+ def workhorse(domain: tuple[Pile, ...]) -> bool:
213
+ return leafIsPinnedAtPile(permutationSpace, leaf, domain[index])
214
+ return workhorse
215
+
216
+ if any(map(leafIsNotPinned(permutationSpace), leaves)):
217
+ for index in range(len(leaves)):
218
+ """Redefine leavesDomain by filtering out domains that are not possible with the current `PermutationSpace`."""
219
+ if leafIsNotPinned(permutationSpace, leaves[index]):
220
+ """`leaves[index]` is not pinned, so it needs a pile.
221
+ In each iteration of `leavesDomain`, `listOfPiles`, the pile it needs is `listOfPiles[index]`.
222
+ Therefore, if `listOfPiles[index]` is open, filter in the iteration. If `listOfPiles[index]` is occupied, filter out the iteration."""
223
+ leavesDomain = filter(pileOpenByIndex(index), leavesDomain)
224
+ """`leaves[index]` is not pinned, it wants `listOfPiles[index]`, and `listOfPiles[index]` is open.
225
+ Is `leaves[index]` in the pile-range of `listOfPiles[index]`?"""
226
+ leavesDomain = filter(leafInPileRangeByIndex(index), leavesDomain)
227
+ else:
228
+ """`leaves[index]` is pinned.
229
+ In each iteration of `leavesDomain`, `listOfPiles`, the pile in which `leaves[index]` is pinned must match `listOfPiles[index]`.
230
+ Therefore, if the pile in which `leaves[index]` is pinned matches `listOfPiles[index]`, filter in the iteration. Otherwise, filter out the iteration."""
231
+ leavesDomain = filter(isPinnedAtPileByIndex(leaves[index], index), leavesDomain)
232
+
233
+ for listOfPiles in leavesDomain:
234
+ """Properly and safely deconstruct `permutationSpace` by the combined domain of leaves.
235
+ The parameter `leavesDomain` is the full domain of the leaves, so deconstructing with `leavesDomain` preserves the permutation space.
236
+ For each leaf in leaves, I filter out occupied piles, so I will not overwrite any pinned leaves--that would invalidate the permutation space.
237
+ I apply filters that prevent pinning the same leaf twice.
238
+ Therefore, for each domain in `leavesDomain`, I can safely pin `leaves[index]` at `listOfPiles[index]` without corrupting the permutation space."""
239
+ permutationSpaceForListOfPiles: PermutationSpace = permutationSpace.copy()
240
+ for index in range(len(leaves)):
241
+ permutationSpaceForListOfPiles = atPilePinLeaf(permutationSpaceForListOfPiles, listOfPiles[index], leaves[index])
242
+ deconstructedPermutationSpace.append(permutationSpaceForListOfPiles)
243
+ else:
244
+ deconstructedPermutationSpace = [permutationSpace]
245
+
246
+ return deconstructedPermutationSpace
247
+
248
+ #======== Bulk modifications =======================
249
+
250
+ def deconstructListPermutationSpaceAtPile(listPermutationSpace: Iterable[PermutationSpace], pile: Pile, leavesToPin: Iterable[Leaf]) -> Iterator[PermutationSpace]:
251
+ """Expand every dictionary in `listPermutationSpace` at `pile` into all pinning variants.
252
+
253
+ Applies `deconstructPermutationSpaceAtPile` element-wise, then flattens the nested value collections (each a mapping leaf -> dictionary)
254
+ into a single list of dictionaries, discarding the intermediate keyed structure.
255
+
256
+ Parameters
257
+ ----------
258
+ listPermutationSpace : Iterable[PermutationSpace]
259
+ Partial folding dictionaries.
260
+ pile : int
261
+ `pile` index to expand.
262
+ leavesToPin : Iterable[int]
263
+ `leaf` indices to pin at `pile`.
264
+
265
+ Returns
266
+ -------
267
+ listPermutationSpace : Iterator[PermutationSpace]
268
+ Flat iterator of expanded dictionaries covering all possible `leaf` assignments at `pile`.
269
+
270
+ See Also
271
+ --------
272
+ deconstructPermutationSpaceAtPile
273
+ """
274
+ return flatten(map(DOTvalues, map(deconstructPermutationSpaceAtPile, listPermutationSpace, repeat(pile), repeat(leavesToPin))))
275
+
276
+ def excludeLeaf_rBeforeLeaf_kAtPile_k(state: EliminationState, leaf_k: Leaf, leaf_r: Leaf, pile_k: Pile, domain_r: Iterable[Pile] | None = None, rangePile_k: Iterable[Leaf] | None = None) -> EliminationState:
277
+ """Exclude `leaf_r` from appearing before `leaf_k` at `pile_k`.
278
+
279
+ Parameters
280
+ ----------
281
+ state : EliminationState
282
+ Mutable elimination state (provides `leavesTotal`, `pileLast`).
283
+ leaf_k : int
284
+ Reference leaf index derived from `productOfDimensions` for a dimension.
285
+ leaf_r : int
286
+ Leaf that must not appear before `leaf_k` (also dimension-derived).
287
+ pile_k : int
288
+ Pile index currently under consideration for leaf `leaf_k`.
289
+ domain_r : Iterable[int] | None = None
290
+ Optional domain of piles for leaf `leaf_r`. If `None`, the full domain from `state` is used.
291
+ rangePile_k : Iterable[int] | None = None
292
+ Optional range of leaves for pile `pile_k`. If `None`, the full range from `state` is used.
293
+
294
+ Returns
295
+ -------
296
+ state : EliminationState
297
+ Same state instance, mutated with updated `listPermutationSpace`.
298
+
299
+ See Also
300
+ --------
301
+ excludeLeafRBeforeLeafK, theorem4, theorem2b
302
+ """
303
+ iterator_kPinnedAt_pile_k: Iterable[PermutationSpace] = []
304
+ iterable_pile_kOccupied: Iterable[PermutationSpace] = []
305
+ listPermutationSpace: list[PermutationSpace] = []
306
+ listPermutationSpaceCompleted: list[PermutationSpace] = []
307
+
308
+ pile_kIsOpen: Callable[[PermutationSpace], bool] = pileIsOpen(pile=pile_k)
309
+ kIsNotPinned: Callable[[PermutationSpace], bool] = leafIsNotPinned(leaf=leaf_k)
310
+ def notLeaf_r(comparand: Leaf, r: Leaf = leaf_r) -> bool:
311
+ return comparand != r
312
+
313
+ listPermutationSpace, iterator_kPinnedAt_pile_k = _segregateLeafPinnedAtPile(state.listPermutationSpace, leaf_k, pile_k)
314
+ state.listPermutationSpace = []
315
+
316
+ grouped: dict[bool, list[PermutationSpace]] = toolz_groupby(kIsNotPinned, listPermutationSpace)
317
+ listPermutationSpaceCompleted, listPermutationSpace = grouped.get(False, []), grouped.get(True, [])
318
+ grouped = toolz_groupby(pile_kIsOpen, listPermutationSpace)
319
+ iterable_pile_kOccupied, listPermutationSpace = grouped.get(False, []), grouped.get(True, [])
320
+ listPermutationSpaceCompleted.extend(iterable_pile_kOccupied)
321
+
322
+ if domain_r is None:
323
+ domain_r = getLeafDomain(state, leaf_r)
324
+
325
+ domain_r = filter(between(0, pile_k - inclusive), domain_r)
326
+
327
+ if rangePile_k is None:
328
+ rangePile_k = getPileRange(state, pile_k)
329
+
330
+ rangePile_k = frozenset(rangePile_k)
331
+
332
+ if leaf_k in rangePile_k:
333
+ for permutationSpace_kPinnedAt_pile_k, iterable_pile_kOccupied in segregateLeafByDeconstructingListPermutationSpaceAtPile(listPermutationSpace, leaf_k, pile_k, rangePile_k):
334
+ listPermutationSpaceCompleted.extend(iterable_pile_kOccupied)
335
+ iterator_kPinnedAt_pile_k.append(permutationSpace_kPinnedAt_pile_k)
336
+ else:
337
+ listPermutationSpaceCompleted.extend(listPermutationSpace)
338
+
339
+ for pile_r in domain_r:
340
+ iterator_kPinnedAt_pile_k = excludeLeafAtPile(iterator_kPinnedAt_pile_k, leaf_r, pile_r, tuple(filter(notLeaf_r, getPileRange(state, pile_r))))
341
+
342
+ state.listPermutationSpace.extend(listPermutationSpaceCompleted)
343
+ state.listPermutationSpace.extend(iterator_kPinnedAt_pile_k)
344
+
345
+ return state
346
+
347
+ def excludeLeaf_rBeforeLeaf_k(state: EliminationState, leaf_k: Leaf, leaf_r: Leaf, domain_k: Iterable[Pile] | None = None, domain_r: Iterable[Pile] | None = None) -> EliminationState:
348
+ """Exclude `leaf_r` from appearing before `leaf_k` in every `pile` in the domain of `leaf_k`.
349
+
350
+ Parameters
351
+ ----------
352
+ state : EliminationState
353
+ Data basket, state of the local context, and state of the global context.
354
+ leaf_k : int
355
+ `leaf` that must be in a `pile` preceding the `pile` of `leaf_r`.
356
+ leaf_r : int
357
+ `leaf` that must be in a `pile` succeeding the `pile` of `leaf_k`.
358
+ domain_k : Iterable[int] | None = None
359
+ The domain of each `pile` at which `leaf_k` can be pinned. If `None`, every `pile` is in the domain.
360
+ domain_r : Iterable[int] | None = None
361
+ The domain of each `pile` at which `leaf_r` can be pinned. If `None`, every `pile` is in the domain.
362
+
363
+ Returns
364
+ -------
365
+ EliminationState
366
+ Same state instance, mutated with updated `listPermutationSpace`.
367
+
368
+ See Also
369
+ --------
370
+ _excludeLeafRBeforeLeafK, theorem4, theorem2b
371
+ """
372
+ if domain_k is None:
373
+ domain_k = getLeafDomain(state, leaf_k)
374
+ for pile_k in reversed(tuple(domain_k)):
375
+ state = excludeLeaf_rBeforeLeaf_kAtPile_k(state, leaf_k, leaf_r, pile_k, domain_r=domain_r)
376
+ return state
377
+
378
+ def excludeLeafAtPile(listPermutationSpace: Iterable[PermutationSpace], leaf: Leaf, pile: Pile, leavesToPin: Iterable[Leaf]) -> Iterator[PermutationSpace]:
379
+ """Return a new list of pinned-leaves dictionaries that forbid `leaf` at `pile`.
380
+
381
+ Parameters
382
+ ----------
383
+ listPermutationSpace : Iterable[PermutationSpace]
384
+ Collection of partial pinning dictionaries to transform.
385
+ leaf : int
386
+ `leaf` to exclude from `pile`.
387
+ pile : int
388
+ `pile` at which `leaf` must not be fixed.
389
+ leavesToPin : Iterable[int]
390
+ List of leaves available for pinning at `pile`. Don't include `leaf`.
391
+
392
+ Returns
393
+ -------
394
+ listPermutationSpace : Iterable[PermutationSpace]
395
+ Expanded / filtered list respecting the exclusion constraint.
396
+
397
+ See Also
398
+ --------
399
+ deconstructPermutationSpaceAtPile : Performs the expansion for one dictionary.
400
+ requireLeafPinnedAtPile : Complementary operation that forces a `leaf` at a `pile`.
401
+ """
402
+ return deconstructListPermutationSpaceAtPile(getitem(_segregateLeafPinnedAtPile(list(listPermutationSpace), leaf, pile), 0), pile, leavesToPin)
403
+
404
+ def requireLeafPinnedAtPile(listPermutationSpace: list[PermutationSpace], leaf: Leaf, pile: Pile) -> list[PermutationSpace]:
405
+ """In every `PermutationSpace` dictionary, ensure `leaf`, and *only* `leaf`, is pinned at `pile`: excluding every other `leaf` at `pile`.
406
+
407
+ Parameters
408
+ ----------
409
+ listPermutationSpace : list[PermutationSpace]
410
+ Collection of partial pinning dictionaries to transform.
411
+ leaf : int
412
+ `leaf` required at `pile`.
413
+ pile : int
414
+ `pile` at which to pin the leaf.
415
+
416
+ Returns
417
+ -------
418
+ listLeafAtPile : list[PermutationSpace]
419
+ `list` of `PermutationSpace` dictionaries with `leaf` pinned at `pile`.
420
+
421
+ See Also
422
+ --------
423
+ deconstructPermutationSpaceAtPile, excludeLeafAtPile
424
+ """
425
+ listPermutationSpace, listLeafAtPile = _segregateLeafPinnedAtPile(listPermutationSpace, leaf, pile)
426
+ listLeafAtPile.extend(map(atPilePinLeaf(pile=pile, leaf=leaf), filter(pileIsOpen(pile=pile), filter(leafIsNotPinned(leaf=leaf), listPermutationSpace))))
427
+ return listLeafAtPile
428
+
429
+ def segregateLeafByDeconstructingListPermutationSpaceAtPile(listPermutationSpace: Iterable[PermutationSpace], leaf: Leaf, pile: Pile, leavesToPin: Iterable[Leaf]) -> Iterator[tuple[PermutationSpace, tuple[PermutationSpace, ...]]]:
430
+ for permutationSpace in listPermutationSpace:
431
+ deconstructedPermutationSpaceAtPile: dict[Leaf, PermutationSpace] = deconstructPermutationSpaceAtPile(permutationSpace, pile, leavesToPin)
432
+ leafPinnedAtPile: PermutationSpace = deconstructedPermutationSpaceAtPile.pop(leaf)
433
+ yield (leafPinnedAtPile, tuple(deconstructedPermutationSpaceAtPile.values()))
434
+
435
+
436
+
@@ -0,0 +1,42 @@
1
+ from typing import NamedTuple
2
+
3
+ #======== Semantic replacements for ambiguous values =======
4
+
5
+ decreasing: int = -1
6
+ """Adjust the value due to Python syntax."""
7
+ inclusive: int = 1
8
+ """Include the last value in a `range`: change from [p, q) to [p, q]."""
9
+ zeroIndexed: int = 1
10
+ """Adjust the value due to Python syntax."""
11
+
12
+ #-------- Some color for printing text to the terminal -------
13
+ # Many values and options at https://gist.github.com/JBlond/2fea43a3049b38287e5e9cefc87b2124
14
+ # Many, many, many at https://stackoverflow.com/a/33206814/4403878
15
+ # NOTE Always define color and background color at the same time.
16
+
17
+ ansiColorReset: str = '\x1b[0m'
18
+
19
+ class AnsiColors(NamedTuple):
20
+ BlackOnCyan: str = '\x1b[30;46m'
21
+ BlackOnMagenta: str = '\x1b[30;45m'
22
+ BlackOnWhite: str = '\x1b[30;47m'
23
+ BlackOnYellow: str = '\x1b[30;43m'
24
+ BlueOnWhite: str = '\x1b[34;47m'
25
+ BlueOnYellow: str = '\x1b[34;43m'
26
+ CyanOnBlack: str = '\x1b[36;40m'
27
+ CyanOnBlue: str = '\x1b[36;44m'
28
+ CyanOnMagenta: str = '\x1b[36;45m'
29
+ GreenOnBlack: str = '\x1b[32;40m'
30
+ MagentaOnBlack: str = '\x1b[35;40m'
31
+ MagentaOnBlue: str = '\x1b[35;44m'
32
+ MagentaOnCyan: str = '\x1b[35;46m'
33
+ RedOnWhite: str = '\x1b[31;47m'
34
+ WhiteOnBlack: str = '\x1b[37;40m'
35
+ WhiteOnBlue: str = '\x1b[37;44m'
36
+ WhiteOnMagenta: str = '\x1b[37;45m'
37
+ WhiteOnRed: str = '\x1b[37;41m'
38
+ YellowOnBlack: str = '\x1b[33;40m'
39
+ YellowOnBlue: str = '\x1b[33;44m'
40
+ YellowOnRed: str = '\x1b[33;41m'
41
+
42
+ ansiColors = AnsiColors()
mapFolding/_theSSOT.py CHANGED
@@ -1,10 +1,10 @@
1
1
  """Access and configure package settings and metadata."""
2
2
 
3
3
  from hunterMakesPy import PackageSettings
4
- from mapFolding._theTypes import MetadataOEISidManuallySet, MetadataOEISidMapFoldingManuallySet
4
+ from mapFolding import MetadataOEISidManuallySet, MetadataOEISidMapFoldingManuallySet
5
+ from more_itertools import loops
5
6
  from pathlib import Path
6
7
  import dataclasses
7
- import random
8
8
 
9
9
  @dataclasses.dataclass
10
10
  class mapFoldingPackageSettings(PackageSettings):
@@ -42,45 +42,14 @@ class mapFoldingPackageSettings(PackageSettings):
42
42
 
43
43
  concurrencyPackage: str = 'multiprocessing'
44
44
  """Package identifier for concurrent execution operations."""
45
- # ruff: noqa: S311
46
45
  # TODO I made this a `TypedDict` before I knew how to make dataclasses and classes. Think about other data structures.
47
46
  OEISidMapFoldingManuallySet: dict[str, MetadataOEISidMapFoldingManuallySet] = {
48
- 'A000136': {
49
- 'getMapShape': lambda n: (1, n),
50
- 'valuesBenchmark': [14],
51
- 'valuesTestParallelization': [random.randint(3, 7)],
52
- 'valuesTestValidation': [random.randint(2, 9)],
53
- },
54
- 'A001415': {
55
- 'getMapShape': lambda n: (2, n),
56
- 'valuesBenchmark': [14],
57
- 'valuesTestParallelization': [random.randint(3, 7)],
58
- 'valuesTestValidation': [random.randint(2, 9)],
59
- },
60
- 'A001416': {
61
- 'getMapShape': lambda n: (3, n),
62
- 'valuesBenchmark': [9],
63
- 'valuesTestParallelization': [random.randint(3, 5)],
64
- 'valuesTestValidation': [random.randint(2, 6)],
65
- },
66
- 'A001417': {
67
- 'getMapShape': lambda n: tuple(2 for _dimension in range(n)),
68
- 'valuesBenchmark': [6],
69
- 'valuesTestParallelization': [random.randint(2, 4)],
70
- 'valuesTestValidation': [random.randint(2, 4)],
71
- },
72
- 'A195646': {
73
- 'getMapShape': lambda n: tuple(3 for _dimension in range(n)),
74
- 'valuesBenchmark': [3],
75
- 'valuesTestParallelization': [2],
76
- 'valuesTestValidation': [2],
77
- },
78
- 'A001418': {
79
- 'getMapShape': lambda n: (n, n),
80
- 'valuesBenchmark': [5],
81
- 'valuesTestParallelization': [*range(2, 4)],
82
- 'valuesTestValidation': [random.randint(2, 4)],
83
- },
47
+ 'A000136': {'getMapShape': lambda n: (1, n)},
48
+ 'A001415': {'getMapShape': lambda n: (2, n)},
49
+ 'A001416': {'getMapShape': lambda n: (3, n)},
50
+ 'A001417': {'getMapShape': lambda n: tuple(2 for _dimension in loops(n))},
51
+ 'A195646': {'getMapShape': lambda n: tuple(3 for _dimension in loops(n))},
52
+ 'A001418': {'getMapShape': lambda n: (n, n)},
84
53
  }
85
54
 
86
55
  identifierPackageFALLBACK = "mapFolding"
@@ -89,23 +58,9 @@ identifierPackageFALLBACK = "mapFolding"
89
58
  packageSettings = mapFoldingPackageSettings(identifierPackageFALLBACK=identifierPackageFALLBACK, OEISidMapFoldingManuallySet=OEISidMapFoldingManuallySet)
90
59
  """Global package settings."""
91
60
 
92
- OEISidManuallySet: dict[str, MetadataOEISidManuallySet] = {
93
- 'A000560': {'valuesTestValidation': [random.randint(3, 12)]},
94
- 'A000682': {'valuesTestValidation': [random.randint(3, 12), 32]},
95
- 'A001010': {'valuesTestValidation': [3, 4, random.randint(5, 11)]},
96
- 'A001011': {'valuesTestValidation': [3, 4, random.randint(5, 7)]},
97
- 'A005315': {'valuesTestValidation': [random.randint(3, 9)]},
98
- 'A005316': {'valuesTestValidation': [random.randint(3, 13)]},
99
- 'A007822': {'valuesTestValidation': [random.randint(2, 8)]}, #, 'valuesBenchmark': [7], 'valuesTestParallelization': [*range(2, 4)]},
100
- 'A060206': {'valuesTestValidation': [random.randint(3, 9)]},
101
- 'A077460': {'valuesTestValidation': [3, 4, random.randint(5, 8)]},
102
- 'A078591': {'valuesTestValidation': [random.randint(3, 10)]},
103
- 'A086345': {'valuesTestValidation': [random.randint(3, 10), random.randint(11, 20), random.randint(21, 30), random.randint(31, 40)]},
104
- 'A178961': {'valuesTestValidation': [random.randint(3, 11)]},
105
- 'A223094': {'valuesTestValidation': [random.randint(3, 11)]},
106
- 'A259702': {'valuesTestValidation': [random.randint(3, 13)]},
107
- 'A301620': {'valuesTestValidation': [random.randint(3, 11)]},
108
- }
61
+ OEISidManuallySet: dict[str, MetadataOEISidManuallySet] = {'A000560': {}, 'A000682': {}, 'A001010': {}, 'A001011': {},
62
+ 'A005315': {}, 'A005316': {}, 'A007822': {}, 'A060206': {}, 'A077460': {}, 'A078591': {},
63
+ 'A086345': {}, 'A178961': {}, 'A223094': {}, 'A259702': {}, 'A301620': {}}
109
64
 
110
65
  # Recreate packageSettings with meanders settings included
111
66
  packageSettings = mapFoldingPackageSettings(