File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ def warn_deprecated(deprecated, substitute):
1313 )
1414
1515
16+ def warn_user (msg ):
17+ warnings .warn (msg , UserWarning , stacklevel = 2 )
18+
19+
1620class ParamsMixin :
1721 """
1822 Mixin to add setters and getters for public parameters, compatible with
Original file line number Diff line number Diff line change 1212from tdamapper .utils .metrics import get_metric , chebyshev
1313from tdamapper .utils .vptree import VPTree
1414
15+ from tdamapper ._common import warn_user
16+
1517
1618class _Pullback :
1719
@@ -273,7 +275,7 @@ class CubicalCover(Proximity):
273275 def __init__ (
274276 self ,
275277 n_intervals = 1 ,
276- overlap_frac = 0.5 ,
278+ overlap_frac = None ,
277279 kind = 'flat' ,
278280 leaf_capacity = 1 ,
279281 leaf_radius = None ,
@@ -285,6 +287,8 @@ def __init__(
285287 self .leaf_capacity = leaf_capacity
286288 self .leaf_radius = leaf_radius
287289 self .pivoting = pivoting
290+ if (self .overlap_frac <= 0.0 ) or (self .overlap_frac > 0.5 ):
291+ warn_user ('The parameter overlap_frac is expected within range (0.0, 0.5]' )
288292
289293 def _gamma_n (self , x ):
290294 return self .__n_intervals * (x - self .__min ) / self .__delta
You can’t perform that action at this time.
0 commit comments