[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
As observed in #233, there are implicit assumptions on the input diagrams to the fit and transform methods of most transformers in gtda/diagrams. Most stem from the fact that we call the _subdiagrams function which will break unless all sample diagrams in a collection X have the same number of persistence triples in each homology dimension. This PR extends the approach introduced in https://github.com/giotto-ai/giotto-tda/pull/436/commits/9068c9d978d87ad4279a89fc2a9f26bb6ceea1b7 for Filtering to all transformers in gtda/diagrams with the only exception of ForgetDimension (which does not make use of _subdiagrams).
Reference issues/PRs Fixes #233.
Types of changes
Description As observed in #233, there are implicit assumptions on the input diagrams to the
fit
andtransform
methods of most transformers ingtda/diagrams
. Most stem from the fact that we call the_subdiagrams
function which will break unless all sample diagrams in a collectionX
have the same number of persistence triples in each homology dimension. This PR extends the approach introduced in https://github.com/giotto-ai/giotto-tda/pull/436/commits/9068c9d978d87ad4279a89fc2a9f26bb6ceea1b7 forFiltering
to all transformers ingtda/diagrams
with the only exception ofForgetDimension
(which does not make use of_subdiagrams
).Checklist
flake8
to check my Python changes.I have added tests to cover my changes.pytest
to check this on Python tests.