giotto-ai / pyflagser

Python bindings and API for the flagser C++ library (https://github.com/luetge/flagser).
Other
13 stars 15 forks source link

One dimensional output for empty persistence diagram #43

Closed wreise closed 4 years ago

wreise commented 4 years ago

Description

Let us denote diag the output of flagser_weighted. According to the docstrings, diag['dgms'] is a list of persistence diagrams, each of shape (*, 2). Applied to the example below, the shape is (0,). null_h_one.npy.zip

Steps/Code to Reproduce

import numpy as np
from pyflagser import flagser_weighted
null_h = np.load('null_h_one.npy')
diag = flagser_weighted(null_h,
                 directed=True,
                 filtration='max', coeff=2, max_edge_weight=np.inf,
                 min_dimension=0,
                 max_dimension=1,
                 approximation=10000,)

Expected Results

diag['dgms'][1].shape == (something, 2)

Actual Results

diag['dgms'][1].shape == (0,)

Versions

macOS-10.15.5-x86_64-i386-64bit Python 3.8.2 (default, Mar 26 2020, 10:43:30) [Clang 4.0.1 (tags/RELEASE_401/final)] pyflagser 0.3.1

ulupo commented 4 years ago

I believe this has been addressed in https://github.com/giotto-ai/pyflagser/pull/37/commits/706a1be1adb77ddeb650a161f9dd82bc45a0b171, as part of #37 soon to be merged. Could you double-check?

wreise commented 4 years ago

Yes, that's right - perfect, sorry :(

ulupo commented 4 years ago

You couldn't know! :)