Problems with astroML v1.0

43 views
Skip to first unread message

Gordon Richards

unread,
Aug 28, 2020, 3:54:53 PM8/28/20
to astroML-general

I'm trying to run the example of Figure 6.6 (2nd edition: http://www.astroml.org/book_figures/chapter6/fig_EM_metallicity.html).

However, draw_ellipse seems to be missing. The error doesn't make sense to me:

ImportError: cannot import name 'LinearRegressionwithErrors' from 'astroML.linear_model' (/Users/gtr/opt/anaconda3/lib/python3.8/site-packages/astroML/linear_model/init.py)

However, I see "draw_ellipse" in tools.py at
~/anaconda3/lib/python3.8/site-packages/astroML/plotting

I managed to get it to work with by importing:
from matplotlib.patches import Ellipse

And then copying draw_elllipse from tools.py:
def draw_ellipse(mu, C, scales=[1, 2, 3], ax=None, **kwargs):


I also get the same error as in when importing setup_text plots:
from astroML.plotting import setup_text_plots

ImportError: cannot import name 'LinearRegressionwithErrors' from 'astroML.linear_model' (/Users/gtr/opt/anaconda3/lib/python3.8/site-packages/astroML/linear_model/init.py)


This is after updating (actually, installing fresh) astroML earlier this week, which appears to be v1.0.


Brigitta Sipocz

unread,
Aug 31, 2020, 4:47:51 PM8/31/20
to astroML-general
Dear Gordon,

Indeed there seems to be an issue handling the missing dependency of PyMC3. It's required for the `LinearRegressionwithErrors` class, but not for this example.

The CI should have picked this up as pymc3 is an optional dependency, but unfortunately it didn't. I'm fixing it right now, but in the meantime could you please try again once you installed pycm3?

Cheers,
 Brigitta



--
You received this message because you are subscribed to the Google Groups "astroML-general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astroml-gener...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astroml-general/d0bbeab3-a374-4fde-b0e6-423d12467aa2o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages