multipers 2.3.3b1__cp311-cp311-win_amd64.whl → 2.3.3b3__cp311-cp311-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.
- multipers/array_api/__init__.py +4 -0
- multipers/function_rips.cp311-win_amd64.pyd +0 -0
- multipers/grids.cp311-win_amd64.pyd +0 -0
- multipers/io.cp311-win_amd64.pyd +0 -0
- multipers/ml/signed_measures.py +4 -2
- multipers/mma_structures.cp311-win_amd64.pyd +0 -0
- multipers/multiparameter_module_approximation.cp311-win_amd64.pyd +0 -0
- multipers/plots.py +45 -37
- multipers/point_measure.cp311-win_amd64.pyd +0 -0
- multipers/simplex_tree_multi.cp311-win_amd64.pyd +0 -0
- multipers/slicer.cp311-win_amd64.pyd +0 -0
- multipers/slicer.pxd +20 -20
- multipers/slicer.pyx +23 -23
- multipers/slicer.pyx.tp +3 -3
- {multipers-2.3.3b1.dist-info → multipers-2.3.3b3.dist-info}/METADATA +6 -1
- {multipers-2.3.3b1.dist-info → multipers-2.3.3b3.dist-info}/RECORD +19 -19
- {multipers-2.3.3b1.dist-info → multipers-2.3.3b3.dist-info}/WHEEL +0 -0
- {multipers-2.3.3b1.dist-info → multipers-2.3.3b3.dist-info}/licenses/LICENSE +0 -0
- {multipers-2.3.3b1.dist-info → multipers-2.3.3b3.dist-info}/top_level.txt +0 -0
multipers/array_api/__init__.py
CHANGED
|
Binary file
|
|
Binary file
|
multipers/io.cp311-win_amd64.pyd
CHANGED
|
Binary file
|
multipers/ml/signed_measures.py
CHANGED
|
@@ -758,6 +758,8 @@ class SignedMeasureFormatter(BaseEstimator, TransformerMixin):
|
|
|
758
758
|
) = self._get_filtration_bounds(X, axis=ax)
|
|
759
759
|
self._filtrations_bounds.append(filtration_bounds)
|
|
760
760
|
self._normalization_factors.append(normalization_factors)
|
|
761
|
+
self._filtrations_bounds = self._backend.astensor(self._filtrations_bounds)
|
|
762
|
+
self._normalization_factors = self._backend.astensor(self._normalization_factors)
|
|
761
763
|
# else:
|
|
762
764
|
# (
|
|
763
765
|
# self._filtrations_bounds,
|
|
@@ -782,9 +784,9 @@ class SignedMeasureFormatter(BaseEstimator, TransformerMixin):
|
|
|
782
784
|
]
|
|
783
785
|
# axis, filtration_values
|
|
784
786
|
filtration_values = [
|
|
785
|
-
compute_grid(
|
|
787
|
+
self._backend.astensor(compute_grid(
|
|
786
788
|
f_ax.T, resolution=self.resolution, strategy=self.grid_strategy
|
|
787
|
-
)
|
|
789
|
+
))
|
|
788
790
|
for f_ax in filtration_values
|
|
789
791
|
]
|
|
790
792
|
self._infered_grids = filtration_values
|
|
Binary file
|
|
Binary file
|
multipers/plots.py
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
|
+
from warnings import warn
|
|
2
3
|
|
|
3
4
|
import matplotlib.pyplot as plt
|
|
4
5
|
import numpy as np
|
|
5
6
|
from numpy.typing import ArrayLike
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
import torch
|
|
9
|
-
|
|
10
|
-
istensor = torch.is_tensor
|
|
11
|
-
except ImportError:
|
|
12
|
-
istensor = lambda x: False
|
|
8
|
+
from multipers.array_api import to_numpy
|
|
13
9
|
|
|
14
10
|
|
|
15
11
|
def _plot_rectangle(rectangle: np.ndarray, weight, **plt_kwargs):
|
|
@@ -124,11 +120,8 @@ def plot_signed_measure(signed_measure, threshold=None, ax=None, **plt_kwargs):
|
|
|
124
120
|
else:
|
|
125
121
|
plt.sca(ax)
|
|
126
122
|
pts, weights = signed_measure
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if istensor(weights):
|
|
130
|
-
weights = weights.detach().numpy()
|
|
131
|
-
pts = np.asarray(pts)
|
|
123
|
+
pts = to_numpy(pts)
|
|
124
|
+
weights = to_numpy(weights)
|
|
132
125
|
num_pts = pts.shape[0]
|
|
133
126
|
num_parameters = pts.shape[1]
|
|
134
127
|
if threshold is None:
|
|
@@ -143,15 +136,6 @@ def plot_signed_measure(signed_measure, threshold=None, ax=None, **plt_kwargs):
|
|
|
143
136
|
threshold = np.max(
|
|
144
137
|
[threshold, [plt.gca().get_xlim()[1], plt.gca().get_ylim()[1]]], axis=0
|
|
145
138
|
)
|
|
146
|
-
if isinstance(pts, np.ndarray):
|
|
147
|
-
pass
|
|
148
|
-
else:
|
|
149
|
-
import torch
|
|
150
|
-
|
|
151
|
-
if isinstance(pts, torch.Tensor):
|
|
152
|
-
pts = pts.detach().numpy()
|
|
153
|
-
else:
|
|
154
|
-
raise Exception("Invalid measure type.")
|
|
155
139
|
|
|
156
140
|
assert num_parameters in (2, 4)
|
|
157
141
|
if num_parameters == 2:
|
|
@@ -260,7 +244,7 @@ def plot2d_PyModule(
|
|
|
260
244
|
dimension=-1,
|
|
261
245
|
separated=False,
|
|
262
246
|
min_persistence=0,
|
|
263
|
-
alpha=
|
|
247
|
+
alpha=None,
|
|
264
248
|
verbose=False,
|
|
265
249
|
save=False,
|
|
266
250
|
dpi=200,
|
|
@@ -278,12 +262,14 @@ def plot2d_PyModule(
|
|
|
278
262
|
|
|
279
263
|
shapely = True and shapely
|
|
280
264
|
except ImportError:
|
|
281
|
-
from warnings import warn
|
|
282
|
-
|
|
283
265
|
shapely = False
|
|
284
266
|
warn(
|
|
285
267
|
"Shapely not installed. Fallbacking to matplotlib. The plots may be inacurate."
|
|
286
268
|
)
|
|
269
|
+
if alpha is None:
|
|
270
|
+
alpha = 0.8 if shapely else 1
|
|
271
|
+
if not shapely and alpha != 1:
|
|
272
|
+
warn("Opacity without shapely will lead to incorect plots.")
|
|
287
273
|
cmap = (
|
|
288
274
|
matplotlib.colormaps["Spectral"] if cmap is None else matplotlib.colormaps[cmap]
|
|
289
275
|
)
|
|
@@ -373,22 +359,26 @@ def plot_simplicial_complex(
|
|
|
373
359
|
pts = np.asarray(pts)
|
|
374
360
|
values = np.array([-f[1] for s, f in st.get_skeleton(0)])
|
|
375
361
|
qs = np.quantile(values, np.linspace(0, 1, 100))
|
|
376
|
-
|
|
362
|
+
|
|
363
|
+
def color_idx(d):
|
|
364
|
+
return np.searchsorted(qs, d) / 100
|
|
377
365
|
|
|
378
366
|
from matplotlib.pyplot import get_cmap
|
|
379
367
|
|
|
380
|
-
color
|
|
368
|
+
def color(d):
|
|
369
|
+
return get_cmap("viridis")([0, color_idx(d), 1])[1]
|
|
370
|
+
|
|
381
371
|
cols_pc = np.asarray([color(v) for v in values])
|
|
382
372
|
ax = plt.gca()
|
|
383
|
-
for s, f in st:
|
|
373
|
+
for s, f in st: # simplexe, filtration
|
|
384
374
|
density = -f[1]
|
|
385
|
-
if len(s) <= 1 or f[0] > x or density < -y:
|
|
375
|
+
if len(s) <= 1 or f[0] > x or density < -y: # simplexe = point
|
|
386
376
|
continue
|
|
387
|
-
if len(s) == 2:
|
|
377
|
+
if len(s) == 2: # simplexe = segment
|
|
388
378
|
xx = np.array([pts[a, 0] for a in s])
|
|
389
379
|
yy = np.array([pts[a, 1] for a in s])
|
|
390
380
|
plt.plot(xx, yy, c=color(density), alpha=1, zorder=10 * density, lw=1.5)
|
|
391
|
-
if len(s) == 3:
|
|
381
|
+
if len(s) == 3: # simplexe = triangle
|
|
392
382
|
xx = np.array([pts[a, 0] for a in s])
|
|
393
383
|
yy = np.array([pts[a, 1] for a in s])
|
|
394
384
|
_c = color(density)
|
|
@@ -398,7 +388,19 @@ def plot_simplicial_complex(
|
|
|
398
388
|
return out
|
|
399
389
|
|
|
400
390
|
|
|
401
|
-
def plot_point_cloud(
|
|
391
|
+
def plot_point_cloud(
|
|
392
|
+
pts,
|
|
393
|
+
function,
|
|
394
|
+
x,
|
|
395
|
+
y,
|
|
396
|
+
mma=None,
|
|
397
|
+
degree=None,
|
|
398
|
+
ball_alpha=0.3,
|
|
399
|
+
point_cmap="viridis",
|
|
400
|
+
color_bias=1,
|
|
401
|
+
ball_color=None,
|
|
402
|
+
point_size=20,
|
|
403
|
+
):
|
|
402
404
|
if mma is not None:
|
|
403
405
|
fig, (a, b) = plt.subplots(ncols=2, figsize=(15, 5))
|
|
404
406
|
plt.sca(a)
|
|
@@ -413,17 +415,23 @@ def plot_point_cloud(pts, function, x, y, mma=None, degree=None):
|
|
|
413
415
|
plt.scatter([x], [y], c="r", zorder=10)
|
|
414
416
|
plt.text(x + 0.01 * (b - a), y + 0.01 * (d - c), f"({x},{y})")
|
|
415
417
|
return
|
|
416
|
-
values =
|
|
418
|
+
values = -function
|
|
417
419
|
qs = np.quantile(values, np.linspace(0, 1, 100))
|
|
418
|
-
|
|
419
|
-
|
|
420
|
+
|
|
421
|
+
def color_idx(d):
|
|
422
|
+
return np.searchsorted(qs, d * color_bias) / 100
|
|
423
|
+
|
|
420
424
|
from matplotlib.collections import PatchCollection
|
|
425
|
+
from matplotlib.pyplot import get_cmap
|
|
426
|
+
|
|
427
|
+
def color(d):
|
|
428
|
+
return get_cmap(point_cmap)([0, color_idx(d), 1])[1]
|
|
421
429
|
|
|
422
|
-
|
|
430
|
+
_colors = np.array([color(v) for v in values])
|
|
423
431
|
ax = plt.gca()
|
|
424
432
|
idx = function <= y
|
|
425
|
-
circles = [plt.Circle(pt, x
|
|
426
|
-
pc = PatchCollection(circles, alpha=
|
|
433
|
+
circles = [plt.Circle(pt, x) for pt, c in zip(pts[idx], function)]
|
|
434
|
+
pc = PatchCollection(circles, alpha=ball_alpha, color=ball_color)
|
|
427
435
|
ax.add_collection(pc)
|
|
428
|
-
plt.scatter(*pts.T, c
|
|
436
|
+
plt.scatter(*pts.T, c=_colors, s=point_size)
|
|
429
437
|
ax.set_aspect(1)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
multipers/slicer.pxd
CHANGED
|
@@ -2013,51 +2013,51 @@ cdef extern from "multiparameter_module_approximation/approximation.h" namespace
|
|
|
2013
2013
|
|
|
2014
2014
|
import multipers.slicer as mps
|
|
2015
2015
|
from cython.operator cimport dereference
|
|
2016
|
-
cdef inline Module[
|
|
2016
|
+
cdef inline Module[double] _multiparameter_module_approximation_f64(object slicer, One_critical_filtration[double] direction, double max_error, Box[double] box, bool threshold, bool complete, bool verbose):
|
|
2017
2017
|
import multipers.slicer as mps
|
|
2018
2018
|
cdef intptr_t slicer_ptr = <intptr_t>(slicer.get_ptr())
|
|
2019
|
-
cdef Module[
|
|
2019
|
+
cdef Module[double] mod
|
|
2020
2020
|
if False:
|
|
2021
2021
|
pass
|
|
2022
|
-
elif isinstance(slicer, mps.
|
|
2022
|
+
elif isinstance(slicer, mps._KSlicer_Matrix0_vine_f64):
|
|
2023
2023
|
with nogil:
|
|
2024
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2024
|
+
mod = multiparameter_module_approximation(dereference(<C_KSlicer_Matrix0_vine_f64*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2025
2025
|
return mod
|
|
2026
|
-
elif isinstance(slicer, mps.
|
|
2026
|
+
elif isinstance(slicer, mps._KSlicer_Matrix1_vine_f64):
|
|
2027
2027
|
with nogil:
|
|
2028
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2028
|
+
mod = multiparameter_module_approximation(dereference(<C_KSlicer_Matrix1_vine_f64*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2029
2029
|
return mod
|
|
2030
|
-
elif isinstance(slicer, mps.
|
|
2030
|
+
elif isinstance(slicer, mps._Slicer_Matrix0_vine_f64):
|
|
2031
2031
|
with nogil:
|
|
2032
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2032
|
+
mod = multiparameter_module_approximation(dereference(<C_Slicer_Matrix0_vine_f64*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2033
2033
|
return mod
|
|
2034
|
-
elif isinstance(slicer, mps.
|
|
2034
|
+
elif isinstance(slicer, mps._Slicer_Matrix1_vine_f64):
|
|
2035
2035
|
with nogil:
|
|
2036
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2036
|
+
mod = multiparameter_module_approximation(dereference(<C_Slicer_Matrix1_vine_f64*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2037
2037
|
return mod
|
|
2038
2038
|
else:
|
|
2039
2039
|
raise ValueError(f"Unsupported slicer type {type(slicer)}")
|
|
2040
|
-
cdef inline Module[
|
|
2040
|
+
cdef inline Module[float] _multiparameter_module_approximation_f32(object slicer, One_critical_filtration[float] direction, float max_error, Box[float] box, bool threshold, bool complete, bool verbose):
|
|
2041
2041
|
import multipers.slicer as mps
|
|
2042
2042
|
cdef intptr_t slicer_ptr = <intptr_t>(slicer.get_ptr())
|
|
2043
|
-
cdef Module[
|
|
2043
|
+
cdef Module[float] mod
|
|
2044
2044
|
if False:
|
|
2045
2045
|
pass
|
|
2046
|
-
elif isinstance(slicer, mps.
|
|
2046
|
+
elif isinstance(slicer, mps._KSlicer_Matrix0_vine_f32):
|
|
2047
2047
|
with nogil:
|
|
2048
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2048
|
+
mod = multiparameter_module_approximation(dereference(<C_KSlicer_Matrix0_vine_f32*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2049
2049
|
return mod
|
|
2050
|
-
elif isinstance(slicer, mps.
|
|
2050
|
+
elif isinstance(slicer, mps._KSlicer_Matrix1_vine_f32):
|
|
2051
2051
|
with nogil:
|
|
2052
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2052
|
+
mod = multiparameter_module_approximation(dereference(<C_KSlicer_Matrix1_vine_f32*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2053
2053
|
return mod
|
|
2054
|
-
elif isinstance(slicer, mps.
|
|
2054
|
+
elif isinstance(slicer, mps._Slicer_Matrix0_vine_f32):
|
|
2055
2055
|
with nogil:
|
|
2056
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2056
|
+
mod = multiparameter_module_approximation(dereference(<C_Slicer_Matrix0_vine_f32*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2057
2057
|
return mod
|
|
2058
|
-
elif isinstance(slicer, mps.
|
|
2058
|
+
elif isinstance(slicer, mps._Slicer_Matrix1_vine_f32):
|
|
2059
2059
|
with nogil:
|
|
2060
|
-
mod = multiparameter_module_approximation(dereference(<
|
|
2060
|
+
mod = multiparameter_module_approximation(dereference(<C_Slicer_Matrix1_vine_f32*>(slicer_ptr)), direction, max_error, box, threshold, complete, verbose)
|
|
2061
2061
|
return mod
|
|
2062
2062
|
else:
|
|
2063
2063
|
raise ValueError(f"Unsupported slicer type {type(slicer)}")
|
multipers/slicer.pyx
CHANGED
|
@@ -19876,7 +19876,7 @@ cdef extern from "gudhi/cubical_to_boundary.h" namespace "":
|
|
|
19876
19876
|
void _to_boundary(const vector[unsigned int]&, vector[vector[unsigned int]]&, vector[int]&) except + nogil
|
|
19877
19877
|
void get_vertices(unsigned int, cset[unsigned int]&, const vector[vector[unsigned int]]&) nogil
|
|
19878
19878
|
|
|
19879
|
-
def
|
|
19879
|
+
def _from_bitmapi64(image, **slicer_kwargs):
|
|
19880
19880
|
from multipers import Slicer
|
|
19881
19881
|
dtype = slicer_kwargs.get("dtype", image.dtype)
|
|
19882
19882
|
slicer_kwargs["dtype"] = dtype
|
|
@@ -19894,9 +19894,9 @@ def _from_bitmapf64(image, **slicer_kwargs):
|
|
|
19894
19894
|
cdef cset[unsigned int] vertices
|
|
19895
19895
|
|
|
19896
19896
|
cdef unsigned int num_gens = gen_dims.size()
|
|
19897
|
-
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.
|
|
19898
|
-
cdef
|
|
19899
|
-
cdef
|
|
19897
|
+
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.int64) - _Slicer._inf_value()
|
|
19898
|
+
cdef int64_t[:,:] F = filtration_values
|
|
19899
|
+
cdef int64_t[:,:] c_img = image.reshape(-1,num_parameters)
|
|
19900
19900
|
with nogil:
|
|
19901
19901
|
for i in range(num_gens):
|
|
19902
19902
|
# with gil:
|
|
@@ -19914,7 +19914,7 @@ def _from_bitmapf64(image, **slicer_kwargs):
|
|
|
19914
19914
|
# print(f"F = {np.asarray(F[i])}")
|
|
19915
19915
|
slicer = _Slicer(gen_maps, gen_dims, filtration_values)
|
|
19916
19916
|
return slicer
|
|
19917
|
-
def
|
|
19917
|
+
def _from_bitmapf32(image, **slicer_kwargs):
|
|
19918
19918
|
from multipers import Slicer
|
|
19919
19919
|
dtype = slicer_kwargs.get("dtype", image.dtype)
|
|
19920
19920
|
slicer_kwargs["dtype"] = dtype
|
|
@@ -19932,9 +19932,9 @@ def _from_bitmapi32(image, **slicer_kwargs):
|
|
|
19932
19932
|
cdef cset[unsigned int] vertices
|
|
19933
19933
|
|
|
19934
19934
|
cdef unsigned int num_gens = gen_dims.size()
|
|
19935
|
-
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.
|
|
19936
|
-
cdef
|
|
19937
|
-
cdef
|
|
19935
|
+
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.float32) - _Slicer._inf_value()
|
|
19936
|
+
cdef float[:,:] F = filtration_values
|
|
19937
|
+
cdef float[:,:] c_img = image.reshape(-1,num_parameters)
|
|
19938
19938
|
with nogil:
|
|
19939
19939
|
for i in range(num_gens):
|
|
19940
19940
|
# with gil:
|
|
@@ -19952,7 +19952,7 @@ def _from_bitmapi32(image, **slicer_kwargs):
|
|
|
19952
19952
|
# print(f"F = {np.asarray(F[i])}")
|
|
19953
19953
|
slicer = _Slicer(gen_maps, gen_dims, filtration_values)
|
|
19954
19954
|
return slicer
|
|
19955
|
-
def
|
|
19955
|
+
def _from_bitmapi32(image, **slicer_kwargs):
|
|
19956
19956
|
from multipers import Slicer
|
|
19957
19957
|
dtype = slicer_kwargs.get("dtype", image.dtype)
|
|
19958
19958
|
slicer_kwargs["dtype"] = dtype
|
|
@@ -19970,9 +19970,9 @@ def _from_bitmapi64(image, **slicer_kwargs):
|
|
|
19970
19970
|
cdef cset[unsigned int] vertices
|
|
19971
19971
|
|
|
19972
19972
|
cdef unsigned int num_gens = gen_dims.size()
|
|
19973
|
-
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.
|
|
19974
|
-
cdef
|
|
19975
|
-
cdef
|
|
19973
|
+
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.int32) - _Slicer._inf_value()
|
|
19974
|
+
cdef int32_t[:,:] F = filtration_values
|
|
19975
|
+
cdef int32_t[:,:] c_img = image.reshape(-1,num_parameters)
|
|
19976
19976
|
with nogil:
|
|
19977
19977
|
for i in range(num_gens):
|
|
19978
19978
|
# with gil:
|
|
@@ -19990,7 +19990,7 @@ def _from_bitmapi64(image, **slicer_kwargs):
|
|
|
19990
19990
|
# print(f"F = {np.asarray(F[i])}")
|
|
19991
19991
|
slicer = _Slicer(gen_maps, gen_dims, filtration_values)
|
|
19992
19992
|
return slicer
|
|
19993
|
-
def
|
|
19993
|
+
def _from_bitmapf64(image, **slicer_kwargs):
|
|
19994
19994
|
from multipers import Slicer
|
|
19995
19995
|
dtype = slicer_kwargs.get("dtype", image.dtype)
|
|
19996
19996
|
slicer_kwargs["dtype"] = dtype
|
|
@@ -20008,9 +20008,9 @@ def _from_bitmapf32(image, **slicer_kwargs):
|
|
|
20008
20008
|
cdef cset[unsigned int] vertices
|
|
20009
20009
|
|
|
20010
20010
|
cdef unsigned int num_gens = gen_dims.size()
|
|
20011
|
-
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.
|
|
20012
|
-
cdef
|
|
20013
|
-
cdef
|
|
20011
|
+
filtration_values = np.zeros(shape=(num_gens, num_parameters), dtype = np.float64) - _Slicer._inf_value()
|
|
20012
|
+
cdef double[:,:] F = filtration_values
|
|
20013
|
+
cdef double[:,:] c_img = image.reshape(-1,num_parameters)
|
|
20014
20014
|
with nogil:
|
|
20015
20015
|
for i in range(num_gens):
|
|
20016
20016
|
# with gil:
|
|
@@ -20031,14 +20031,14 @@ def _from_bitmapf32(image, **slicer_kwargs):
|
|
|
20031
20031
|
|
|
20032
20032
|
def from_bitmap(img, **kwargs):
|
|
20033
20033
|
img = np.asarray(img)
|
|
20034
|
-
if img.dtype == np.float64:
|
|
20035
|
-
return _from_bitmapf64(img, **kwargs)
|
|
20036
|
-
if img.dtype == np.int32:
|
|
20037
|
-
return _from_bitmapi32(img, **kwargs)
|
|
20038
20034
|
if img.dtype == np.int64:
|
|
20039
20035
|
return _from_bitmapi64(img, **kwargs)
|
|
20040
20036
|
if img.dtype == np.float32:
|
|
20041
20037
|
return _from_bitmapf32(img, **kwargs)
|
|
20038
|
+
if img.dtype == np.int32:
|
|
20039
|
+
return _from_bitmapi32(img, **kwargs)
|
|
20040
|
+
if img.dtype == np.float64:
|
|
20041
|
+
return _from_bitmapf64(img, **kwargs)
|
|
20042
20042
|
raise ValueError(f"Invalid dtype. Got {img.dtype=}, was expecting {available_dtype=}.")
|
|
20043
20043
|
|
|
20044
20044
|
def from_function_delaunay(
|
|
@@ -20046,7 +20046,7 @@ def from_function_delaunay(
|
|
|
20046
20046
|
grades,
|
|
20047
20047
|
int degree=-1,
|
|
20048
20048
|
backend:Optional[_valid_pers_backend]=None,
|
|
20049
|
-
vineyard=None, #
|
|
20049
|
+
vineyard=None, # Optionmal[bool], wait for cython
|
|
20050
20050
|
dtype=np.float64,
|
|
20051
20051
|
bool verbose = False,
|
|
20052
20052
|
bool clear = True,
|
|
@@ -20061,9 +20061,9 @@ def from_function_delaunay(
|
|
|
20061
20061
|
backend : slicer backend, e.g. "matrix", "clement"
|
|
20062
20062
|
vineyard : bool, use a vineyard-compatible backend
|
|
20063
20063
|
"""
|
|
20064
|
-
from multipers.io import
|
|
20064
|
+
from multipers.io import function_delaunay_presentation_to_slicer, _init_external_softwares
|
|
20065
20065
|
s = multipers.Slicer(None, backend=backend, vineyard=vineyard, dtype=dtype)
|
|
20066
|
-
|
|
20066
|
+
_init_external_softwares(requires=["function_delaunay"])
|
|
20067
20067
|
function_delaunay_presentation_to_slicer(s, points, grades, degree=degree, verbose=verbose,clear=clear)
|
|
20068
20068
|
if degree >= 0:
|
|
20069
20069
|
s.minpres_degree = degree
|
multipers/slicer.pyx.tp
CHANGED
|
@@ -764,7 +764,7 @@ def from_function_delaunay(
|
|
|
764
764
|
grades,
|
|
765
765
|
int degree=-1,
|
|
766
766
|
backend:Optional[_valid_pers_backend]=None,
|
|
767
|
-
vineyard=None, #
|
|
767
|
+
vineyard=None, # Optionmal[bool], wait for cython
|
|
768
768
|
dtype=np.float64,
|
|
769
769
|
bool verbose = False,
|
|
770
770
|
bool clear = True,
|
|
@@ -779,9 +779,9 @@ def from_function_delaunay(
|
|
|
779
779
|
backend : slicer backend, e.g. "matrix", "clement"
|
|
780
780
|
vineyard : bool, use a vineyard-compatible backend
|
|
781
781
|
"""
|
|
782
|
-
from multipers.io import
|
|
782
|
+
from multipers.io import function_delaunay_presentation_to_slicer, _init_external_softwares
|
|
783
783
|
s = multipers.Slicer(None, backend=backend, vineyard=vineyard, dtype=dtype)
|
|
784
|
-
|
|
784
|
+
_init_external_softwares(requires=["function_delaunay"])
|
|
785
785
|
function_delaunay_presentation_to_slicer(s, points, grades, degree=degree, verbose=verbose,clear=clear)
|
|
786
786
|
if degree >= 0:
|
|
787
787
|
s.minpres_degree = degree
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multipers
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.3b3
|
|
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>
|
|
@@ -62,6 +62,11 @@ or
|
|
|
62
62
|
```sh
|
|
63
63
|
conda install multipers -c conda-forge
|
|
64
64
|
```
|
|
65
|
+
Pre-releases are available via
|
|
66
|
+
```sh
|
|
67
|
+
pip install --pre multipers
|
|
68
|
+
```
|
|
69
|
+
These release usually contain small bugfixes or unstable new features.
|
|
65
70
|
|
|
66
71
|
Windows support is experimental, and some core dependencies are not available on Windows.
|
|
67
72
|
We hence recommend Windows user to use [WSL](https://learn.microsoft.com/en-us/windows/wsl/).
|
|
@@ -5,39 +5,39 @@ multipers/distances.py,sha256=uAZj2GtUQp50OxN2qU7sl2JqsmJ74IG9j5tZapLO2Us,6220
|
|
|
5
5
|
multipers/filtration_conversions.pxd,sha256=Je7a3F4zS1PQn6Ul1YCXgA6p39X2FouStru-XtN-aOw,10800
|
|
6
6
|
multipers/filtration_conversions.pxd.tp,sha256=_9tUvZVUA7J_RUM3q7BxY48fYgDHCUA7Xhy4nBfLLs0,3309
|
|
7
7
|
multipers/filtrations.pxd,sha256=08ONkZNCjs8Nme8lcD9myPz-K662sA-EDpSwzgC2_ts,9461
|
|
8
|
-
multipers/function_rips.cp311-win_amd64.pyd,sha256=
|
|
8
|
+
multipers/function_rips.cp311-win_amd64.pyd,sha256=xBGJ-zSwKb_Sa-npqAgursQPNhGOLVv4Ogz1kWDr9nw,329216
|
|
9
9
|
multipers/function_rips.pyx,sha256=j5NjbK3YrAv_2s8YHB1JB0k6m9NC7RQCSFlJe-w_kgE,5252
|
|
10
|
-
multipers/grids.cp311-win_amd64.pyd,sha256=
|
|
10
|
+
multipers/grids.cp311-win_amd64.pyd,sha256=kLC_F74SIMoZSdHGb5S7JJVZ5i4APgSnptyw5hNBa4s,482304
|
|
11
11
|
multipers/grids.pyx,sha256=ONN_RKkuxqwb9IaS9gd42FUGaiBLc8QWcd3L-ubZjKE,16575
|
|
12
|
-
multipers/io.cp311-win_amd64.pyd,sha256=
|
|
12
|
+
multipers/io.cp311-win_amd64.pyd,sha256=uPsgQTz4cGclBfBqqBi4LipNKjdnq2N-vrK148jxzLE,222720
|
|
13
13
|
multipers/io.pyx,sha256=pQBH_rSqaCZqDSxTLnhlyECP3fLbX2tR_RKJHydHm_0,22210
|
|
14
|
-
multipers/mma_structures.cp311-win_amd64.pyd,sha256=
|
|
14
|
+
multipers/mma_structures.cp311-win_amd64.pyd,sha256=1UoQhtrXeIWQm5lFQ2jUhissQ4dQou3JWtg-AFDBhzA,1325056
|
|
15
15
|
multipers/mma_structures.pxd,sha256=jh1QnQRidt_VK0CK7losQi6rAl_1qG5DNuR23J42pUA,6595
|
|
16
16
|
multipers/mma_structures.pyx,sha256=4zNC6ePfFKMvx0MrH-FqJVouyTMciRc49oevKDnsJhI,109530
|
|
17
17
|
multipers/mma_structures.pyx.tp,sha256=hWuuk9USDFa8CbQVRHNjWSAdGgpkWKvSCNjTtVuSzwM,42299
|
|
18
18
|
multipers/multiparameter_edge_collapse.py,sha256=MFt0eKQQSv2354omeIqOmzASYTKIMsYdxZHFZauQr8g,1229
|
|
19
|
-
multipers/multiparameter_module_approximation.cp311-win_amd64.pyd,sha256=
|
|
19
|
+
multipers/multiparameter_module_approximation.cp311-win_amd64.pyd,sha256=i99_IT4PnoXpTJp2JDrJe-1wE5HYnnlYLls8InWLduY,446976
|
|
20
20
|
multipers/multiparameter_module_approximation.pyx,sha256=wp7la7Z9wBngnfw6WOVddf93mPyXf4HfNT6dKW2Z0r0,9030
|
|
21
21
|
multipers/pickle.py,sha256=YYVt4iHiD16E1x5Yn_4mX6P5P8rKi56pNGjJo5IzPhc,2579
|
|
22
|
-
multipers/plots.py,sha256=
|
|
23
|
-
multipers/point_measure.cp311-win_amd64.pyd,sha256=
|
|
22
|
+
multipers/plots.py,sha256=hvnm3xESdsQoo4dppf4x0pJUwvPwwGKYL93X56t7l5E,14437
|
|
23
|
+
multipers/point_measure.cp311-win_amd64.pyd,sha256=6Cd2nu692PSJVuH1-oxNfHDLHxEn77sUVeqw97mnd1s,604160
|
|
24
24
|
multipers/point_measure.pyx,sha256=DVhal6HgCCuALSJMcHHKOW16CwDQCVTc2PpK8cGCqx8,12109
|
|
25
|
-
multipers/simplex_tree_multi.cp311-win_amd64.pyd,sha256
|
|
25
|
+
multipers/simplex_tree_multi.cp311-win_amd64.pyd,sha256=qLkcLxnQONDUgwQJyoTTn_fI8VikRBy0c3FvEbnDDeA,3757056
|
|
26
26
|
multipers/simplex_tree_multi.pxd,sha256=KpyDEQNPoMC2sOU9-d4LtrGXx_UVCJGxMJ1kk1AzHgU,6631
|
|
27
27
|
multipers/simplex_tree_multi.pyx,sha256=reHyva5AR1lOQyiCs2_jQ2XfwHtktcQ1nmY_BNmyxhk,498156
|
|
28
28
|
multipers/simplex_tree_multi.pyx.tp,sha256=fUTuIscfDlNjsImWU1YALVZ1Mf9OEkdl-IFKcRQqalI,89202
|
|
29
|
-
multipers/slicer.cp311-win_amd64.pyd,sha256=
|
|
30
|
-
multipers/slicer.pxd,sha256=
|
|
29
|
+
multipers/slicer.cp311-win_amd64.pyd,sha256=QsWldyKFo41P3sAUbmzDGmtw64xq509-_dE9OsZ39nM,11619840
|
|
30
|
+
multipers/slicer.pxd,sha256=fzA-lL_QWyUMf9rRSpcKG35QNS9UXEmVC9r7kR0geho,185230
|
|
31
31
|
multipers/slicer.pxd.tp,sha256=fLOUPtPGqiY9o1fPDyc_whBrgKLh_6HVfvl7OtE-34Y,10243
|
|
32
|
-
multipers/slicer.pyx,sha256=
|
|
33
|
-
multipers/slicer.pyx.tp,sha256=
|
|
32
|
+
multipers/slicer.pyx,sha256=cgVUoP_DKdrs4BIwR1fdowoRiooCyR62YDKHmjz4jIY,894041
|
|
33
|
+
multipers/slicer.pyx.tp,sha256=jZOdsHKMpq0nclmvlzkZUDzdjffT3_mFDVY_mnsl9Es,44523
|
|
34
34
|
multipers/tbb12.dll,sha256=6AsPR4GauU53hj2xqJNM0SfLkCKCDskjy-uKeS01tCk,338944
|
|
35
35
|
multipers/tbbbind_2_5.dll,sha256=8TtH7JJZlCEKF0UwfyJoiyrFt9utOI_x5AFOxpP-pGw,23040
|
|
36
36
|
multipers/tbbmalloc.dll,sha256=1MRBYYNzNcooog8__yuLq40l7kSgZ4lkNZhDFfTWM8A,112640
|
|
37
37
|
multipers/tbbmalloc_proxy.dll,sha256=fcM6szEVHayvxKW8sPUTWoqEZx1_4FbWni81hbOcbi4,31232
|
|
38
38
|
multipers/tensor.pxd,sha256=MSmaMU0sOP9CHLmg4dym7nOGaI1S4cOdM01TQ9flI54,417
|
|
39
39
|
multipers/test.pyx,sha256=-g7WU-jKrZK8H0c-6eAPsfrApjvTKrUoswVYFu8LoV4,1798
|
|
40
|
-
multipers/array_api/__init__.py,sha256=
|
|
40
|
+
multipers/array_api/__init__.py,sha256=y8WJQwh9rkzM2vZn_WpsLMzOxdg5ZDqockSnpK8vBfY,1111
|
|
41
41
|
multipers/array_api/numpy.py,sha256=aXNzWLfDIv0_kFqRzYUUcpAJuM9SX3_fm73Bx18nogs,606
|
|
42
42
|
multipers/array_api/torch.py,sha256=w55ow_Gxht2FOvc5EksCfaceh5gMTNKixHVsAMeSZik,548
|
|
43
43
|
multipers/data/MOL2.py,sha256=nLZHy2OSFN9Z2uJKsbqWOEG2R7G-uH6dCLHG48UjvR4,15428
|
|
@@ -146,7 +146,7 @@ multipers/ml/kernels.py,sha256=XWfvKY68-c9E-MpRzdNqGzGD6K24Aizx95TkiSeAtIY,6175
|
|
|
146
146
|
multipers/ml/mma.py,sha256=mSwYqSHWGiboEiMnxArCuhHyrOExPYdML2Mbx4dTO7s,23950
|
|
147
147
|
multipers/ml/one.py,sha256=np5jM8gywm65TsK1yeZ1BDWqP-Ym-7hz4brTXI_0imk,20119
|
|
148
148
|
multipers/ml/point_clouds.py,sha256=nTkSjSzQy6S10-sZ0uwBp_Fs2EIWleB7yHncK2b_xLg,13770
|
|
149
|
-
multipers/ml/signed_measures.py,sha256=
|
|
149
|
+
multipers/ml/signed_measures.py,sha256=46O1jQs6qsT5Qbu5dgVt_f8VENWQVZt5_0aybQYAGRo,58337
|
|
150
150
|
multipers/ml/sliced_wasserstein.py,sha256=jgq4ND3EWwwJBopqRvfJLsoOptiMHjS3zEAENBmPJDc,18644
|
|
151
151
|
multipers/ml/tools.py,sha256=DOPcqmvZP2bA7M08GrwccdebwDq1HEwYdhNRGT7eZMI,3453
|
|
152
152
|
multipers/multi_parameter_rank_invariant/diff_helpers.h,sha256=wMCOhAewWd6-lulLND0y8M0MZoru6zn_8J3qfXDjLds,3477
|
|
@@ -178,8 +178,8 @@ multipers/tests/__init__.py,sha256=-7Fj-zFAfBJv18trg0CPglQTmYu_ehySZGqtJzPlN8U,1
|
|
|
178
178
|
multipers/torch/__init__.py,sha256=OLxIiZ389uCqehpUxBPUI_x1SYu531onc4tiTscAuIw,27
|
|
179
179
|
multipers/torch/diff_grids.py,sha256=2YK-c351tBpj8sfzjf26fbE1l0xlWse7oVVfDHD3zwM,7492
|
|
180
180
|
multipers/torch/rips_density.py,sha256=H-kmSzY8hXhmVn15Oltc71DHs1IUHg5oPRgNyWW8L4Q,11706
|
|
181
|
-
multipers-2.3.
|
|
182
|
-
multipers-2.3.
|
|
183
|
-
multipers-2.3.
|
|
184
|
-
multipers-2.3.
|
|
185
|
-
multipers-2.3.
|
|
181
|
+
multipers-2.3.3b3.dist-info/licenses/LICENSE,sha256=UsQRnvlo_9wpQS9DNt52GEraERHwK2GIRwuqr2Yv5JI,1071
|
|
182
|
+
multipers-2.3.3b3.dist-info/METADATA,sha256=a2JsYZdIgYzL0FaSLFFne-amCNe6N9PWC0OOyNtTENw,9817
|
|
183
|
+
multipers-2.3.3b3.dist-info/WHEEL,sha256=JLOMsP7F5qtkAkINx5UnzbFguf8CqZeraV8o04b0I8I,101
|
|
184
|
+
multipers-2.3.3b3.dist-info/top_level.txt,sha256=L9e0AGmhRzrNw9FpuUx-zlqi5NcBOmrI9wYY8kYWr8A,10
|
|
185
|
+
multipers-2.3.3b3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|