Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is persim.plot still available? #33

Closed
tmelorc opened this issue Feb 6, 2020 · 8 comments
Closed

Is persim.plot still available? #33

tmelorc opened this issue Feb 6, 2020 · 8 comments

Comments

@tmelorc
Copy link
Contributor

tmelorc commented Feb 6, 2020

I'm using Python 3.8 and I have these:

$ pip3.8 list -u
Package         Version
--------------- -------
cycler          0.10.0 
Cython          0.29.14
hopcroftkarp    1.2.5  
Jinja2          2.11.1 
joblib          0.14.1 
kiwisolver      1.1.0  
kmapper         1.2.0  
llvmlite        0.31.0 
MarkupSafe      1.1.1  
matplotlib      3.1.3  
numba           0.48.0 
numpy           1.18.1 
persim          0.1.2  
Pillow          7.0.0  
pip             20.0.2 
pyparsing       2.4.6  
python-dateutil 2.8.1  
ripser          0.4.1  
scikit-learn    0.22.1 
scikit-tda      0.0.3  
scipy           1.4.1  
six             1.14.0 
tadasets        0.0.4  
umap-learn      0.3.10 

The code below from http://persim.scikit-tda.org/notebooks/distances.html

import numpy as np
import persim
import persim.plot
import tadasets
import ripser
import matplotlib.pyplot as plt

gives the error

ModuleNotFoundError: No module named 'persim.plot'

Removing the import persim.plot the error

AttributeError: module 'ripser' has no attribute 'plot_dgms' 

appears when calling ripser.plot_dgms().

Any idea how to solve it? Maybe documentation is outdated?

Code

import numpy as np
import persim
#import persim.plot
import tadasets
import ripser
import matplotlib.pyplot as plt

data_clean = tadasets.dsphere(d=1, n=100, noise=0.0)
data_noisy = tadasets.dsphere(d=1, n=100, noise=0.1)

plt.scatter(data_clean[:,0], data_clean[:,1], label="clean data")
plt.scatter(data_noisy[:,0], data_noisy[:,1], label="noisy data")
plt.axis('equal')
plt.legend()
plt.show()

dgm_clean = ripser.ripser(data_clean)['dgms'][1]
dgm_noisy = ripser.ripser(data_noisy)['dgms'][1]

ripser.plot_dgms([dgm_clean, dgm_noisy] , labels=['Clean $H_1$', 'Noisy $H_1$'])
@tmelorc
Copy link
Contributor Author

tmelorc commented Feb 6, 2020

Just to inform, it works if remove import persim.plot and replace ripser.plot_dgms by persim.plot_diagrams.

It would be good to update documentation.

@sauln
Copy link
Member

sauln commented Feb 6, 2020

Thanks for catching this, it would be really helpful if you could submit a PR with the doc changes!

@tmelorc
Copy link
Contributor Author

tmelorc commented Feb 6, 2020

Thanks for catching this, it would be really helpful if you could submit a PR with the doc changes!

I'm not sure if I can use Git but I'll do my best to collaborate.
Thanks.

@tmelorc
Copy link
Contributor Author

tmelorc commented Feb 6, 2020

So, I'm trying to do a PR. I'm not sure if it will work.
Please, when you can, check if it works.

@sauln
Copy link
Member

sauln commented Feb 8, 2020

Yes, it worked as is merged #34. Thank you!

@sauln sauln closed this as completed Feb 8, 2020
@FaisalAhmed77
Copy link

I got error in line 15. What is wrong there ? Thanks

---> 15 persim.landscapes.plot_diagrams(dgms_H1, title="Persistence Diagram of H1", ax=axs[0])
16
17 persim.landscapes.plot_diagrams(dgms_DR1, title="Persistence Diagram of D1", ax=axs[1])

AttributeError: module 'persim' has no attribute 'landscapes'

@ganeshlandge
Copy link

I got error in line 15. What is wrong there ? Thanks

---> 15 persim.landscapes.plot_diagrams(dgms_H1, title="Persistence Diagram of H1", ax=axs[0]) 16 17 persim.landscapes.plot_diagrams(dgms_DR1, title="Persistence Diagram of D1", ax=axs[1])

AttributeError: module 'persim' has no attribute 'landscapes'

I am also getting same error, @FaisalAhmed77 did you get solution for this error?

@jaygam111
Copy link

When I run the Example Plots for Torus vs Sphere code, got an error.

AttributeError: module 'persim' has no attribute 'landscapes'

Any idea how to solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants