downstream 0.4.2__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 (434) hide show
  1. downstream-0.4.2/LICENSE +21 -0
  2. downstream-0.4.2/PKG-INFO +106 -0
  3. downstream-0.4.2/README.md +59 -0
  4. downstream-0.4.2/downstream/__init__.py +15 -0
  5. downstream-0.4.2/downstream/downstream/__init__.py +4 -0
  6. downstream-0.4.2/downstream/genome_instrumentation/_BitSurface.py +2 -0
  7. downstream-0.4.2/downstream/genome_instrumentation/_StructSurface.py +2 -0
  8. downstream-0.4.2/downstream/genome_instrumentation/__init__.py +7 -0
  9. downstream-0.4.2/downstream/interop/__init__.py +23 -0
  10. downstream-0.4.2/downstream/interop/_make_stratum_retention_policy_from_site_selection_algo.py +278 -0
  11. downstream-0.4.2/downstream/interop/_stratum_retention_interop_hybrid_algo.py +14 -0
  12. downstream-0.4.2/downstream/interop/_stratum_retention_interop_steady_algo.py +14 -0
  13. downstream-0.4.2/downstream/interop/_stratum_retention_interop_tilted_algo.py +14 -0
  14. downstream-0.4.2/downstream/interop/_stratum_retention_interop_tilted_sticky_algo.py +14 -0
  15. downstream-0.4.2/downstream/pylib/Literal.py +4 -0
  16. downstream-0.4.2/downstream/pylib/__init__.py +69 -0
  17. downstream-0.4.2/downstream/pylib/bit_ceil.py +11 -0
  18. downstream-0.4.2/downstream/pylib/bit_count_immediate_zeros.py +10 -0
  19. downstream-0.4.2/downstream/pylib/bit_count_leading_ones.py +18 -0
  20. downstream-0.4.2/downstream/pylib/bit_decode_gray.py +8 -0
  21. downstream-0.4.2/downstream/pylib/bit_drop_msb.py +6 -0
  22. downstream-0.4.2/downstream/pylib/bit_encode_gray.py +7 -0
  23. downstream-0.4.2/downstream/pylib/bit_floor.py +8 -0
  24. downstream-0.4.2/downstream/pylib/bit_invert.py +7 -0
  25. downstream-0.4.2/downstream/pylib/bit_reverse.py +9 -0
  26. downstream-0.4.2/downstream/pylib/calc_dyadic_lcm_upper_bound.py +25 -0
  27. downstream-0.4.2/downstream/pylib/count_factors_of_2.py +19 -0
  28. downstream-0.4.2/downstream/pylib/enforce_typing.py +41 -0
  29. downstream-0.4.2/downstream/pylib/fast_pow2_divide.py +39 -0
  30. downstream-0.4.2/downstream/pylib/fast_pow2_mod.py +34 -0
  31. downstream-0.4.2/downstream/pylib/get_powersof2triangle_val_at_index.py +11 -0
  32. downstream-0.4.2/downstream/pylib/hanoi/__init__.py +33 -0
  33. downstream-0.4.2/downstream/pylib/hanoi/get_hanoi_value_at_index.py +10 -0
  34. downstream-0.4.2/downstream/pylib/hanoi/get_hanoi_value_incidence_at_index.py +11 -0
  35. downstream-0.4.2/downstream/pylib/hanoi/get_hanoi_value_index_cadence.py +4 -0
  36. downstream-0.4.2/downstream/pylib/hanoi/get_hanoi_value_index_offset.py +3 -0
  37. downstream-0.4.2/downstream/pylib/hanoi/get_incidence_count_of_hanoi_value_through_index.py +15 -0
  38. downstream-0.4.2/downstream/pylib/hanoi/get_index_of_hanoi_value_next_incidence.py +28 -0
  39. downstream-0.4.2/downstream/pylib/hanoi/get_index_of_hanoi_value_nth_incidence.py +14 -0
  40. downstream-0.4.2/downstream/pylib/hanoi/get_max_hanoi_value_through_index.py +10 -0
  41. downstream-0.4.2/downstream/pylib/hanoi/get_min_hanoi_value_with_incidence_at_least.py +26 -0
  42. downstream-0.4.2/downstream/pylib/jupyter_hide_toggle.py +64 -0
  43. downstream-0.4.2/downstream/pylib/log_args_and_result.py +54 -0
  44. downstream-0.4.2/downstream/pylib/longevity_ordering_alternating/__init__.py +17 -0
  45. downstream-0.4.2/downstream/pylib/longevity_ordering_alternating/get_longevity_directionality.py +3 -0
  46. downstream-0.4.2/downstream/pylib/longevity_ordering_alternating/get_longevity_index_of_mapped_position.py +44 -0
  47. downstream-0.4.2/downstream/pylib/longevity_ordering_alternating/get_longevity_mapped_position_of_index.py +35 -0
  48. downstream-0.4.2/downstream/pylib/longevity_ordering_alternating/get_longevity_reversed_position_within_level.py +14 -0
  49. downstream-0.4.2/downstream/pylib/longevity_ordering_common/__init__.py +19 -0
  50. downstream-0.4.2/downstream/pylib/longevity_ordering_common/get_longevity_level_of_index.py +3 -0
  51. downstream-0.4.2/downstream/pylib/longevity_ordering_common/get_longevity_level_of_mapped_position.py +12 -0
  52. downstream-0.4.2/downstream/pylib/longevity_ordering_common/get_longevity_num_positions_at_level.py +2 -0
  53. downstream-0.4.2/downstream/pylib/longevity_ordering_common/get_longevity_num_positions_at_lower_levels.py +7 -0
  54. downstream-0.4.2/downstream/pylib/longevity_ordering_common/get_longevity_offset_of_level.py +8 -0
  55. downstream-0.4.2/downstream/pylib/longevity_ordering_descending/__init__.py +11 -0
  56. downstream-0.4.2/downstream/pylib/longevity_ordering_descending/get_longevity_index_of_mapped_position.py +14 -0
  57. downstream-0.4.2/downstream/pylib/longevity_ordering_descending/get_longevity_mapped_position_of_index.py +21 -0
  58. downstream-0.4.2/downstream/pylib/longevity_ordering_naive/__init__.py +15 -0
  59. downstream-0.4.2/downstream/pylib/longevity_ordering_naive/get_longevity_index_of_mapped_position.py +10 -0
  60. downstream-0.4.2/downstream/pylib/longevity_ordering_naive/get_longevity_mapped_position_of_index.py +24 -0
  61. downstream-0.4.2/downstream/pylib/longevity_ordering_naive/get_longevity_position_within_level.py +23 -0
  62. downstream-0.4.2/downstream/pylib/longevity_ordering_piecewise_ascending/__init__.py +11 -0
  63. downstream-0.4.2/downstream/pylib/longevity_ordering_piecewise_ascending/get_longevity_index_of_mapped_position.py +28 -0
  64. downstream-0.4.2/downstream/pylib/longevity_ordering_piecewise_ascending/get_longevity_mapped_position_of_index.py +22 -0
  65. downstream-0.4.2/downstream/pylib/modulo.py +35 -0
  66. downstream-0.4.2/downstream/pylib/oeis/__init__.py +35 -0
  67. downstream-0.4.2/downstream/pylib/oeis/get_a000295_index_of_value.py +12 -0
  68. downstream-0.4.2/downstream/pylib/oeis/get_a000295_value_at_index.py +8 -0
  69. downstream-0.4.2/downstream/pylib/oeis/get_a005187_index_of_value.py +540 -0
  70. downstream-0.4.2/downstream/pylib/oeis/get_a005187_value_at_index.py +3 -0
  71. downstream-0.4.2/downstream/pylib/oeis/get_a025480_value_at_index.py +3 -0
  72. downstream-0.4.2/downstream/pylib/oeis/get_a030109_index_of_value.py +13 -0
  73. downstream-0.4.2/downstream/pylib/oeis/get_a030109_value_at_index.py +6 -0
  74. downstream-0.4.2/downstream/pylib/oeis/get_a037870_value_at_index.py +5 -0
  75. downstream-0.4.2/downstream/pylib/oeis/get_a048881_value_at_index.py +4 -0
  76. downstream-0.4.2/downstream/pylib/oeis/get_a059893_index_of_value.py +6 -0
  77. downstream-0.4.2/downstream/pylib/oeis/get_a059893_value_at_index.py +7 -0
  78. downstream-0.4.2/downstream/pylib/oeis/get_a083058_index_of_value.py +7 -0
  79. downstream-0.4.2/downstream/pylib/oeis/get_a083058_value_at_index.py +2 -0
  80. downstream-0.4.2/downstream/pylib/oeis/get_a130654_value_at_index.py +17 -0
  81. downstream-0.4.2/downstream/pylib/oeis/get_a341916_index_of_value.py +7 -0
  82. downstream-0.4.2/downstream/pylib/oeis/get_a341916_value_at_index.py +7 -0
  83. downstream-0.4.2/downstream/pylib/prepend_cmap_with_color.py +15 -0
  84. downstream-0.4.2/downstream/pylib/round_to_one_sigfig.py +13 -0
  85. downstream-0.4.2/downstream/pylib/sign.py +23 -0
  86. downstream-0.4.2/downstream/pylib/site_selection_eval/__init__.py +13 -0
  87. downstream-0.4.2/downstream/pylib/site_selection_eval/get_first_decreasing_hanoi_value_deposition.py +27 -0
  88. downstream-0.4.2/downstream/pylib/site_selection_eval/get_first_deposition_over_too_new_site.py +93 -0
  89. downstream-0.4.2/downstream/pylib/site_selection_eval/get_first_resolved_resident_rank_inconsistency.py +35 -0
  90. downstream-0.4.2/downstream/pylib/site_selection_eval/make_surface_history_df.py +70 -0
  91. downstream-0.4.2/downstream/pylib/site_selection_viz/_SurfaceHistoryToStratumRetentionPolicyShim.py +38 -0
  92. downstream-0.4.2/downstream/pylib/site_selection_viz/__init__.py +17 -0
  93. downstream-0.4.2/downstream/pylib/site_selection_viz/_apply_pseudo_linear_yticks.py +37 -0
  94. downstream-0.4.2/downstream/pylib/site_selection_viz/_apply_pseudo_log_yticks.py +26 -0
  95. downstream-0.4.2/downstream/pylib/site_selection_viz/_geomspace_filter_surface_history_df.py +22 -0
  96. downstream-0.4.2/downstream/pylib/site_selection_viz/_linspace_filter_surface_history_df.py +22 -0
  97. downstream-0.4.2/downstream/pylib/site_selection_viz/site_deposition_depth_by_rank_heatmap.py +66 -0
  98. downstream-0.4.2/downstream/pylib/site_selection_viz/site_deposition_rank_by_rank_heatmap.py +65 -0
  99. downstream-0.4.2/downstream/pylib/site_selection_viz/site_differentia_by_rank_heatmap.py +54 -0
  100. downstream-0.4.2/downstream/pylib/site_selection_viz/site_hanoi_value_by_rank_heatmap.py +57 -0
  101. downstream-0.4.2/downstream/pylib/site_selection_viz/stratum_persistence_dripplot.py +23 -0
  102. downstream-0.4.2/downstream/pylib/tee_release.py +10 -0
  103. downstream-0.4.2/downstream/pylib/test/__init__.py +0 -0
  104. downstream-0.4.2/downstream/pylib/test/test_Literal.py +5 -0
  105. downstream-0.4.2/downstream/pylib/test/test_bit_ceil.py +52 -0
  106. downstream-0.4.2/downstream/pylib/test/test_bit_count_immediate_zeros.py +46 -0
  107. downstream-0.4.2/downstream/pylib/test/test_bit_count_leading_ones.py +22 -0
  108. downstream-0.4.2/downstream/pylib/test/test_bit_decode_gray.py +7 -0
  109. downstream-0.4.2/downstream/pylib/test/test_bit_drop_msb.py +27 -0
  110. downstream-0.4.2/downstream/pylib/test/test_bit_encode_gray.py +27 -0
  111. downstream-0.4.2/downstream/pylib/test/test_bit_floor.py +14 -0
  112. downstream-0.4.2/downstream/pylib/test/test_bit_invert.py +33 -0
  113. downstream-0.4.2/downstream/pylib/test/test_bit_reverse.py +27 -0
  114. downstream-0.4.2/downstream/pylib/test/test_calc_dyadic_lcm_upper_bound.py +62 -0
  115. downstream-0.4.2/downstream/pylib/test/test_count_factors_of_2.py +21 -0
  116. downstream-0.4.2/downstream/pylib/test/test_enforce_typing.py +36 -0
  117. downstream-0.4.2/downstream/pylib/test/test_fast_pow2_divide.py +72 -0
  118. downstream-0.4.2/downstream/pylib/test/test_fast_pow2_mod.py +66 -0
  119. downstream-0.4.2/downstream/pylib/test/test_get_powersof2triangle_val_at_index.py +95 -0
  120. downstream-0.4.2/downstream/pylib/test/test_hanoi/__init__.py +0 -0
  121. downstream-0.4.2/downstream/pylib/test/test_hanoi/test_get_hanoi_value_at_index.py +116 -0
  122. downstream-0.4.2/downstream/pylib/test/test_hanoi/test_get_hanoi_value_incidence_at_index.py +12 -0
  123. downstream-0.4.2/downstream/pylib/test/test_hanoi/test_get_incidence_count_of_hanoi_value_through_index.py +22 -0
  124. downstream-0.4.2/downstream/pylib/test/test_hanoi/test_get_index_of_hanoi_value_next_incidence.py +37 -0
  125. downstream-0.4.2/downstream/pylib/test/test_hanoi/test_get_index_of_hanoi_value_nth_incidence.py +15 -0
  126. downstream-0.4.2/downstream/pylib/test/test_hanoi/test_get_max_hanoi_value_through_index.py +12 -0
  127. downstream-0.4.2/downstream/pylib/test/test_hanoi/test_get_min_hanoi_value_with_incidence_at_least.py +32 -0
  128. downstream-0.4.2/downstream/pylib/test/test_log_args_and_result.py +41 -0
  129. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_alternating/__init__.py +0 -0
  130. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_alternating/test_get_longevity_index_of_mapped_position.py +31 -0
  131. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_alternating/test_get_longevity_mapped_position_of_index.py +128 -0
  132. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_alternating/test_get_longevity_reversed_position_within_level.py +21 -0
  133. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_common/__init__.py +0 -0
  134. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_common/test_get_longevity_level_of_index.py +10 -0
  135. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_common/test_get_longevity_level_of_mapped_position.py +76 -0
  136. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_common/test_get_longevity_num_positions_at_level.py +10 -0
  137. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_common/test_get_longevity_offset_of_level.py +23 -0
  138. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_common/test_longevity_num_positions_at_lower_levels.py +7 -0
  139. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_descending/__init__.py +0 -0
  140. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_descending/test_get_longevity_index_of_mapped_position.py +28 -0
  141. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_descending/test_get_longevity_mapped_position_of_index.py +101 -0
  142. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_naive/__init__.py +0 -0
  143. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_naive/test_get_longevity_index_of_mapped_position.py +28 -0
  144. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_naive/test_get_longevity_mapped_position_of_index.py +101 -0
  145. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_naive/test_get_longevity_position_within_level.py +51 -0
  146. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_piecewise_ascending/__init__.py +0 -0
  147. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_piecewise_ascending/test_get_longevity_index_of_mapped_position.py +28 -0
  148. downstream-0.4.2/downstream/pylib/test/test_longevity_ordering_piecewise_ascending/test_get_longevity_mapped_position_of_index.py +101 -0
  149. downstream-0.4.2/downstream/pylib/test/test_modulo.py +30 -0
  150. downstream-0.4.2/downstream/pylib/test/test_oeis/__init__.py +0 -0
  151. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a000295_index_of_value.py +35 -0
  152. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a000295_value_at_index.py +41 -0
  153. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a005187_index_of_value.py +9 -0
  154. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a005187_value_at_index.py +73 -0
  155. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a025480_value_at_index.py +91 -0
  156. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a030109_index_of_value.py +13 -0
  157. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a030109_value_at_index.py +90 -0
  158. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a037870_value_at_index.py +97 -0
  159. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a048881_value_at_index.py +112 -0
  160. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a059893_index_of_value.py +13 -0
  161. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a059893_value_at_index.py +78 -0
  162. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a083058_index_of_value.py +10 -0
  163. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a083058_value_at_index.py +81 -0
  164. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a130654_value_at_index.py +139 -0
  165. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a341916_index_of_value.py +13 -0
  166. downstream-0.4.2/downstream/pylib/test/test_oeis/test_get_a341916_value_at_index.py +74 -0
  167. downstream-0.4.2/downstream/pylib/test/test_prepend_cmap_with_color.py +14 -0
  168. downstream-0.4.2/downstream/pylib/test/test_round_to_one_sigfig.py +8 -0
  169. downstream-0.4.2/downstream/pylib/test/test_sign.py +19 -0
  170. downstream-0.4.2/downstream/serialization/__init__.py +11 -0
  171. downstream-0.4.2/downstream/serialization/_col_from_surf_int.py +60 -0
  172. downstream-0.4.2/downstream/serialization/_col_from_surf_packet.py +89 -0
  173. downstream-0.4.2/downstream/serialization/_sort_differentiae_by_deposition_rank.py +71 -0
  174. downstream-0.4.2/downstream/site_selection_strategy/__init__.py +4 -0
  175. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/__init__.py +15 -0
  176. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/hybrid_algo/__init__.py +9 -0
  177. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/hybrid_algo/_calc_resident_deposition_rank.py +32 -0
  178. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/hybrid_algo/_iter_resident_deposition_ranks.py +28 -0
  179. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/hybrid_algo/_pick_deposition_site.py +36 -0
  180. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/__init__.py +37 -0
  181. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_enact/__init__.py +5 -0
  182. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_enact/_pick_deposition_site.py +79 -0
  183. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/__init__.py +33 -0
  184. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_calc_resident_deposition_rank_wrt_bin.py +79 -0
  185. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_bin_number_of_position.py +36 -0
  186. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_bin_offset_at_position.py +7 -0
  187. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_bin_width_at_position.py +65 -0
  188. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_nth_bin_position.py +35 -0
  189. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_nth_bin_width.py +20 -0
  190. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_nth_segment_bin_count.py +5 -0
  191. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_nth_segment_bin_width.py +9 -0
  192. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_nth_segment_position.py +30 -0
  193. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_nth_segment_width.py +8 -0
  194. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_num_bins.py +3 -0
  195. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_num_positions.py +5 -0
  196. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_get_num_segments.py +5 -0
  197. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_impl/_iter_bin_coords.py +26 -0
  198. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_scry/__init__.py +7 -0
  199. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_scry/_calc_resident_deposition_rank.py +37 -0
  200. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/steady_algo/_scry/_iter_resident_deposition_ranks.py +40 -0
  201. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/__init__.py +11 -0
  202. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_enact/__init__.py +0 -0
  203. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_enact/_pick_deposition_site.py +43 -0
  204. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/__init__.py +59 -0
  205. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_calc_hanoi_invasion_rank.py +10 -0
  206. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_calc_invading_hanoi_value.py +17 -0
  207. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_calc_resident_hanoi_value.py +77 -0
  208. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_epoch_rank.py +16 -0
  209. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_global_epoch.py +20 -0
  210. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_global_num_reservations.py +12 -0
  211. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_grip_reservation_index_logical.py +51 -0
  212. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_grip_reservation_index_physical.py +44 -0
  213. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_hanoi_num_reservations.py +44 -0
  214. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_reservation_position_logical.py +19 -0
  215. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_reservation_position_physical.py +26 -0
  216. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_reservation_width_physical.py +19 -0
  217. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_site_genesis_reservation_index_physical.py +33 -0
  218. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_site_hanoi_value_assigned.py +32 -0
  219. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_site_reservation_index_logical.py +39 -0
  220. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_impl/_get_site_reservation_index_physical.py +41 -0
  221. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_scry/__init__.py +7 -0
  222. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_scry/_calc_resident_deposition_rank.py +222 -0
  223. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_algo/_scry/_iter_resident_deposition_ranks.py +31 -0
  224. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/__init__.py +14 -0
  225. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_enact/__init__.py +5 -0
  226. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_enact/_pick_deposition_site.py +59 -0
  227. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/__init__.py +59 -0
  228. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_fractional_downgrade_num_reservations_provided.py +36 -0
  229. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_fractional_downgrade_rank.py +60 -0
  230. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_fractional_downgrade_state.py +295 -0
  231. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_num_incidence_reservations_at_rank.py +23 -0
  232. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_num_reservations_provided.py +39 -0
  233. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_num_sites_reserved_per_incidence_at_rank.py +24 -0
  234. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_regime_mx.py +21 -0
  235. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_regime_num_reservations_available.py +23 -0
  236. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_regime_num_reservations_provided.py +39 -0
  237. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_regime_reservation_downgrade_rank.py +58 -0
  238. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_safe_downgrade_rank.py +152 -0
  239. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_surface_rank_capacity.py +13 -0
  240. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_upcoming_hanoi_invasion_rank.py +20 -0
  241. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_get_upcoming_hanoi_invasion_value.py +30 -0
  242. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_has_hanoi_value_filled_first_reservation_layer.py +32 -0
  243. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_is_2x_reservation_eligible.py +28 -0
  244. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_is_hanoi_invadable_and_uninvaded.py +11 -0
  245. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_is_hanoi_invaded.py +19 -0
  246. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_is_hanoi_invader.py +17 -0
  247. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_impl/_iter_hanoi_invader_values.py +18 -0
  248. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/__init__.py +7 -0
  249. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/_calc_resident_deposition_rank.py +41 -0
  250. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/_impl/__init__.py +29 -0
  251. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/_impl/_calc_incidence_of_deposited_hanoi_value.py +68 -0
  252. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/_impl/_calc_rank_of_deposited_hanoi_value.py +36 -0
  253. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/_impl/_calc_reservation_reference_incidence.py +101 -0
  254. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/_impl/_calc_resident_hanoi_context.py +138 -0
  255. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/_impl/_get_reservation_index_elimination_rank.py +114 -0
  256. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/_impl/_iter_candidate_hanoi_occupants.py +30 -0
  257. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/_impl/_iter_candidate_reservation_indices.py +33 -0
  258. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/_impl/_iter_candidate_reservation_sizes.py +28 -0
  259. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_hadamard_order_site_rungs_algo/_scry/_iter_resident_deposition_ranks.py +2 -0
  260. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_sticky_algo/__init__.py +9 -0
  261. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_sticky_algo/_calc_resident_deposition_rank.py +42 -0
  262. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_sticky_algo/_iter_resident_deposition_ranks.py +31 -0
  263. downstream-0.4.2/downstream/site_selection_strategy/site_selection_algorithms/tilted_sticky_algo/_pick_deposition_site.py +32 -0
  264. downstream-0.4.2/downstream.egg-info/PKG-INFO +106 -0
  265. downstream-0.4.2/downstream.egg-info/SOURCES.txt +433 -0
  266. downstream-0.4.2/downstream.egg-info/dependency_links.txt +1 -0
  267. downstream-0.4.2/downstream.egg-info/requires.txt +28 -0
  268. downstream-0.4.2/downstream.egg-info/top_level.txt +3 -0
  269. downstream-0.4.2/pylib/hanoi/__init__.py +33 -0
  270. downstream-0.4.2/pylib/hanoi/get_hanoi_value_at_index.py +10 -0
  271. downstream-0.4.2/pylib/hanoi/get_hanoi_value_incidence_at_index.py +11 -0
  272. downstream-0.4.2/pylib/hanoi/get_hanoi_value_index_cadence.py +4 -0
  273. downstream-0.4.2/pylib/hanoi/get_hanoi_value_index_offset.py +3 -0
  274. downstream-0.4.2/pylib/hanoi/get_incidence_count_of_hanoi_value_through_index.py +15 -0
  275. downstream-0.4.2/pylib/hanoi/get_index_of_hanoi_value_next_incidence.py +28 -0
  276. downstream-0.4.2/pylib/hanoi/get_index_of_hanoi_value_nth_incidence.py +14 -0
  277. downstream-0.4.2/pylib/hanoi/get_max_hanoi_value_through_index.py +10 -0
  278. downstream-0.4.2/pylib/hanoi/get_min_hanoi_value_with_incidence_at_least.py +26 -0
  279. downstream-0.4.2/pylib/longevity_ordering_alternating/__init__.py +17 -0
  280. downstream-0.4.2/pylib/longevity_ordering_alternating/get_longevity_directionality.py +3 -0
  281. downstream-0.4.2/pylib/longevity_ordering_alternating/get_longevity_index_of_mapped_position.py +44 -0
  282. downstream-0.4.2/pylib/longevity_ordering_alternating/get_longevity_mapped_position_of_index.py +35 -0
  283. downstream-0.4.2/pylib/longevity_ordering_alternating/get_longevity_reversed_position_within_level.py +14 -0
  284. downstream-0.4.2/pylib/longevity_ordering_common/__init__.py +19 -0
  285. downstream-0.4.2/pylib/longevity_ordering_common/get_longevity_level_of_index.py +3 -0
  286. downstream-0.4.2/pylib/longevity_ordering_common/get_longevity_level_of_mapped_position.py +12 -0
  287. downstream-0.4.2/pylib/longevity_ordering_common/get_longevity_num_positions_at_level.py +2 -0
  288. downstream-0.4.2/pylib/longevity_ordering_common/get_longevity_num_positions_at_lower_levels.py +7 -0
  289. downstream-0.4.2/pylib/longevity_ordering_common/get_longevity_offset_of_level.py +8 -0
  290. downstream-0.4.2/pylib/longevity_ordering_descending/__init__.py +11 -0
  291. downstream-0.4.2/pylib/longevity_ordering_descending/get_longevity_index_of_mapped_position.py +14 -0
  292. downstream-0.4.2/pylib/longevity_ordering_descending/get_longevity_mapped_position_of_index.py +21 -0
  293. downstream-0.4.2/pylib/longevity_ordering_naive/__init__.py +15 -0
  294. downstream-0.4.2/pylib/longevity_ordering_naive/get_longevity_index_of_mapped_position.py +10 -0
  295. downstream-0.4.2/pylib/longevity_ordering_naive/get_longevity_mapped_position_of_index.py +24 -0
  296. downstream-0.4.2/pylib/longevity_ordering_naive/get_longevity_position_within_level.py +23 -0
  297. downstream-0.4.2/pylib/longevity_ordering_piecewise_ascending/__init__.py +11 -0
  298. downstream-0.4.2/pylib/longevity_ordering_piecewise_ascending/get_longevity_index_of_mapped_position.py +28 -0
  299. downstream-0.4.2/pylib/longevity_ordering_piecewise_ascending/get_longevity_mapped_position_of_index.py +22 -0
  300. downstream-0.4.2/pylib/oeis/__init__.py +35 -0
  301. downstream-0.4.2/pylib/oeis/get_a000295_index_of_value.py +12 -0
  302. downstream-0.4.2/pylib/oeis/get_a000295_value_at_index.py +8 -0
  303. downstream-0.4.2/pylib/oeis/get_a005187_index_of_value.py +540 -0
  304. downstream-0.4.2/pylib/oeis/get_a005187_value_at_index.py +3 -0
  305. downstream-0.4.2/pylib/oeis/get_a025480_value_at_index.py +3 -0
  306. downstream-0.4.2/pylib/oeis/get_a030109_index_of_value.py +13 -0
  307. downstream-0.4.2/pylib/oeis/get_a030109_value_at_index.py +6 -0
  308. downstream-0.4.2/pylib/oeis/get_a037870_value_at_index.py +5 -0
  309. downstream-0.4.2/pylib/oeis/get_a048881_value_at_index.py +4 -0
  310. downstream-0.4.2/pylib/oeis/get_a059893_index_of_value.py +6 -0
  311. downstream-0.4.2/pylib/oeis/get_a059893_value_at_index.py +7 -0
  312. downstream-0.4.2/pylib/oeis/get_a083058_index_of_value.py +7 -0
  313. downstream-0.4.2/pylib/oeis/get_a083058_value_at_index.py +2 -0
  314. downstream-0.4.2/pylib/oeis/get_a130654_value_at_index.py +17 -0
  315. downstream-0.4.2/pylib/oeis/get_a341916_index_of_value.py +7 -0
  316. downstream-0.4.2/pylib/oeis/get_a341916_value_at_index.py +7 -0
  317. downstream-0.4.2/pylib/site_selection_eval/__init__.py +13 -0
  318. downstream-0.4.2/pylib/site_selection_eval/get_first_decreasing_hanoi_value_deposition.py +27 -0
  319. downstream-0.4.2/pylib/site_selection_eval/get_first_deposition_over_too_new_site.py +93 -0
  320. downstream-0.4.2/pylib/site_selection_eval/get_first_resolved_resident_rank_inconsistency.py +35 -0
  321. downstream-0.4.2/pylib/site_selection_eval/make_surface_history_df.py +70 -0
  322. downstream-0.4.2/pylib/site_selection_viz/_SurfaceHistoryToStratumRetentionPolicyShim.py +38 -0
  323. downstream-0.4.2/pylib/site_selection_viz/__init__.py +17 -0
  324. downstream-0.4.2/pylib/site_selection_viz/_apply_pseudo_linear_yticks.py +37 -0
  325. downstream-0.4.2/pylib/site_selection_viz/_apply_pseudo_log_yticks.py +26 -0
  326. downstream-0.4.2/pylib/site_selection_viz/_geomspace_filter_surface_history_df.py +22 -0
  327. downstream-0.4.2/pylib/site_selection_viz/_linspace_filter_surface_history_df.py +22 -0
  328. downstream-0.4.2/pylib/site_selection_viz/site_deposition_depth_by_rank_heatmap.py +66 -0
  329. downstream-0.4.2/pylib/site_selection_viz/site_deposition_rank_by_rank_heatmap.py +65 -0
  330. downstream-0.4.2/pylib/site_selection_viz/site_differentia_by_rank_heatmap.py +54 -0
  331. downstream-0.4.2/pylib/site_selection_viz/site_hanoi_value_by_rank_heatmap.py +57 -0
  332. downstream-0.4.2/pylib/site_selection_viz/stratum_persistence_dripplot.py +23 -0
  333. downstream-0.4.2/pyproject.toml +93 -0
  334. downstream-0.4.2/setup.cfg +23 -0
  335. downstream-0.4.2/setup.py +10 -0
  336. downstream-0.4.2/test_downstream/test_interop/__init__.py +0 -0
  337. downstream-0.4.2/test_downstream/test_interop/test_make_stratum_retention_policy_from_site_selection_algo.py +244 -0
  338. downstream-0.4.2/test_downstream/test_serialization/__init__.py +0 -0
  339. downstream-0.4.2/test_downstream/test_serialization/test_col_from_surf_int.py +113 -0
  340. downstream-0.4.2/test_downstream/test_serialization/test_col_from_surf_packet.py +98 -0
  341. downstream-0.4.2/test_downstream/test_serialization/test_sort_differentiae_by_deposition_rank.py +111 -0
  342. downstream-0.4.2/test_downstream/test_site_selection_strategy/__init__.py +0 -0
  343. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/__init__.py +0 -0
  344. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_hybrid_algo/__init__.py +0 -0
  345. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_hybrid_algo/test_calc_resident_deposition_rank.py +62 -0
  346. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_hybrid_algo/test_iter_resident_deposition_ranks.py +28 -0
  347. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/__init__.py +0 -0
  348. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_enact/__init__.py +0 -0
  349. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_enact/test_pick_deposition_site.py +60 -0
  350. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/__init__.py +0 -0
  351. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/test_get_bin_number_of_position.py +16 -0
  352. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/test_get_bin_width_at_position.py +101 -0
  353. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/test_get_nth_bin_position.py +26 -0
  354. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/test_get_nth_bin_width.py +48 -0
  355. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/test_get_nth_segment_bin_count.py +12 -0
  356. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/test_get_nth_segment_bin_width.py +21 -0
  357. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/test_get_nth_segment_position.py +40 -0
  358. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/test_get_nth_segment_width.py +21 -0
  359. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/test_get_num_bins.py +32 -0
  360. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/test_get_num_segments.py +22 -0
  361. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_impl/test_iter_bin_coords.py +23 -0
  362. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_scry/__init__.py +0 -0
  363. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_scry/test_calc_resident_deposition_rank.py +60 -0
  364. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_steady_algo/test_scry/test_iter_resident_deposition_ranks.py +25 -0
  365. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/__init__.py +0 -0
  366. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_enact/__init__.py +0 -0
  367. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_enact/test_pick_deposition_site.py +247 -0
  368. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/__init__.py +0 -0
  369. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_calc_hanoi_invasion_rank.py +26 -0
  370. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_calc_invading_hanoi_value.py +25 -0
  371. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_calc_resident_hanoi_value.py +67 -0
  372. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_epoch_rank.py +34 -0
  373. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_global_epoch.py +86 -0
  374. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_global_num_reservtions.py +98 -0
  375. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_global_num_reservtions_at_epoch.py +114 -0
  376. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_grip_reservation_index_logical.py +95 -0
  377. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_grip_reservation_index_logical_at_epoch.py +79 -0
  378. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_grip_reservation_index_physical.py +94 -0
  379. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_grip_reservation_index_physical_at_epoch.py +79 -0
  380. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_hanoi_num_reservtions.py +77 -0
  381. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_reservation_position_logical.py +66 -0
  382. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_reservation_position_physical.py +67 -0
  383. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_reservation_width_physical.py +59 -0
  384. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_site_genesis_reservation_index_physical.py +26 -0
  385. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_site_hanoi_value_assigned.py +62 -0
  386. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_site_reservation_index_logical.py +73 -0
  387. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_site_reservation_index_logical_at_epoch.py +64 -0
  388. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_site_reservation_index_physical.py +73 -0
  389. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_impl/test_get_site_reservation_index_physical_at_epoch.py +64 -0
  390. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_scry/__init__.py +0 -0
  391. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_scry/test_calc_resident_deposition_rank.py +78 -0
  392. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_algo/test_scry/test_iter_resident_deposition_ranks.py +25 -0
  393. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/__init__.py +0 -0
  394. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/__init__.py +1 -0
  395. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_fractional_downgrade_num_reservations_provided.py +23 -0
  396. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_fractional_downgrade_rank.py +23 -0
  397. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_fractional_downgrade_state.py +20 -0
  398. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_num_incidence_reservations_at_rank.py +31 -0
  399. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_num_reservations_provided.py +18 -0
  400. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_num_sites_reserved_per_incidence_at_rank.py +29 -0
  401. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_regime_mx.py +45 -0
  402. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_regime_num_reservations_available.py +26 -0
  403. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_regime_num_reservations_provided.py +18 -0
  404. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_regime_reservation_downgrade_rank.py +18 -0
  405. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_safe_downgrade_rank.py +46 -0
  406. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_surface_rank_capacity.py +32 -0
  407. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_upcoming_hanoi_invasion_rank.py +171 -0
  408. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_get_upcoming_hanoi_invasion_value.py +266 -0
  409. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_has_hanoi_value_filled_first_reservation_layer.py +48 -0
  410. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_is_2x_reservation_eligible.py +44 -0
  411. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_is_hanoi_invadable_and_uninvaded.py +34 -0
  412. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_is_hanoi_invaded.py +35 -0
  413. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_is_hanoi_invader.py +21 -0
  414. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_impl/test_iter_hanoi_invader_values.py +18 -0
  415. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_pick_deposition_site.py +55 -0
  416. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/__init__.py +0 -0
  417. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_calc_resident_deposition_rank.py +266 -0
  418. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/__init__.py +0 -0
  419. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/_impl/__init__.py +9 -0
  420. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/_impl/_make_num_reservations_provided_df.py +46 -0
  421. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/_impl/_make_reference_incidence_df.py +107 -0
  422. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/test_calc_incidence_of_deposited_hanoi_value.py +43 -0
  423. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/test_calc_rank_of_deposited_hanoi_value.py +41 -0
  424. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/test_calc_reservation_reference_incidence.py +43 -0
  425. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/test_calc_resident_hanoi_context.py +335 -0
  426. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/test_get_reservation_index_elimination_rank.py +86 -0
  427. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/test_iter_candidate_hanoi_occupants.py +51 -0
  428. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/test_iter_candidate_reservation_indices.py +25 -0
  429. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_impl/test_iter_candidate_reservation_sizes.py +16 -0
  430. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_hadamard_order_site_rungs_algo/test_scry/test_iter_resident_deposition_ranks.py +6 -0
  431. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_sticky_algo/__init__.py +0 -0
  432. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_sticky_algo/test_calc_resident_deposition_rank.py +72 -0
  433. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_sticky_algo/test_iter_resident_deposition_ranks.py +28 -0
  434. downstream-0.4.2/test_downstream/test_site_selection_strategy/test_site_selection_algorithms/test_tilted_sticky_algo/test_pick_deposition_site.py +24 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Matthew Andres Moreno
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,106 @@
1
+ Metadata-Version: 2.1
2
+ Name: downstream
3
+ Version: 0.4.2
4
+ Summary: downstream provides efficient, constant-space instrumentation for heredity stratigraphic phylogenetic inference over distributed digital evolution populations.
5
+ Author-email: Matthew Andres Moreno <m.more500@gmail.com>
6
+ License: MIT license
7
+ Project-URL: homepage, https://github.com/mmore500/downstream.git
8
+ Project-URL: repository, https://github.com/mmore500/downstream
9
+ Keywords: downstream
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Natural Language :: English
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: Deprecated
22
+ Requires-Dist: hstrat>=1.7.4
23
+ Requires-Dist: interval_search>=0.5.2
24
+ Requires-Dist: IPython
25
+ Requires-Dist: matplotlib
26
+ Requires-Dist: more_itertools
27
+ Requires-Dist: numpy
28
+ Requires-Dist: opytional
29
+ Requires-Dist: pandas
30
+ Requires-Dist: scipy
31
+ Requires-Dist: seaborn
32
+ Requires-Dist: teeplot>=0.5.0
33
+ Provides-Extra: testing
34
+ Requires-Dist: black==22.10.0; extra == "testing"
35
+ Requires-Dist: isort==5.12.0; extra == "testing"
36
+ Requires-Dist: pytest==7.2.2; extra == "testing"
37
+ Requires-Dist: pytest-xdist==3.2.1; extra == "testing"
38
+ Requires-Dist: ruff==0.0.260; extra == "testing"
39
+ Requires-Dist: tqdm==4.64.1; extra == "testing"
40
+ Provides-Extra: release
41
+ Requires-Dist: bumpver==2022.1120; extra == "release"
42
+ Requires-Dist: twine==1.14.0; extra == "release"
43
+ Requires-Dist: wheel==0.33.6; extra == "release"
44
+ Requires-Dist: pip==22.0.4; extra == "release"
45
+ Requires-Dist: pip_tools==6.10.0; extra == "release"
46
+ Requires-Dist: setuptools==65.6.3; extra == "release"
47
+
48
+ # Downstream
49
+
50
+ [![CI](https://github.com/mmore500/downstream/actions/workflows/ci.yaml/badge.svg)](https://github.com/mmore500/downstream/actions/workflows/ci.yaml)
51
+ [![GitHub stars](https://img.shields.io/github/stars/mmore500/downstream.svg?style=flat-square&logo=github&label=Stars&logoColor=white)](https://github.com/mmore500/downstream)
52
+ <!-- [
53
+ ![PyPi](https://img.shields.io/pypi/v/downstream.svg)
54
+ ](https://pypi.python.org/pypi/downstream) -->
55
+ <!-- [![DOI](https://zenodo.org/badge/652063401.svg)](https://zenodo.org/doi/10.5281/zenodo.10779240) -->
56
+ <!-- [![Documentation Status](https://readthedocs.org/projects/downstream/badge/?version=latest)](https://downstream.readthedocs.io/en/latest/?badge=latest) -->
57
+ <!-- [![documentation coverage](https://img.shields.io/endpoint?url=https%3A%2F%2Fmmore500.github.io%2Fdownstream%2Fdocumentation-coverage-badge.json)](https://downstream.readthedocs.io/en/latest/) -->
58
+ <!-- [![code coverage status](https://codecov.io/gh/mmore500/downstream/branch/master/graph/badge.svg)](https://codecov.io/gh/mmore500/downstream) -->
59
+ <!-- [![dotos](https://img.shields.io/endpoint?url=https%3A%2F%2Fmmore500.com%2Fdownstream%2Fdoto-badge.json)](https://github.com/mmore500/downstream/search?q=todo+OR+fixme&type=) -->
60
+
61
+ downstream provides efficient, constant-space implementations of stream curation algorithms.
62
+
63
+ - Free software: MIT license
64
+
65
+ <!---
66
+ - Documentation: <https://downstream.readthedocs.io>.
67
+ -->
68
+
69
+ ## Installation
70
+
71
+ `python3 -m pip install "git+https://github.com/mmore500/downstream.git@v0.4.2#egg=downstream"`
72
+
73
+ ## Documentation
74
+
75
+ Slide deck & graphics for this project are at <https://hopth.ru/ce>.
76
+
77
+ See `https://github.com/mmore500/hstrat-surface-concept` for usage examples.
78
+
79
+ ## Citing
80
+
81
+ If downstream contributes to a scientific publication, please cite it as
82
+
83
+ > Matthew Andres Moreno. (2024). mmore500/downstream. Zenodo. https://zenodo.org/doi/TODO
84
+
85
+ ```bibtex
86
+ @software{moreno2024downstream,
87
+ author = {Matthew Andres Moreno},
88
+ title = {mmore500/downstream},
89
+ month = mar,
90
+ year = 2024,
91
+ publisher = {Zenodo},
92
+ doi = {TODO},
93
+ url = {https://zenodo.org/doi/TODO}
94
+ }
95
+ ```
96
+
97
+ Consider also citing [hstrat](https://hstrat.readthedocs.io/en/stable/citing.html).
98
+ And don't forget to leave a [star on GitHub](https://github.com/mmore500/downstream/stargazers)!
99
+
100
+ ## Credits
101
+
102
+ This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [mmore500/cookiecutter-dishtiny-project](https://github.com/mmore500/cookiecutter-dishtiny-project) project template.
103
+
104
+ <!---
105
+ This package uses [Empirical](https://github.com/devosoft/Empirical#readme), a library of tools for scientific software development, with emphasis on also being able to build web interfaces using Emscripten.
106
+ -->
@@ -0,0 +1,59 @@
1
+ # Downstream
2
+
3
+ [![CI](https://github.com/mmore500/downstream/actions/workflows/ci.yaml/badge.svg)](https://github.com/mmore500/downstream/actions/workflows/ci.yaml)
4
+ [![GitHub stars](https://img.shields.io/github/stars/mmore500/downstream.svg?style=flat-square&logo=github&label=Stars&logoColor=white)](https://github.com/mmore500/downstream)
5
+ <!-- [
6
+ ![PyPi](https://img.shields.io/pypi/v/downstream.svg)
7
+ ](https://pypi.python.org/pypi/downstream) -->
8
+ <!-- [![DOI](https://zenodo.org/badge/652063401.svg)](https://zenodo.org/doi/10.5281/zenodo.10779240) -->
9
+ <!-- [![Documentation Status](https://readthedocs.org/projects/downstream/badge/?version=latest)](https://downstream.readthedocs.io/en/latest/?badge=latest) -->
10
+ <!-- [![documentation coverage](https://img.shields.io/endpoint?url=https%3A%2F%2Fmmore500.github.io%2Fdownstream%2Fdocumentation-coverage-badge.json)](https://downstream.readthedocs.io/en/latest/) -->
11
+ <!-- [![code coverage status](https://codecov.io/gh/mmore500/downstream/branch/master/graph/badge.svg)](https://codecov.io/gh/mmore500/downstream) -->
12
+ <!-- [![dotos](https://img.shields.io/endpoint?url=https%3A%2F%2Fmmore500.com%2Fdownstream%2Fdoto-badge.json)](https://github.com/mmore500/downstream/search?q=todo+OR+fixme&type=) -->
13
+
14
+ downstream provides efficient, constant-space implementations of stream curation algorithms.
15
+
16
+ - Free software: MIT license
17
+
18
+ <!---
19
+ - Documentation: <https://downstream.readthedocs.io>.
20
+ -->
21
+
22
+ ## Installation
23
+
24
+ `python3 -m pip install "git+https://github.com/mmore500/downstream.git@v0.4.2#egg=downstream"`
25
+
26
+ ## Documentation
27
+
28
+ Slide deck & graphics for this project are at <https://hopth.ru/ce>.
29
+
30
+ See `https://github.com/mmore500/hstrat-surface-concept` for usage examples.
31
+
32
+ ## Citing
33
+
34
+ If downstream contributes to a scientific publication, please cite it as
35
+
36
+ > Matthew Andres Moreno. (2024). mmore500/downstream. Zenodo. https://zenodo.org/doi/TODO
37
+
38
+ ```bibtex
39
+ @software{moreno2024downstream,
40
+ author = {Matthew Andres Moreno},
41
+ title = {mmore500/downstream},
42
+ month = mar,
43
+ year = 2024,
44
+ publisher = {Zenodo},
45
+ doi = {TODO},
46
+ url = {https://zenodo.org/doi/TODO}
47
+ }
48
+ ```
49
+
50
+ Consider also citing [hstrat](https://hstrat.readthedocs.io/en/stable/citing.html).
51
+ And don't forget to leave a [star on GitHub](https://github.com/mmore500/downstream/stargazers)!
52
+
53
+ ## Credits
54
+
55
+ This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [mmore500/cookiecutter-dishtiny-project](https://github.com/mmore500/cookiecutter-dishtiny-project) project template.
56
+
57
+ <!---
58
+ This package uses [Empirical](https://github.com/devosoft/Empirical#readme), a library of tools for scientific software development, with emphasis on also being able to build web interfaces using Emscripten.
59
+ -->
@@ -0,0 +1,15 @@
1
+ """Top-level package for downstream."""
2
+
3
+ __author__ = "Matthew Andres Moreno"
4
+ __email__ = "m.more500@gmail.com"
5
+ __version__ = "0.4.2"
6
+
7
+
8
+ from . import genome_instrumentation, interop, site_selection_strategy
9
+
10
+ __all__ = [
11
+ "interop",
12
+ "genome_instrumentation",
13
+ "serialization",
14
+ "site_selection_strategy",
15
+ ]
@@ -0,0 +1,4 @@
1
+ from ..genome_instrumentation import * # noqa: F403
2
+ from ..interop import * # noqa: F403
3
+ from ..serialization import * # noqa: F403
4
+ from ..site_selection_strategy import * # noqa: F403
@@ -0,0 +1,2 @@
1
+ class BitSurface:
2
+ """Placeholder."""
@@ -0,0 +1,2 @@
1
+ class StructSurface:
2
+ """Placeholder."""
@@ -0,0 +1,7 @@
1
+ from ._BitSurface import BitSurface
2
+ from ._StructSurface import StructSurface
3
+
4
+ __all__ = [
5
+ "BitSurface",
6
+ "StructSurface",
7
+ ]
@@ -0,0 +1,23 @@
1
+ from . import (
2
+ _stratum_retention_interop_hybrid_algo as stratum_retention_interop_hybrid_algo,
3
+ )
4
+ from . import (
5
+ _stratum_retention_interop_steady_algo as stratum_retention_interop_steady_algo,
6
+ )
7
+ from . import (
8
+ _stratum_retention_interop_tilted_algo as stratum_retention_interop_tilted_algo,
9
+ )
10
+ from . import (
11
+ _stratum_retention_interop_tilted_sticky_algo as stratum_retention_interop_tilted_sticky_algo,
12
+ )
13
+ from ._make_stratum_retention_policy_from_site_selection_algo import (
14
+ make_stratum_retention_policy_from_site_selection_algo,
15
+ )
16
+
17
+ __all__ = [
18
+ "make_stratum_retention_policy_from_site_selection_algo",
19
+ "stratum_retention_interop_hybrid_algo",
20
+ "stratum_retention_interop_steady_algo",
21
+ "stratum_retention_interop_tilted_algo",
22
+ "stratum_retention_interop_tilted_sticky_algo",
23
+ ]
@@ -0,0 +1,278 @@
1
+ import numbers
2
+ import types
3
+ import typing
4
+
5
+ from hstrat.stratum_retention_strategy.stratum_retention_algorithms._detail import (
6
+ PolicyCouplerBase,
7
+ PolicyCouplerFactory,
8
+ PolicySpecBase,
9
+ )
10
+ import more_itertools as mit
11
+
12
+
13
+ class _PolicySpecBase:
14
+ pass
15
+
16
+
17
+ class _GenDropRanksFtorBase:
18
+ pass
19
+
20
+
21
+ class _CalcNumStrataRetainedExactFtorBase:
22
+ pass
23
+
24
+
25
+ class _CalcRankAtColumnIndexFtorBase:
26
+ pass
27
+
28
+
29
+ class _IterRetainedRanksFtorBase:
30
+ pass
31
+
32
+
33
+ class _CalcNumStrataRetainedUpperBoundFtorBase:
34
+ pass
35
+
36
+
37
+ def make_stratum_retention_policy_from_site_selection_algo(
38
+ site_selection_algo: types.ModuleType,
39
+ ) -> PolicyCouplerBase:
40
+ """Create object infrastructure for a stratum retention policy equivalent
41
+ to provided surface site selection algorithm."""
42
+
43
+ class PolicySpec(PolicySpecBase, _PolicySpecBase):
44
+ """Contains all policy parameters, if any."""
45
+
46
+ _site_selection_algo: types.ModuleType = site_selection_algo
47
+ _surface_size: int
48
+
49
+ def __init__(
50
+ self: "PolicySpec",
51
+ surface_size: int,
52
+ ):
53
+ """Construct the policy spec.
54
+
55
+ Parameters
56
+ ----------
57
+ surface_size : int
58
+ How many sites does surface contain?
59
+ """
60
+ assert surface_size > 1
61
+ self._surface_size = surface_size
62
+
63
+ def __eq__(self: "PolicySpec", other: typing.Any) -> bool:
64
+ return isinstance(other, _PolicySpecBase) and (
65
+ self._surface_size,
66
+ self._site_selection_algo,
67
+ ) == (
68
+ other._surface_size,
69
+ other._site_selection_algo,
70
+ )
71
+
72
+ def __repr__(self: "PolicySpec") -> str:
73
+ return f"""{
74
+ self.GetAlgoIdentifier()
75
+ }.{
76
+ PolicySpec.__qualname__
77
+ }(surface_size={
78
+ self._surface_size
79
+ })"""
80
+
81
+ def __str__(self: "PolicySpec") -> str:
82
+ return f"""{
83
+ self.GetAlgoTitle()
84
+ } (surface size: {
85
+ self._surface_size
86
+ })"""
87
+
88
+ def GetEvalCtor(self: "PolicySpec") -> str:
89
+ return (
90
+ "downstream.interop.stratum_retention_interop_"
91
+ f"{site_selection_algo.__name__}.{self!r}"
92
+ )
93
+
94
+ def GetSurfaceSize(self: "PolicySpec") -> int:
95
+ return self._surface_size
96
+
97
+ @staticmethod
98
+ def GetAlgoIdentifier() -> str:
99
+ """Get programatic name for underlying retention algorithm."""
100
+ return site_selection_algo.__name__
101
+
102
+ @staticmethod
103
+ def GetAlgoTitle() -> str:
104
+ """Get human-readable name for underlying retention algorithm."""
105
+ return site_selection_algo.__name__.replace("_", " ")
106
+
107
+ class CalcNumStrataRetainedExactFtor(_CalcNumStrataRetainedExactFtorBase):
108
+ def __init__(
109
+ self: "CalcNumStrataRetainedExactFtor",
110
+ policy_spec: typing.Optional[PolicySpec],
111
+ ) -> None:
112
+ pass
113
+
114
+ def __eq__(
115
+ self: "CalcNumStrataRetainedExactFtor",
116
+ other: typing.Any,
117
+ ) -> bool:
118
+ return isinstance(other, _CalcNumStrataRetainedExactFtorBase)
119
+
120
+ def __call__(
121
+ self: "CalcNumStrataRetainedExactFtor",
122
+ policy: PolicyCouplerBase,
123
+ num_strata_deposited: int,
124
+ ) -> int:
125
+ return sum(
126
+ 1 for __ in policy.IterRetainedRanks(num_strata_deposited)
127
+ )
128
+
129
+ class CalcRankAtColumnIndexFtor(_CalcRankAtColumnIndexFtorBase):
130
+ def __init__(
131
+ self: "CalcRankAtColumnIndexFtor",
132
+ policy_spec: typing.Optional[PolicySpec],
133
+ ) -> None:
134
+ pass
135
+
136
+ def __eq__(
137
+ self: "CalcRankAtColumnIndexFtor",
138
+ other: typing.Any,
139
+ ) -> bool:
140
+ return isinstance(other, _CalcRankAtColumnIndexFtorBase)
141
+
142
+ def __call__(
143
+ self: "CalcRankAtColumnIndexFtor",
144
+ policy: PolicyCouplerBase,
145
+ index: int,
146
+ num_strata_deposited: int,
147
+ ) -> int:
148
+ if (
149
+ not 0
150
+ <= index
151
+ < policy.CalcNumStrataRetainedExact(num_strata_deposited)
152
+ ):
153
+ raise IndexError
154
+ res = mit.nth(
155
+ policy.IterRetainedRanks(num_strata_deposited), index
156
+ )
157
+ assert res is not None
158
+ return res
159
+
160
+ class GenDropRanksFtor(_GenDropRanksFtorBase):
161
+ def __init__(
162
+ self: "GenDropRanksFtor",
163
+ policy_spec: typing.Optional[PolicySpec],
164
+ ) -> None:
165
+ pass
166
+
167
+ def __eq__(
168
+ self: "GenDropRanksFtor",
169
+ other: typing.Any,
170
+ ) -> bool:
171
+ return isinstance(other, _GenDropRanksFtorBase)
172
+
173
+ def __call__(
174
+ self: "GenDropRanksFtor",
175
+ policy: PolicyCouplerBase,
176
+ num_stratum_depositions_completed: int,
177
+ retained_ranks: typing.Optional[typing.Iterable[int]] = None,
178
+ ) -> typing.Iterator[int]:
179
+ # convert for compat with numpy dtypes
180
+ assert isinstance(
181
+ num_stratum_depositions_completed, numbers.Integral
182
+ )
183
+ num_stratum_depositions_completed = int(
184
+ num_stratum_depositions_completed,
185
+ )
186
+
187
+ if num_stratum_depositions_completed == 0:
188
+ return
189
+
190
+ algo = site_selection_algo
191
+ surface_size = policy.GetSpec().GetSurfaceSize()
192
+
193
+ target_site = algo.pick_deposition_site(
194
+ num_stratum_depositions_completed, surface_size
195
+ )
196
+ target_rank = algo.calc_resident_deposition_rank(
197
+ target_site, surface_size, num_stratum_depositions_completed
198
+ )
199
+ if target_rank != 0:
200
+ yield target_rank
201
+ return
202
+ elif 0 not in algo.iter_resident_deposition_ranks(
203
+ surface_size,
204
+ num_stratum_depositions_completed + 1,
205
+ ):
206
+ yield 0
207
+ return
208
+
209
+ class IterRetainedRanksFtor(_IterRetainedRanksFtorBase):
210
+ def __init__(
211
+ self: "IterRetainedRanksFtor",
212
+ policy_spec: typing.Optional[PolicySpec],
213
+ ) -> None:
214
+ pass
215
+
216
+ def __eq__(
217
+ self: "IterRetainedRanksFtor",
218
+ other: typing.Any,
219
+ ) -> bool:
220
+ return isinstance(other, _IterRetainedRanksFtorBase)
221
+
222
+ def __call__(
223
+ self: "IterRetainedRanksFtor",
224
+ policy: PolicyCouplerBase,
225
+ num_strata_deposited: int,
226
+ ) -> typing.Iterator[int]:
227
+ # convert for compat with numpy dtypes
228
+ assert isinstance(num_strata_deposited, numbers.Integral)
229
+ num_strata_deposited = int(num_strata_deposited)
230
+
231
+ if num_strata_deposited == 0:
232
+ return
233
+ algo = site_selection_algo
234
+ surface_size = policy.GetSpec().GetSurfaceSize()
235
+ ranks = sorted(
236
+ algo.iter_resident_deposition_ranks(
237
+ surface_size,
238
+ num_strata_deposited,
239
+ )
240
+ )
241
+ last_zero = ranks.count(0) - (ranks[0] == 0)
242
+ assert 0 <= last_zero < len(ranks)
243
+ yield from ranks[last_zero:]
244
+
245
+ class CalcNumStrataRetainedUpperBoundFtor(
246
+ _CalcNumStrataRetainedUpperBoundFtorBase,
247
+ ):
248
+ def __init__(
249
+ self: "CalcNumStrataRetainedUpperBoundFtor",
250
+ policy_spec: typing.Optional[PolicySpec],
251
+ ) -> None:
252
+ pass
253
+
254
+ def __eq__(
255
+ self: "CalcNumStrataRetainedUpperBoundFtor",
256
+ other: typing.Any,
257
+ ) -> bool:
258
+ return isinstance(other, _CalcNumStrataRetainedUpperBoundFtorBase)
259
+
260
+ def __call__(
261
+ self: "CalcNumStrataRetainedUpperBoundFtor",
262
+ policy: PolicyCouplerBase,
263
+ num_strata_deposited: int,
264
+ ) -> typing.Iterator[int]:
265
+ surface_size = policy.GetSpec().GetSurfaceSize()
266
+ return min(
267
+ num_strata_deposited,
268
+ surface_size,
269
+ )
270
+
271
+ return PolicyCouplerFactory(
272
+ policy_spec_t=PolicySpec,
273
+ gen_drop_ranks_ftor_t=GenDropRanksFtor,
274
+ calc_num_strata_retained_exact_ftor_t=CalcNumStrataRetainedExactFtor,
275
+ calc_rank_at_column_index_ftor_t=CalcRankAtColumnIndexFtor,
276
+ iter_retained_ranks_ftor_t=IterRetainedRanksFtor,
277
+ calc_num_strata_retained_upper_bound_ftor_t=CalcNumStrataRetainedUpperBoundFtor,
278
+ )
@@ -0,0 +1,14 @@
1
+ from ..site_selection_strategy.site_selection_algorithms import (
2
+ hybrid_algo as _site_selection_algo,
3
+ )
4
+ from ._make_stratum_retention_policy_from_site_selection_algo import (
5
+ make_stratum_retention_policy_from_site_selection_algo,
6
+ )
7
+
8
+ Policy = make_stratum_retention_policy_from_site_selection_algo(
9
+ _site_selection_algo
10
+ )
11
+ PolicySpec = Policy.policy_spec_t
12
+
13
+ # prevent name leakage
14
+ del make_stratum_retention_policy_from_site_selection_algo
@@ -0,0 +1,14 @@
1
+ from ..site_selection_strategy.site_selection_algorithms import (
2
+ steady_algo as _site_selection_algo,
3
+ )
4
+ from ._make_stratum_retention_policy_from_site_selection_algo import (
5
+ make_stratum_retention_policy_from_site_selection_algo,
6
+ )
7
+
8
+ Policy = make_stratum_retention_policy_from_site_selection_algo(
9
+ _site_selection_algo
10
+ )
11
+ PolicySpec = Policy.policy_spec_t
12
+
13
+ # prevent name leakage
14
+ del make_stratum_retention_policy_from_site_selection_algo
@@ -0,0 +1,14 @@
1
+ from ..site_selection_strategy.site_selection_algorithms import (
2
+ tilted_algo as _site_selection_algo,
3
+ )
4
+ from ._make_stratum_retention_policy_from_site_selection_algo import (
5
+ make_stratum_retention_policy_from_site_selection_algo,
6
+ )
7
+
8
+ Policy = make_stratum_retention_policy_from_site_selection_algo(
9
+ _site_selection_algo,
10
+ )
11
+ PolicySpec = Policy.policy_spec_t
12
+
13
+ # prevent name leakage
14
+ del make_stratum_retention_policy_from_site_selection_algo
@@ -0,0 +1,14 @@
1
+ from ..site_selection_strategy.site_selection_algorithms import (
2
+ tilted_sticky_algo as _site_selection_algo,
3
+ )
4
+ from ._make_stratum_retention_policy_from_site_selection_algo import (
5
+ make_stratum_retention_policy_from_site_selection_algo,
6
+ )
7
+
8
+ Policy = make_stratum_retention_policy_from_site_selection_algo(
9
+ _site_selection_algo,
10
+ )
11
+ PolicySpec = Policy.policy_spec_t
12
+
13
+ # prevent name leakage
14
+ del make_stratum_retention_policy_from_site_selection_algo
@@ -0,0 +1,4 @@
1
+ try:
2
+ from typing import Literal # noqa: F401
3
+ except ImportError:
4
+ from typing_extensions import Literal # noqa: F401
@@ -0,0 +1,69 @@
1
+ from . import (
2
+ hanoi,
3
+ longevity_ordering_alternating,
4
+ longevity_ordering_descending,
5
+ longevity_ordering_naive,
6
+ longevity_ordering_piecewise_ascending,
7
+ oeis,
8
+ site_selection_eval,
9
+ site_selection_viz,
10
+ )
11
+ from .Literal import Literal
12
+ from .bit_ceil import bit_ceil
13
+ from .bit_count_immediate_zeros import bit_count_immediate_zeros
14
+ from .bit_count_leading_ones import bit_count_leading_ones
15
+ from .bit_decode_gray import bit_decode_gray
16
+ from .bit_drop_msb import bit_drop_msb
17
+ from .bit_encode_gray import bit_encode_gray
18
+ from .bit_floor import bit_floor
19
+ from .bit_invert import bit_invert
20
+ from .bit_reverse import bit_reverse
21
+ from .calc_dyadic_lcm_upper_bound import calc_dyadic_lcm_upper_bound
22
+ from .count_factors_of_2 import count_factors_of_2
23
+ from .enforce_typing import enforce_typing
24
+ from .fast_pow2_divide import fast_pow2_divide
25
+ from .fast_pow2_mod import fast_pow2_mod
26
+ from .get_powersof2triangle_val_at_index import (
27
+ get_powersof2triangle_val_at_index,
28
+ )
29
+ from .jupyter_hide_toggle import jupyter_hide_toggle
30
+ from .log_args_and_result import log_args_and_result
31
+ from .modulo import modulo
32
+ from .prepend_cmap_with_color import prepend_cmap_with_color
33
+ from .round_to_one_sigfig import round_to_one_sigfig
34
+ from .sign import sign
35
+ from .tee_release import tee_release
36
+
37
+ __all__ = [
38
+ "bit_ceil",
39
+ "bit_count_immediate_zeros",
40
+ "bit_count_leading_ones",
41
+ "bit_drop_msb",
42
+ "bit_decode_gray",
43
+ "bit_invert",
44
+ "bit_encode_gray",
45
+ "bit_floor",
46
+ "bit_reverse",
47
+ "calc_dyadic_lcm_upper_bound",
48
+ "count_factors_of_2",
49
+ "enforce_typing",
50
+ "fast_pow2_divide",
51
+ "fast_pow2_mod",
52
+ "get_powersof2triangle_val_at_index",
53
+ "jupyter_hide_toggle",
54
+ "Literal",
55
+ "log_args_and_result",
56
+ "modulo",
57
+ "prepend_cmap_with_color",
58
+ "round_to_one_sigfig",
59
+ "hanoi",
60
+ "longevity_ordering_naive",
61
+ "longevity_ordering_alternating",
62
+ "longevity_ordering_piecewise_ascending",
63
+ "longevity_ordering_descending",
64
+ "oeis",
65
+ "sign",
66
+ "site_selection_eval",
67
+ "site_selection_viz",
68
+ "tee_release",
69
+ ]
@@ -0,0 +1,11 @@
1
+ def bit_ceil(n: int) -> int:
2
+ """Calculate the smallest power of 2 not smaller than n."""
3
+ # adapted from https://github.com/mmore500/hstrat/blob/e9c2994c7a6514162f1ab685d88c374372dc1cf0/hstrat/_auxiliary_lib/_bit_ceil.py
4
+ assert n >= 0
5
+ if n:
6
+ # see https://stackoverflow.com/a/14267825/17332200
7
+ exp = (n - 1).bit_length()
8
+ res = 1 << exp
9
+ return res
10
+ else:
11
+ return 1