multipers 2.3.3b7__tar.gz → 2.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of multipers might be problematic. Click here for more details.

Files changed (192) hide show
  1. {multipers-2.3.3b7/multipers.egg-info → multipers-2.3.4}/PKG-INFO +2 -2
  2. {multipers-2.3.3b7 → multipers-2.3.4}/README.md +1 -1
  3. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/array_api/numpy.py +12 -10
  4. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/array_api/torch.py +2 -1
  5. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/filtrations/filtrations.py +2 -2
  6. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/grids.pyx +18 -11
  7. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Multi_critical_filtration.h +1 -1
  8. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/plots.py +25 -11
  9. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/simplex_tree_multi.pxd +2 -2
  10. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/simplex_tree_multi.pyx +140 -0
  11. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/simplex_tree_multi.pyx.tp +0 -2
  12. {multipers-2.3.3b7 → multipers-2.3.4/multipers.egg-info}/PKG-INFO +2 -2
  13. {multipers-2.3.3b7 → multipers-2.3.4}/pyproject.toml +1 -1
  14. {multipers-2.3.3b7 → multipers-2.3.4}/tests/test_grids.py +35 -6
  15. {multipers-2.3.3b7 → multipers-2.3.4}/LICENSE +0 -0
  16. {multipers-2.3.3b7 → multipers-2.3.4}/MANIFEST.in +0 -0
  17. {multipers-2.3.3b7 → multipers-2.3.4}/_tempita_grid_gen.py +0 -0
  18. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/__init__.py +0 -0
  19. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/_signed_measure_meta.py +0 -0
  20. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/_slicer_meta.py +0 -0
  21. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/array_api/__init__.py +0 -0
  22. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/data/MOL2.py +0 -0
  23. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/data/UCR.py +0 -0
  24. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/data/__init__.py +0 -0
  25. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/data/graphs.py +0 -0
  26. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/data/immuno_regions.py +0 -0
  27. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/data/minimal_presentation_to_st_bf.py +0 -0
  28. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/data/pytorch2simplextree.py +0 -0
  29. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/data/shape3d.py +0 -0
  30. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/data/synthetic.py +0 -0
  31. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/distances.py +0 -0
  32. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/filtration_conversions.pxd +0 -0
  33. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/filtration_conversions.pxd.tp +0 -0
  34. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/filtrations/__init__.py +0 -0
  35. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/filtrations/density.py +0 -0
  36. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/filtrations.pxd +0 -0
  37. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/function_rips.pyx +0 -0
  38. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/Persistence_slices_interface.h +0 -0
  39. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/Simplex_tree_interface.h +0 -0
  40. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/Simplex_tree_multi_interface.h +0 -0
  41. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/cubical_to_boundary.h +0 -0
  42. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Bitmap_cubical_complex.h +0 -0
  43. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Bitmap_cubical_complex_base.h +0 -0
  44. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h +0 -0
  45. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Debug_utils.h +0 -0
  46. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Fields/Multi_field.h +0 -0
  47. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Fields/Multi_field_operators.h +0 -0
  48. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Fields/Multi_field_shared.h +0 -0
  49. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Fields/Multi_field_small.h +0 -0
  50. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Fields/Multi_field_small_operators.h +0 -0
  51. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Fields/Multi_field_small_shared.h +0 -0
  52. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Fields/Z2_field.h +0 -0
  53. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Fields/Z2_field_operators.h +0 -0
  54. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Fields/Zp_field.h +0 -0
  55. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Fields/Zp_field_operators.h +0 -0
  56. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Fields/Zp_field_shared.h +0 -0
  57. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Flag_complex_edge_collapser.h +0 -0
  58. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Matrix.h +0 -0
  59. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Multi_persistence/Box.h +0 -0
  60. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Multi_persistence/Line.h +0 -0
  61. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Off_reader.h +0 -0
  62. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/One_critical_filtration.h +0 -0
  63. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/Base_matrix.h +0 -0
  64. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/Base_matrix_with_column_compression.h +0 -0
  65. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/Boundary_matrix.h +0 -0
  66. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/Chain_matrix.h +0 -0
  67. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/Id_to_index_overlay.h +0 -0
  68. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/Position_to_index_overlay.h +0 -0
  69. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/RU_matrix.h +0 -0
  70. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/allocators/entry_constructors.h +0 -0
  71. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/base_pairing.h +0 -0
  72. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/base_swap.h +0 -0
  73. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/boundary_cell_position_to_id_mapper.h +0 -0
  74. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/boundary_face_position_to_id_mapper.h +0 -0
  75. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/chain_pairing.h +0 -0
  76. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/chain_rep_cycles.h +0 -0
  77. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/chain_vine_swap.h +0 -0
  78. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/chain_column_extra_properties.h +0 -0
  79. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/column_dimension_holder.h +0 -0
  80. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/column_utilities.h +0 -0
  81. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/entry_types.h +0 -0
  82. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/heap_column.h +0 -0
  83. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/intrusive_list_column.h +0 -0
  84. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/intrusive_set_column.h +0 -0
  85. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/list_column.h +0 -0
  86. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/naive_vector_column.h +0 -0
  87. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/row_access.h +0 -0
  88. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/set_column.h +0 -0
  89. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/small_vector_column.h +0 -0
  90. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/unordered_set_column.h +0 -0
  91. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/columns/vector_column.h +0 -0
  92. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/matrix_dimension_holders.h +0 -0
  93. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/matrix_row_access.h +0 -0
  94. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/ru_pairing.h +0 -0
  95. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/ru_rep_cycles.h +0 -0
  96. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistence_matrix/ru_vine_swap.h +0 -0
  97. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistent_cohomology/Field_Zp.h +0 -0
  98. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistent_cohomology/Multi_field.h +0 -0
  99. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistent_cohomology/Persistent_cohomology_column.h +0 -0
  100. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Persistent_cohomology.h +0 -0
  101. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Points_off_io.h +0 -0
  102. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Simple_object_pool.h +0 -0
  103. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_iterators.h +0 -0
  104. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h +0 -0
  105. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_siblings.h +0 -0
  106. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Simplex_tree/Simplex_tree_star_simplex_iterators.h +0 -0
  107. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Simplex_tree/hooks_simplex_base.h +0 -0
  108. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Simplex_tree/indexing_tag.h +0 -0
  109. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Simplex_tree/serialization_utils.h +0 -0
  110. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Simplex_tree/simplex_tree_options.h +0 -0
  111. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Simplex_tree.h +0 -0
  112. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/Simplex_tree_multi.h +0 -0
  113. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/distance_functions.h +0 -0
  114. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/graph_simplicial_complex.h +0 -0
  115. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/persistence_interval.h +0 -0
  116. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/persistence_matrix_options.h +0 -0
  117. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/gudhi/reader_utils.h +0 -0
  118. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/mma_interface_coh.h +0 -0
  119. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/mma_interface_h0.h +0 -0
  120. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/mma_interface_matrix.h +0 -0
  121. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/naive_merge_tree.h +0 -0
  122. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/scc_io.h +0 -0
  123. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/gudhi/truc.h +0 -0
  124. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/io.pyx +0 -0
  125. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/ml/__init__.py +0 -0
  126. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/ml/accuracies.py +0 -0
  127. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/ml/invariants_with_persistable.py +0 -0
  128. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/ml/kernels.py +0 -0
  129. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/ml/mma.py +0 -0
  130. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/ml/one.py +0 -0
  131. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/ml/point_clouds.py +0 -0
  132. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/ml/signed_measures.py +0 -0
  133. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/ml/sliced_wasserstein.py +0 -0
  134. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/ml/tools.py +0 -0
  135. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/mma_structures.pxd +0 -0
  136. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/mma_structures.pyx +0 -0
  137. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/mma_structures.pyx.tp +0 -0
  138. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multi_parameter_rank_invariant/diff_helpers.h +0 -0
  139. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multi_parameter_rank_invariant/euler_characteristic.h +0 -0
  140. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multi_parameter_rank_invariant/function_rips.h +0 -0
  141. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multi_parameter_rank_invariant/hilbert_function.h +0 -0
  142. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multi_parameter_rank_invariant/persistence_slices.h +0 -0
  143. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multi_parameter_rank_invariant/rank_invariant.h +0 -0
  144. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_edge_collapse.py +0 -0
  145. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/approximation.h +0 -0
  146. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/combinatory.h +0 -0
  147. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/debug.h +0 -0
  148. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/euler_curves.h +0 -0
  149. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/format_python-cpp.h +0 -0
  150. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/heap_column.h +0 -0
  151. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/images.h +0 -0
  152. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/list_column.h +0 -0
  153. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/list_column_2.h +0 -0
  154. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/ru_matrix.h +0 -0
  155. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/set_column.h +0 -0
  156. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/structure_higher_dim_barcode.h +0 -0
  157. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/unordered_set_column.h +0 -0
  158. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/utilities.h +0 -0
  159. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/vector_column.h +0 -0
  160. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/vector_matrix.h +0 -0
  161. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/vineyards.h +0 -0
  162. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation/vineyards_trajectories.h +0 -0
  163. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/multiparameter_module_approximation.pyx +0 -0
  164. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/pickle.py +0 -0
  165. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/point_measure.pyx +0 -0
  166. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/slicer.pxd +20 -20
  167. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/slicer.pxd.tp +0 -0
  168. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/slicer.pyx +20 -20
  169. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/slicer.pyx.tp +0 -0
  170. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/tensor/tensor.h +0 -0
  171. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/tensor.pxd +0 -0
  172. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/test.pyx +0 -0
  173. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/tests/__init__.py +0 -0
  174. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/torch/__init__.py +0 -0
  175. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/torch/diff_grids.py +0 -0
  176. {multipers-2.3.3b7 → multipers-2.3.4}/multipers/torch/rips_density.py +0 -0
  177. {multipers-2.3.3b7 → multipers-2.3.4}/multipers.egg-info/SOURCES.txt +0 -0
  178. {multipers-2.3.3b7 → multipers-2.3.4}/multipers.egg-info/dependency_links.txt +0 -0
  179. {multipers-2.3.3b7 → multipers-2.3.4}/multipers.egg-info/requires.txt +0 -0
  180. {multipers-2.3.3b7 → multipers-2.3.4}/multipers.egg-info/top_level.txt +0 -0
  181. {multipers-2.3.3b7 → multipers-2.3.4}/setup.cfg +0 -0
  182. {multipers-2.3.3b7 → multipers-2.3.4}/setup.py +0 -0
  183. {multipers-2.3.3b7 → multipers-2.3.4}/tests/test_diff_helper.py +0 -0
  184. {multipers-2.3.3b7 → multipers-2.3.4}/tests/test_filtrations.py +0 -0
  185. {multipers-2.3.3b7 → multipers-2.3.4}/tests/test_hilbert_function.py +0 -0
  186. {multipers-2.3.3b7 → multipers-2.3.4}/tests/test_mma.py +0 -0
  187. {multipers-2.3.3b7 → multipers-2.3.4}/tests/test_point_clouds.py +0 -0
  188. {multipers-2.3.3b7 → multipers-2.3.4}/tests/test_python-cpp_conversion.py +0 -0
  189. {multipers-2.3.3b7 → multipers-2.3.4}/tests/test_signed_betti.py +0 -0
  190. {multipers-2.3.3b7 → multipers-2.3.4}/tests/test_signed_measure.py +0 -0
  191. {multipers-2.3.3b7 → multipers-2.3.4}/tests/test_simplextreemulti.py +0 -0
  192. {multipers-2.3.3b7 → multipers-2.3.4}/tests/test_slicer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multipers
