multipers 2.3.2__cp310-cp310-win_amd64.whl → 2.3.3__cp310-cp310-win_amd64.whl

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

Potentially problematic release.


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

Files changed (35) hide show
  1. multipers/_signed_measure_meta.py +22 -8
  2. multipers/array_api/__init__.py +25 -2
  3. multipers/array_api/numpy.py +70 -0
  4. multipers/array_api/torch.py +82 -0
  5. multipers/filtrations/density.py +11 -52
  6. multipers/filtrations/filtrations.py +21 -8
  7. multipers/function_rips.cp310-win_amd64.pyd +0 -0
  8. multipers/grids.cp310-win_amd64.pyd +0 -0
  9. multipers/grids.pyx +91 -43
  10. multipers/gudhi/gudhi/Multi_critical_filtration.h +1 -1
  11. multipers/io.cp310-win_amd64.pyd +0 -0
  12. multipers/ml/signed_measures.py +106 -26
  13. multipers/mma_structures.cp310-win_amd64.pyd +0 -0
  14. multipers/mma_structures.pyx +2 -2
  15. multipers/mma_structures.pyx.tp +1 -1
  16. multipers/multiparameter_module_approximation.cp310-win_amd64.pyd +0 -0
  17. multipers/plots.py +164 -37
  18. multipers/point_measure.cp310-win_amd64.pyd +0 -0
  19. multipers/point_measure.pyx +71 -2
  20. multipers/simplex_tree_multi.cp310-win_amd64.pyd +0 -0
  21. multipers/simplex_tree_multi.pxd +2 -2
  22. multipers/simplex_tree_multi.pyx +164 -8
  23. multipers/simplex_tree_multi.pyx.tp +3 -3
  24. multipers/slicer.cp310-win_amd64.pyd +0 -0
  25. multipers/slicer.pyx +56 -55
  26. multipers/slicer.pyx.tp +5 -4
  27. multipers/tbb12.dll +0 -0
  28. multipers/tbbbind_2_5.dll +0 -0
  29. multipers/tbbmalloc.dll +0 -0
  30. multipers/tbbmalloc_proxy.dll +0 -0
  31. {multipers-2.3.2.dist-info → multipers-2.3.3.dist-info}/METADATA +6 -1
  32. {multipers-2.3.2.dist-info → multipers-2.3.3.dist-info}/RECORD +35 -35
  33. {multipers-2.3.2.dist-info → multipers-2.3.3.dist-info}/WHEEL +1 -1
  34. {multipers-2.3.2.dist-info → multipers-2.3.3.dist-info}/licenses/LICENSE +0 -0
  35. {multipers-2.3.2.dist-info → multipers-2.3.3.dist-info}/top_level.txt +0 -0
@@ -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
@@ -883,6 +918,8 @@ cdef class SimplexTreeMulti_KFi32:
883
918
  bool coordinate_values=True,
884
919
  bool force=False,
885
920
  str strategy:_available_strategies = "exact",
921
+ resolution:Optional[int|list[int]] = None,
922
+ bool coordinates = False,
886
923
  grid_strategy=None,
887
924
  bool inplace=False,
888
925
  **filtration_grid_kwargs
@@ -910,7 +947,7 @@ cdef class SimplexTreeMulti_KFi32:
910
947
 
911
948
  #TODO : multi-critical
912
949
  if filtration_grid is None:
913
- filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
950
+ filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
914
951
  else:
915
952
  filtration_grid = sanitize_grid(filtration_grid)
916
953
  if len(filtration_grid) != self.num_parameters:
@@ -2322,6 +2359,8 @@ cdef class SimplexTreeMulti_Fi32:
2322
2359
  bool coordinate_values=True,
2323
2360
  bool force=False,
2324
2361
  str strategy:_available_strategies = "exact",
2362
+ resolution:Optional[int|list[int]] = None,
2363
+ bool coordinates = False,
2325
2364
  grid_strategy=None,
2326
2365
  bool inplace=False,
2327
2366
  **filtration_grid_kwargs
@@ -2349,7 +2388,7 @@ cdef class SimplexTreeMulti_Fi32:
2349
2388
 
