Skip to content

Commit

Permalink
Add DensityFiltration (#473)
Browse files Browse the repository at this point in the history
* Add DensityFiltration

* Remove effective_metric_params in radial

* Replace warnings in image subpackage by ValueErrors for input dim > 4

* Remove unnecessary _is_fitted from ImageToPointCloud

* Improve See alsos in images/filtrations.py

* Add tests for bad input shapes in image subpackage

Signed-off-by: Guillaume Tauzin <[email protected]>
Co-authored-by: Umberto Lupo <[email protected]>
  • Loading branch information
gtauzin and ulupo authored Oct 4, 2020
1 parent 565a2ba commit d089002
Show file tree
Hide file tree
Showing 7 changed files with 429 additions and 95 deletions.
1 change: 1 addition & 0 deletions doc/modules/images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ Filtrations
images.DilationFiltration
images.ErosionFiltration
images.SignedDistanceFiltration
images.DensityFiltration
4 changes: 2 additions & 2 deletions gtda/homology/cubical.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CubicalPersistence(BaseEstimator, TransformerMixin, PlotterMixin):
periodic_dimensions : boolean ndarray of shape (n_dimensions,) or None, \
optional, default: ``None``
Periodicity of the boundaries along each of the axis, where
Periodicity of the boundaries along each of the axes, where
``n_dimensions`` is the dimension of the images of the collection. The
boolean in the `d`th position expresses whether the boundaries along
the `d`th axis are periodic. The default ``None`` is equivalent to
Expand All @@ -69,7 +69,7 @@ class CubicalPersistence(BaseEstimator, TransformerMixin, PlotterMixin):
Attributes
----------
periodic_dimensions_ : boolean ndarray of shape (n_dimensions,)
Effective periodicity of the boundaries along each of the axis. Set in
Effective periodicity of the boundaries along each of the axes. Set in
:meth:`fit`.
infinity_values_ : float
Expand Down
4 changes: 3 additions & 1 deletion gtda/images/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

from .preprocessing import Binarizer, Inverter, Padder, ImageToPointCloud
from .filtrations import HeightFiltration, RadialFiltration, \
DilationFiltration, ErosionFiltration, SignedDistanceFiltration
DilationFiltration, ErosionFiltration, SignedDistanceFiltration, \
DensityFiltration

__all__ = [
'Binarizer',
Expand All @@ -17,4 +18,5 @@
'DilationFiltration',
'ErosionFiltration',
'SignedDistanceFiltration',
'DensityFiltration'
]
Loading

0 comments on commit d089002

Please sign in to comment.