3
- Version: 2.3.3b7
3
+ Version: 2.3.4
4
4
  Summary: Multiparameter Topological Persistence for Machine Learning
5
5
  Author-email: David Loiseaux <david.lapous@proton.me>, Hannah Schreiber <hannah.schreiber@inria.fr>
6
6
  Maintainer-email: David Loiseaux <david.lapous@proton.me>
@@ -44,7 +44,7 @@ This library aims to provide easy to use and performant strategies for applied m
44
44
  ## Compiled packages
45
45
  | Source | Version | Downloads | Platforms |
46
46
  | --- | --- | --- | --- |
47
- | [![Conda Recipe](https://img.shields.io/badge/conda-recipe-green.svg)](https://anaconda.org/conda-forge/multipers)| [![Conda Version](https://img.shields.io/conda/vn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |
47
+ | [![Conda Recipe](https://img.shields.io/badge/conda-recipe-green.svg)](https://github.com/conda-forge/multipers-feedstock)| [![Conda Version](https://img.shields.io/conda/vn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |
48
48
  | [![pip Recipe](https://img.shields.io/badge/pip-package-green.svg)](https:///pypi.org/project/multipers) | [![PyPI](https://img.shields.io/pypi/v/multipers?color=green)](https://pypi.org/project/multipers) | [![ pip downloads](https://static.pepy.tech/badge/multipers)](https://pepy.tech/project/multipers) | |
49
49
 
50
50
 
@@ -8,7 +8,7 @@ This library aims to provide easy to use and performant strategies for applied m
8
8
  ## Compiled packages
9
9
  | Source | Version | Downloads | Platforms |
10
10
  | --- | --- | --- | --- |
11
- | [![Conda Recipe](https://img.shields.io/badge/conda-recipe-green.svg)](https://anaconda.org/conda-forge/multipers)| [![Conda Version](https://img.shields.io/conda/vn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |
11
+ | [![Conda Recipe](https://img.shields.io/badge/conda-recipe-green.svg)](https://github.com/conda-forge/multipers-feedstock)| [![Conda Version](https://img.shields.io/conda/vn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |
12
12
  | [![pip Recipe](https://img.shields.io/badge/pip-package-green.svg)](https:///pypi.org/project/multipers) | [![PyPI](https://img.shields.io/pypi/v/multipers?color=green)](https://pypi.org/project/multipers) | [![ pip downloads](https://static.pepy.tech/badge/multipers)](https://pepy.tech/project/multipers) | |
13
13
 
14
14
 
@@ -31,17 +31,19 @@ def check_keops():
31
31
  global _is_keops_available, LazyTensor
32
32
  if _is_keops_available is not None:
33
33
  return _is_keops_available
34
- import pykeops.numpy as pknp
35
- from pykeops.numpy import LazyTensor as LT
36
-
37
- formula = "SqNorm2(x - y)"
38
- var = ["x = Vi(3)", "y = Vj(3)"]
39
- expected_res = _np.array([63.0, 90.0])
40
- x = _np.arange(1, 10).reshape(-1, 3).astype("float32")
41
- y = _np.arange(3, 9).reshape(-1, 3).astype("float32")
42
-
43
- my_conv = pknp.Genred(formula, var)
44
34
  try:
35
+ if _is_keops_available is not None:
36
+ return _is_keops_available
37
+ import pykeops.numpy as pknp
38
+ from pykeops.numpy import LazyTensor as LT
39
+
40
+ formula = "SqNorm2(x - y)"
41
+ var = ["x = Vi(3)", "y = Vj(3)"]
42
+ expected_res = _np.array([63.0, 90.0])
43
+ x = _np.arange(1, 10).reshape(-1, 3).astype("float32")
44
+ y = _np.arange(3, 9).reshape(-1, 3).astype("float32")
45
+
46
+ my_conv = pknp.Genred(formula, var)
45
47
  _is_keops_available = _np.allclose(my_conv(x, y).flatten(), expected_res)
46
48
  LazyTensor = LT
47
49
  except:
@@ -41,7 +41,7 @@ def check_keops():
41
41
 
42
42
  my_conv = pknp.Genred(formula, var)
43
43
  _is_keops_available = _t.allclose(
44
- my_conv(x, y).view(-1), _t.tensor(expected_res).type(_t.float32)
44
+ my_conv(x, y).view(-1), expected_res.type(_t.float32)
45
45
  )
46
46
  LazyTensor = LT
47
47
 
@@ -53,6 +53,7 @@ def check_keops():
53
53
  _is_keops_available = False
54
54
 
55
55
  return _is_keops_available
56
+ check_keops()
56
57
 
57
58
 
58
59
  def from_numpy(x):
@@ -76,8 +76,8 @@ def RipsLowerstar(
76
76
  st.fill_lowerstar(api.asnumpy(function[:, i]), parameter=1 + i)
77
77
  if api.has_grad(D) or api.has_grad(function):
78
78
  from multipers.grids import compute_grid
79
-
80
- grid = compute_grid([D.ravel(), *[f for f in function.T]])
79
+ filtration_values = [D.ravel(), *[f for f in function.T]]
80
+ grid = compute_grid(filtration_values)
81
81
  st = st.grid_squeeze(grid)
82
82
  return st
83
83
 
@@ -124,8 +124,7 @@ def compute_grid(
124
124
  except TypeError:
125
125
  pass
126
126
 
127
- if api is npapi:
128
- return _compute_grid_numpy(
127
+ grid = _compute_grid_numpy(
129
128
  initial_grid,
130
129
  resolution=resolution,
131
130
  strategy = strategy,
@@ -133,9 +132,9 @@ def compute_grid(
133
132
  _q_factor=_q_factor,
134
133
  drop_quantiles=drop_quantiles,
135
134
  dense = dense,
136
- )
137
- from multipers.torch.diff_grids import get_grid
138
- grid = get_grid(strategy)(initial_grid,resolution)
135
+ )
136
+ # from multipers.torch.diff_grids import get_grid
137
+ # grid = get_grid(strategy)(initial_grid,resolution)
139
138
  if dense:
140
139
  grid = todense(grid)
141
140
  return grid
@@ -169,7 +168,7 @@ def _compute_grid_numpy(
169
168
  Iterable[array[float, ndim=1]] : the 1d-grid for each parameter.
170
169
  """
171
170
  num_parameters = len(filtrations_values)
172
- api = api_from_tensors(filtrations_values)
171
+ api = api_from_tensors(*filtrations_values)
173
172
  try:
174
173
  a,b=drop_quantiles
175
174
  except:
@@ -189,7 +188,7 @@ def _compute_grid_numpy(
189
188
  elif strategy == "quantile":
190
189
  F = tuple(api.unique(f) for f in filtrations_values)
191
190
  max_resolution = [min(len(f),r) for f,r in zip(F,resolution)]
192
- F = tuple( api.quantile_closest(f, q=np.linspace(0,1,num=int(r*_q_factor)), axis=0) for f,r in zip(F, resolution) )
191
+ F = tuple( api.quantile_closest(f, q=api.linspace(0,1,int(r*_q_factor)), axis=0) for f,r in zip(F, resolution) )
193
192
  if unique:
194
193
  F = tuple(api.unique(f) for f in F)
195
194
  if np.all(np.asarray(max_resolution) > np.asarray([len(f) for f in F])):
@@ -203,7 +202,7 @@ def _compute_grid_numpy(
203
202
  # elif strategy == "torch_regular_closest":
204
203
  # F = tuple(_torch_regular_closest(f,r, unique) for f,r in zip(filtrations_values, resolution))
205
204
  elif strategy == "partition":
206
- F = tuple(_todo_partition(f,r, unique) for f,r in zip(filtrations_values, resolution))
205
+ F = tuple(_todo_partition(f,r, unique, api) for f,r in zip(filtrations_values, resolution))
207
206
  elif strategy == "precomputed":
208
207
  F=filtrations_values
209
208
  else:
@@ -215,7 +214,7 @@ def _compute_grid_numpy(
215
214
  def todense(grid, bool product_order=False):
216
215
  if len(grid) == 0:
217
216
  return np.empty(0)
218
- api = api_from_tensors(grid)
217
+ api = api_from_tensors(*grid)
219
218
  # if product_order:
220
219
  # if not api.backend ==np:
221
220
  # raise NotImplementedError("only numpy here.")
@@ -235,8 +234,10 @@ def todense(grid, bool product_order=False):
235
234
 
236
235
 
237
236
 
238
- ## TODO : optimize. Pykeops ?
239
237
  def _todo_regular(f, int r, api):
238
+ if api.has_grad(f):
239
+ from warnings import warn
240
+ warn("`strategy=regular` is not differentiable. Removing grad.")
240
241
  with api.no_grad():
241
242
  return api.linspace(api.min(f), api.max(f), r)
242
243
 
@@ -284,8 +285,14 @@ def _todo_regular_left_old(some_float[:] f, int r, bool unique):
284
285
  if unique: f_regular_closest = np.unique(f_regular_closest)
285
286
  return f_regular_closest
286
287
 
288
+ def _todo_partition(x, int resolution, bool unique, api):
289
+ if api.has_grad(x):
290
+ from warnings import warn
291
+ warn("`strategy=partition` is not differentiable. Removing grad.")
292
+ out = _todo_partition_(api.asnumpy(x), resolution, unique)
293
+ return api.from_numpy(out)
287
294
 
288
- def _todo_partition(some_float[:] data,int resolution, bool unique):
295
+ def _todo_partition_(some_float[:] data,int resolution, bool unique):
289
296
  if data.shape[0] < resolution: resolution=data.shape[0]
290
297
  k = data.shape[0] // resolution
291
298
  partitions = np.partition(data, k)
@@ -805,7 +805,7 @@ class Multi_critical_filtration {
805
805
  res.add_generator(nf);
806
806
  }
807
807
  }
808
- swap(f1, res);
808
+ std::swap(f1, res);
809
809
 
810
810
  return f1 != res;
811
811
  }
@@ -81,7 +81,8 @@ def _plot_signed_measure_4(
81
81
  **plt_kwargs, # ignored ftm
82
82
  ):
83
83
  # compute the maximal rectangle area
84
- pts = np.clip(pts, a_min=-np.inf, a_max=np.array((*threshold, *threshold))[None, :])
84
+ pts = np.clip(pts, a_min=-np.inf,
85
+ a_max=np.array((*threshold, *threshold))[None, :])
85
86
  alpha_rescaling = 0
86
87
  for rectangle, weight in zip(pts, weights):
87
88
  if rectangle[2] >= x_smoothing * rectangle[0]:
@@ -170,7 +171,8 @@ def plot_signed_measures(signed_measures, threshold=None, size=4):
170
171
  nrows=1, ncols=num_degrees, figsize=(num_degrees * size, size)
171
172
  )
172
173
  for ax, signed_measure in zip(axes, signed_measures):
173
- plot_signed_measure(signed_measure=signed_measure, ax=ax, threshold=threshold)
174
+ plot_signed_measure(signed_measure=signed_measure,
175
+ ax=ax, threshold=threshold)
174
176
  plt.tight_layout()
175
177
 
176
178
 
@@ -200,13 +202,17 @@ def plot_surface(
200
202
  cmap = matplotlib.colormaps["gray_r"]
201
203
  else:
202
204
  cmap = _cmap
205
+ if discrete_surface or not contour:
206
+ # for shading="flat"
207
+ grid = [np.concatenate([g, [g[-1]*1.1 - .1*g[0]]]) for g in grid]
203
208
  if discrete_surface:
204
209
  if has_negative_values:
205
210
  bounds = np.arange(-5, 6, 1, dtype=int)
206
211
  else:
207
212
  bounds = np.arange(0, 11, 1, dtype=int)
208
213
  norm = matplotlib.colors.BoundaryNorm(bounds, cmap.N, extend="max")
209
- im = ax.pcolormesh(grid[0], grid[1], hf.T, cmap=cmap, norm=norm, **plt_args)
214
+ im = ax.pcolormesh(grid[0], grid[1], hf.T, cmap=cmap,
215
+ norm=norm, shading="flat", **plt_args)
210
216
  cbar = fig.colorbar(
211
217
  matplotlib.cm.ScalarMappable(cmap=cmap, norm=norm),
212
218
  spacing="proportional",
@@ -217,9 +223,11 @@ def plot_surface(
217
223
 
218
224
  if contour:
219
225
  levels = plt_args.pop("levels", 50)
220
- im = ax.contourf(grid[0], grid[1], hf.T, cmap=cmap, levels=levels, **plt_args)
226
+ im = ax.contourf(grid[0], grid[1], hf.T,
227
+ cmap=cmap, levels=levels, **plt_args)
221
228
  else:
222
- im = ax.pcolormesh(grid[0], grid[1], hf.T, cmap=cmap, **plt_args)
229
+ im = ax.pcolormesh(grid[0], grid[1], hf.T,
230
+ cmap=cmap, shading="flat", **plt_args)
223
231
  return im
224
232
 
225
233
 
@@ -314,25 +322,30 @@ def plot2d_PyModule(
314
322
  trivial_summand = False
315
323
  if shapely:
316
324
  list_of_rect.append(
317
- _rectangle_box(birth[0], birth[1], death[0], death[1])
325
+ _rectangle_box(
326
+ birth[0], birth[1], death[0], death[1])
318
327
  )
319
328
  else:
320
329
  list_of_rect.append(
321
- _rectangle(birth, death, cmap(i / n_summands), alpha)
330
+ _rectangle(birth, death, cmap(
331
+ i / n_summands), alpha)
322
332
  )
323
333
  if not (trivial_summand):
324
334
  if separated:
325
335
  fig, ax = plt.subplots()
326
- ax.set(xlim=[box[0][0], box[1][0]], ylim=[box[0][1], box[1][1]])
336
+ ax.set(xlim=[box[0][0], box[1][0]],
337
+ ylim=[box[0][1], box[1][1]])
327
338
  if shapely:
328
339
  summand_shape = union_all(list_of_rect)
329
340
  if type(summand_shape) is _Polygon:
330
341
  xs, ys = summand_shape.exterior.xy
331
- ax.fill(xs, ys, alpha=alpha, fc=cmap(i / n_summands), ec="None")
342
+ ax.fill(xs, ys, alpha=alpha, fc=cmap(
343
+ i / n_summands), ec="None")
332
344
  else:
333
345
  for polygon in summand_shape.geoms:
334
346
  xs, ys = polygon.exterior.xy
335
- ax.fill(xs, ys, alpha=alpha, fc=cmap(i / n_summands), ec="None")
347
+ ax.fill(xs, ys, alpha=alpha, fc=cmap(
348
+ i / n_summands), ec="None")
336
349
  else:
337
350
  for rectangle in list_of_rect:
338
351
  ax.add_patch(rectangle)
@@ -396,7 +409,8 @@ def plot_simplicial_complex(
396
409
  if len(s) == 2: # simplexe = segment
397
410
  xx = np.array([pts[a, 0] for a in s])
398
411
  yy = np.array([pts[a, 1] for a in s])
399
- plt.plot(xx, yy, c=color(density), alpha=1, zorder=10 * density, lw=1.5)
412
+ plt.plot(xx, yy, c=color(density), alpha=1,
413
+ zorder=10 * density, lw=1.5)
400
414
  if len(s) == 3: # simplexe = triangle
401
415
  xx = np.array([pts[a, 0] for a in s])
402
416
  yy = np.array([pts[a, 1] for a in s])
@@ -117,8 +117,8 @@ cdef extern from "Simplex_tree_multi_interface.h" namespace "Gudhi::multiparamet
117
117
  void to_std(intptr_t, Line[double],int ) nogil
118
118
  void to_std_linear_projection(intptr_t, vector[double]) nogil
119
119
  void squeeze_filtration_inplace(vector[vector[double]] &, bool) nogil
120
- void squeeze_filtration(intptr_t, vector[vector[double]] &) nogil
121
- void unsqueeze_filtration(intptr_t, vector[vector[double]] &) nogil
120
+ void squeeze_filtration(intptr_t, vector[vector[double]] &) except + nogil
121
+ void unsqueeze_filtration(intptr_t, vector[vector[double]] &) except + nogil
122
122
  vector[vector[vector[value_type]]] get_filtration_values(const vector[int]&) nogil
123
123
 
124
124
 
@@ -625,6 +625,41 @@ cdef class SimplexTreeMulti_KFi32:
625
625
  """
626
626
  return self.get_ptr().prune_above_dimension(dimension)
627
627
 
628
+ def expansion(self, int max_dim)->SimplexTreeMulti_KFi32:
629
+ """Expands the simplex tree containing only its one skeleton
630
+ until dimension max_dim.
631
+
632
+ The expanded simplicial complex until dimension :math:`d`
633
+ attached to a graph :math:`G` is the maximal simplicial complex of
634
+ dimension at most :math:`d` admitting the graph :math:`G` as
635
+ :math:`1`-skeleton.
636
+ The filtration value assigned to a simplex is the maximal filtration
637
+ value of one of its edges.
638
+
639
+ The simplex tree must contain no simplex of dimension bigger than
640
+ 1 when calling the method.
641
+
642
+ :param max_dim: The maximal dimension.
643
+ :type max_dim: int
644
+ """
645
+ with nogil:
646
+ self.get_ptr().expansion(max_dim)
647
+ # This is a fix for multipersistence. FIXME expansion in c++
648
+ self.get_ptr().make_filtration_non_decreasing()
649
+ return self
650
+
651
+ def make_filtration_non_decreasing(self)->bool:
652
+ """This function ensures that each simplex has a higher filtration
653
+ value than its faces by increasing the filtration values.
654
+
655
+ :returns: True if any filtration value was modified,
656
+ False if the filtration was already non-decreasing.
657
+ :rtype: bool
658
+ """
659
+ cdef bool out
660
+ with nogil:
661
+ out = self.get_ptr().make_filtration_non_decreasing()
662
+ return out
628
663
 
629
664
  def reset_filtration(self, filtration, min_dim = 0)->SimplexTreeMulti_KFi32:
630
665
  """This function resets the filtration value of all the simplices of dimension at least min_dim. Resets all the
@@ -3217,6 +3252,41 @@ cdef class SimplexTreeMulti_KFi64:
3217
3252
  """
3218
3253
  return self.get_ptr().prune_above_dimension(dimension)
3219
3254
 
3255
+ def expansion(self, int max_dim)->SimplexTreeMulti_KFi64:
3256
+ """Expands the simplex tree containing only its one skeleton
3257
+ until dimension max_dim.
3258
+
3259
+ The expanded simplicial complex until dimension :math:`d`
3260
+ attached to a graph :math:`G` is the maximal simplicial complex of
3261
+ dimension at most :math:`d` admitting the graph :math:`G` as
3262
+ :math:`1`-skeleton.
3263
+ The filtration value assigned to a simplex is the maximal filtration
3264
+ value of one of its edges.
3265
+
3266
+ The simplex tree must contain no simplex of dimension bigger than
3267
+ 1 when calling the method.
3268
+
3269
+ :param max_dim: The maximal dimension.
3270
+ :type max_dim: int
3271
+ """
3272
+ with nogil:
3273
+ self.get_ptr().expansion(max_dim)
3274
+ # This is a fix for multipersistence. FIXME expansion in c++
3275
+ self.get_ptr().make_filtration_non_decreasing()
3276
+ return self
3277
+
3278
+ def make_filtration_non_decreasing(self)->bool:
3279
+ """This function ensures that each simplex has a higher filtration
3280
+ value than its faces by increasing the filtration values.
3281
+
3282
+ :returns: True if any filtration value was modified,
3283
+ False if the filtration was already non-decreasing.
3284
+ :rtype: bool
3285
+ """
3286
+ cdef bool out
3287
+ with nogil:
3288
+ out = self.get_ptr().make_filtration_non_decreasing()
3289
+ return out
3220
3290
 
3221
3291
  def reset_filtration(self, filtration, min_dim = 0)->SimplexTreeMulti_KFi64:
3222
3292
  """This function resets the filtration value of all the simplices of dimension at least min_dim. Resets all the
@@ -5809,6 +5879,41 @@ cdef class SimplexTreeMulti_KFf32:
5809
5879
  """
5810
5880
  return self.get_ptr().prune_above_dimension(dimension)
5811
5881
 
5882
+ def expansion(self, int max_dim)->SimplexTreeMulti_KFf32:
5883
+ """Expands the simplex tree containing only its one skeleton
5884
+ until dimension max_dim.
5885
+
5886
+ The expanded simplicial complex until dimension :math:`d`
5887
+ attached to a graph :math:`G` is the maximal simplicial complex of
5888
+ dimension at most :math:`d` admitting the graph :math:`G` as
5889
+ :math:`1`-skeleton.
5890
+ The filtration value assigned to a simplex is the maximal filtration
5891
+ value of one of its edges.
5892
+
5893
+ The simplex tree must contain no simplex of dimension bigger than
5894
+ 1 when calling the method.
5895
+
5896
+ :param max_dim: The maximal dimension.
5897
+ :type max_dim: int
5898
+ """
5899
+ with nogil:
5900
+ self.get_ptr().expansion(max_dim)
5901
+ # This is a fix for multipersistence. FIXME expansion in c++
5902
+ self.get_ptr().make_filtration_non_decreasing()
5903
+ return self
5904
+
5905
+ def make_filtration_non_decreasing(self)->bool:
5906
+ """This function ensures that each simplex has a higher filtration
5907
+ value than its faces by increasing the filtration values.
5908
+
5909
+ :returns: True if any filtration value was modified,
5910
+ False if the filtration was already non-decreasing.
5911
+ :rtype: bool
5912
+ """
5913
+ cdef bool out
5914
+ with nogil:
5915
+ out = self.get_ptr().make_filtration_non_decreasing()
5916
+ return out
5812
5917
 
5813
5918
  def reset_filtration(self, filtration, min_dim = 0)->SimplexTreeMulti_KFf32:
5814
5919
  """This function resets the filtration value of all the simplices of dimension at least min_dim. Resets all the
@@ -8401,6 +8506,41 @@ cdef class SimplexTreeMulti_KFf64:
8401
8506
  """
8402
8507
  return self.get_ptr().prune_above_dimension(dimension)
8403
8508
 
8509
+ def expansion(self, int max_dim)->SimplexTreeMulti_KFf64:
8510
+ """Expands the simplex tree containing only its one skeleton
8511
+ until dimension max_dim.
8512
+
8513
+ The expanded simplicial complex until dimension :math:`d`
8514
+ attached to a graph :math:`G` is the maximal simplicial complex of
8515
+ dimension at most :math:`d` admitting the graph :math:`G` as
8516
+ :math:`1`-skeleton.
8517
+ The filtration value assigned to a simplex is the maximal filtration
8518
+ value of one of its edges.
8519
+
8520
+ The simplex tree must contain no simplex of dimension bigger than
8521
+ 1 when calling the method.
8522
+
8523
+ :param max_dim: The maximal dimension.
8524
+ :type max_dim: int
8525
+ """
8526
+ with nogil:
8527
+ self.get_ptr().expansion(max_dim)
8528
+ # This is a fix for multipersistence. FIXME expansion in c++
8529
+ self.get_ptr().make_filtration_non_decreasing()
8530
+ return self
8531
+
8532
+ def make_filtration_non_decreasing(self)->bool:
8533
+ """This function ensures that each simplex has a higher filtration
8534
+ value than its faces by increasing the filtration values.
8535
+
8536
+ :returns: True if any filtration value was modified,
8537
+ False if the filtration was already non-decreasing.
8538
+ :rtype: bool
8539
+ """
8540
+ cdef bool out
8541
+ with nogil:
8542
+ out = self.get_ptr().make_filtration_non_decreasing()
8543
+ return out
8404
8544
 
8405
8545
  def reset_filtration(self, filtration, min_dim = 0)->SimplexTreeMulti_KFf64:
8406
8546
  """This function resets the filtration value of all the simplices of dimension at least min_dim. Resets all the
@@ -869,7 +869,6 @@ cdef class SimplexTreeMulti_{{FSHORT}}:
869
869
  """
870
870
  return self.get_ptr().prune_above_dimension(dimension)
871
871
 
872
- {{if not is_kcritical}}
873
872
  def expansion(self, int max_dim)->SimplexTreeMulti_{{FSHORT}}:
874
873
  """Expands the simplex tree containing only its one skeleton
875
874
  until dimension max_dim.
@@ -905,7 +904,6 @@ cdef class SimplexTreeMulti_{{FSHORT}}:
905
904
  with nogil:
906
905
  out = self.get_ptr().make_filtration_non_decreasing()
907
906
  return out
908
- {{endif}}
909
907
 
910
908
  def reset_filtration(self, filtration, min_dim = 0)->SimplexTreeMulti_{{FSHORT}}:
911
909
  """This function resets the filtration value of all the simplices of dimension at least min_dim. Resets all the
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multipers
3
- Version: 2.3.3b7
3
+ Version: 2.3.4
4
4
  Summary: Multiparameter Topological Persistence for Machine Learning
5
5
  Author-email: David Loiseaux <david.lapous@proton.me>, Hannah Schreiber <hannah.schreiber@inria.fr>
6
6
  Maintainer-email: David Loiseaux <david.lapous@proton.me>
@@ -44,7 +44,7 @@ This library aims to provide easy to use and performant strategies for applied m
44
44
  ## Compiled packages
45
45
  | Source | Version | Downloads | Platforms |
46
46
  | --- | --- | --- | --- |
47
- | [![Conda Recipe](https://img.shields.io/badge/conda-recipe-green.svg)](https://anaconda.org/conda-forge/multipers)| [![Conda Version](https://img.shields.io/conda/vn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |
47
+ | [![Conda Recipe](https://img.shields.io/badge/conda-recipe-green.svg)](https://github.com/conda-forge/multipers-feedstock)| [![Conda Version](https://img.shields.io/conda/vn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/multipers.svg)](https://anaconda.org/conda-forge/multipers) |
48
48
  | [![pip Recipe](https://img.shields.io/badge/pip-package-green.svg)](https:///pypi.org/project/multipers) | [![PyPI](https://img.shields.io/pypi/v/multipers?color=green)](https://pypi.org/project/multipers) | [![ pip downloads](https://static.pepy.tech/badge/multipers)](https://pepy.tech/project/multipers) | |
49
49
 
50
50
 
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
9
9
 
10
10
  [project]
11
11
  name = "multipers"
12
- version = "2.3.3b7"
12
+ version = "2.3.4"
13
13
  description = "Multiparameter Topological Persistence for Machine Learning"
14
14
  readme = "README.md"
15
15
  authors = [
@@ -1,8 +1,8 @@
1
1
  import numpy as np
2
2
  import pytest
3
3
 
4
- import multipers.grids as mpg
5
4
  import multipers as mp
5
+ import multipers.grids as mpg
6
6
 
7
7
  try:
8
8
  import torch
@@ -57,8 +57,8 @@ def test_regular_left():
57
57
  y,
58
58
  [
59
59
  0.0,
60
- .1,
61
- .21,
60
+ 0.1,
61
+ 0.21,
62
62
  1,
63
63
  ],
64
64
  ).all(), y
@@ -68,9 +68,38 @@ def test_regular_left():
68
68
  y_torch = torchapi.from_numpy(y)
69
69
  assert torch.allclose(
70
70
  y_torch,
71
- torch.tensor(
72
- [0.0, 0.1, 0.21, 1.0], dtype=torch.float32
73
- ),
71
+ torch.tensor([0.0, 0.1, 0.21, 1.0], dtype=torch.float32),
74
72
  ), y_torch
75
73
  else:
76
74
  pytest.skip("Skipping test as torch is not available.")
75
+
76
+
77
+ def test_sanity_numpy():
78
+ for k in range(2, 4):
79
+ img = np.random.random(size=(50, 50, k))
80
+ s = mp.filtrations.Cubical(img)
81
+ for strat in mp.grids.available_strategies:
82
+ _s = s.grid_squeeze(
83
+ strategy=strat, resolution=None if strat == "exact" else 10
84
+ )
85
+ f = _s.filtration_grid[0]
86
+ if strat not in ["exact", "precomputed"]:
87
+ assert len(f) <= 10, f"invalid resolution for {strat=}"
88
+
89
+
90
+ @pytest.mark.skipif(torch is None, reason="Torch not installed.")
91
+ def test_sanity_torch():
92
+ import torch
93
+
94
+ for k in range(2, 4):
95
+ img = torch.rand(size=(50, 50, k)).requires_grad_()
96
+ s = mp.filtrations.Cubical(img)
97
+ for strat in mp.grids.available_strategies:
98
+ _s = s.grid_squeeze(
99
+ strategy=strat, resolution=None if strat == "exact" else 10
100
+ )
101
+ f = _s.filtration_grid[0]
102
+ if strat not in ["regular", "partition"]:
103
+ assert f.requires_grad, f"Grad not working for {strat=}"
104
+ if strat not in ["exact", "precomputed"]:
105
+ assert len(f) <= 10, f"invalid resolution for {strat=}"
File without changes
File without changes