2350
2389
  #TODO : multi-critical
2351
2390
  if filtration_grid is None:
2352
- filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
2391
+ filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
2353
2392
  else:
2354
2393
  filtration_grid = sanitize_grid(filtration_grid)
2355
2394
  if len(filtration_grid) != self.num_parameters:
@@ -3213,6 +3252,41 @@ cdef class SimplexTreeMulti_KFi64:
3213
3252
  """
3214
3253
  return self.get_ptr().prune_above_dimension(dimension)
3215
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
3216
3290
 
3217
3291
  def reset_filtration(self, filtration, min_dim = 0)->SimplexTreeMulti_KFi64:
3218
3292
  """This function resets the filtration value of all the simplices of dimension at least min_dim. Resets all the
@@ -3471,6 +3545,8 @@ cdef class SimplexTreeMulti_KFi64:
3471
3545
  bool coordinate_values=True,
3472
3546
  bool force=False,
3473
3547
  str strategy:_available_strategies = "exact",
3548
+ resolution:Optional[int|list[int]] = None,
3549
+ bool coordinates = False,
3474
3550
  grid_strategy=None,
3475
3551
  bool inplace=False,
3476
3552
  **filtration_grid_kwargs
@@ -3498,7 +3574,7 @@ cdef class SimplexTreeMulti_KFi64:
3498
3574
 
3499
3575
  #TODO : multi-critical
3500
3576
  if filtration_grid is None:
3501
- filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
3577
+ filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
3502
3578
  else:
3503
3579
  filtration_grid = sanitize_grid(filtration_grid)
3504
3580
  if len(filtration_grid) != self.num_parameters:
@@ -4910,6 +4986,8 @@ cdef class SimplexTreeMulti_Fi64:
4910
4986
  bool coordinate_values=True,
4911
4987
  bool force=False,
4912
4988
  str strategy:_available_strategies = "exact",
4989
+ resolution:Optional[int|list[int]] = None,
4990
+ bool coordinates = False,
4913
4991
  grid_strategy=None,
4914
4992
  bool inplace=False,
4915
4993
  **filtration_grid_kwargs
@@ -4937,7 +5015,7 @@ cdef class SimplexTreeMulti_Fi64:
4937
5015
 
4938
5016
  #TODO : multi-critical
4939
5017
  if filtration_grid is None:
4940
- filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
5018
+ filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
4941
5019
  else:
4942
5020
  filtration_grid = sanitize_grid(filtration_grid)
4943
5021
  if len(filtration_grid) != self.num_parameters:
@@ -5801,6 +5879,41 @@ cdef class SimplexTreeMulti_KFf32:
5801
5879
  """
5802
5880
  return self.get_ptr().prune_above_dimension(dimension)
5803
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
5804
5917
 
5805
5918
  def reset_filtration(self, filtration, min_dim = 0)->SimplexTreeMulti_KFf32:
5806
5919
  """This function resets the filtration value of all the simplices of dimension at least min_dim. Resets all the
@@ -6059,6 +6172,8 @@ cdef class SimplexTreeMulti_KFf32:
6059
6172
  bool coordinate_values=True,
6060
6173
  bool force=False,
6061
6174
  str strategy:_available_strategies = "exact",
6175
+ resolution:Optional[int|list[int]] = None,
6176
+ bool coordinates = False,
6062
6177
  grid_strategy=None,
6063
6178
  bool inplace=False,
6064
6179
  **filtration_grid_kwargs
@@ -6086,7 +6201,7 @@ cdef class SimplexTreeMulti_KFf32:
6086
6201
 
6087
6202
  #TODO : multi-critical
6088
6203
  if filtration_grid is None:
6089
- filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
6204
+ filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
6090
6205
  else:
6091
6206
  filtration_grid = sanitize_grid(filtration_grid)
6092
6207
  if len(filtration_grid) != self.num_parameters:
@@ -7498,6 +7613,8 @@ cdef class SimplexTreeMulti_Ff32:
7498
7613
  bool coordinate_values=True,
7499
7614
  bool force=False,
