tritemio / pybroom

pybroom, the python's broom to tidy up messy fit results!
http://pybroom.readthedocs.io/
MIT License
14 stars 5 forks source link

Failing doc build #7

Open has2k1 opened 7 years ago

has2k1 commented 7 years ago

In pybroom-example-multi-datasets-scipy-robust-fit.ipynb, this:

sns.factorplot(x='loss', y='value', data=dt_tot, col='name', hue='loss',
               col_wrap=4, kind='point', sharey=False);

fails with:

ValueError: Invalid RGBA argument: 0.29803921568627451

I think this is because Matplotlib changed its to_rgba function and made it more strict.

tritemio commented 7 years ago

Tracking down the issue, it seems a problem is with nans passed to plt.scatter. I extracted the values of the arguments used to call scatter using pdb and I got this:

statistic = np.array([ 0.99057607,         np.nan,         np.nan])
offpos = np.array([ 0.,  1.,  2.])
kws = {'c': [(0.2980392156862745, 0.4470588235294118, 0.6901960784313725), 
             (0.2980392156862745, 0.4470588235294118, 0.6901960784313725), 
             (0.2980392156862745, 0.4470588235294118, 0.6901960784313725)], 
       'linewidth': 2.3625, 's': 62.344906210489441, 'marker': 'o', 'zorder': 1, 
       'edgecolor': (0.2980392156862745, 0.4470588235294118, 0.6901960784313725), 
       'label': 'cauchy'}

Now, the following calls both raise the same the error:

plt.scatter(offpos, statistic, **kws)
plt.scatter(offpos, statistic)

Why we have NaN, and if we had it also before I still don't know.

tritemio commented 7 years ago

Reported upstream to matplotlib here.

has2k1 commented 7 years ago

@tritemio, is it okay to comment out the offending line until the next version of Matplotlib ships? We can leave this issue open until then.

tritemio commented 7 years ago

Yes, I'll change it to box-plot instead. Sorry if I'm not very responsive but I'll be really busy in the next few weeks.