7500
7615
  str strategy:_available_strategies = "exact",
7616
+ resolution:Optional[int|list[int]] = None,
7617
+ bool coordinates = False,
7501
7618
  grid_strategy=None,
7502
7619
  bool inplace=False,
7503
7620
  **filtration_grid_kwargs
@@ -7525,7 +7642,7 @@ cdef class SimplexTreeMulti_Ff32:
7525
7642
 
7526
7643
  #TODO : multi-critical
7527
7644
  if filtration_grid is None:
7528
- filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
7645
+ filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
7529
7646
  else:
7530
7647
  filtration_grid = sanitize_grid(filtration_grid)
7531
7648
  if len(filtration_grid) != self.num_parameters:
@@ -8389,6 +8506,41 @@ cdef class SimplexTreeMulti_KFf64:
8389
8506
  """
8390
8507
  return self.get_ptr().prune_above_dimension(dimension)
8391
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
8392
8544
 
8393
8545
  def reset_filtration(self, filtration, min_dim = 0)->SimplexTreeMulti_KFf64:
8394
8546
  """This function resets the filtration value of all the simplices of dimension at least min_dim. Resets all the
@@ -8647,6 +8799,8 @@ cdef class SimplexTreeMulti_KFf64:
8647
8799
  bool coordinate_values=True,
8648
8800
  bool force=False,
8649
8801
  str strategy:_available_strategies = "exact",
8802
+ resolution:Optional[int|list[int]] = None,
8803
+ bool coordinates = False,
8650
8804
  grid_strategy=None,
8651
8805
  bool inplace=False,
8652
8806
  **filtration_grid_kwargs
@@ -8674,7 +8828,7 @@ cdef class SimplexTreeMulti_KFf64:
8674
8828
 
8675
8829
  #TODO : multi-critical
8676
8830
  if filtration_grid is None:
8677
- filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
8831
+ filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
8678
8832
  else:
8679
8833
  filtration_grid = sanitize_grid(filtration_grid)
8680
8834
  if len(filtration_grid) != self.num_parameters:
@@ -10086,6 +10240,8 @@ cdef class SimplexTreeMulti_Ff64:
10086
10240
  bool coordinate_values=True,
10087
10241
  bool force=False,
10088
10242
  str strategy:_available_strategies = "exact",
10243
+ resolution:Optional[int|list[int]] = None,
10244
+ bool coordinates = False,
10089
10245
  grid_strategy=None,
10090
10246
  bool inplace=False,
10091
10247
  **filtration_grid_kwargs
@@ -10113,7 +10269,7 @@ cdef class SimplexTreeMulti_Ff64:
10113
10269
 
10114
10270
  #TODO : multi-critical
10115
10271
  if filtration_grid is None:
10116
- filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
10272
+ filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
10117
10273
  else:
10118
10274
  filtration_grid = sanitize_grid(filtration_grid)
10119
10275
  if len(filtration_grid) != self.num_parameters:
@@ -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
@@ -1330,6 +1328,8 @@ cdef class SimplexTreeMulti_{{FSHORT}}:
1330
1328
  bool coordinate_values=True,
1331
1329
  bool force=False,
1332
1330
  str strategy:_available_strategies = "exact",
1331
+ resolution:Optional[int|list[int]] = None,
1332
+ bool coordinates = False,
1333
1333
  grid_strategy=None,
1334
1334
  bool inplace=False,
1335
1335
  **filtration_grid_kwargs
@@ -1357,7 +1357,7 @@ cdef class SimplexTreeMulti_{{FSHORT}}:
1357
1357
 
1358
1358
  #TODO : multi-critical
1359
1359
  if filtration_grid is None:
1360
- filtration_grid = self.get_filtration_grid(grid_strategy=strategy, **filtration_grid_kwargs)
1360
+ filtration_grid = self.get_filtration_grid(grid_strategy=strategy, resolution=resolution, **filtration_grid_kwargs)
1361
1361
  else:
1362
1362
  filtration_grid = sanitize_grid(filtration_grid)
1363
1363
  if len(filtration_grid) != self.num_parameters:
Binary file