Closed larrybradley closed 2 months ago
I recently ran into an issue where Bagpipes fit_catalogue (with make_plots=True) fails with a KeyError on systems without latex:
fit_catalogue
make_plots=True
KeyError
latex
plot_1d_posterior.py:50, in plot_1d_posterior(fit, fit2, show, save) ---> 50 samples = np.copy(fit.posterior.samples[name]) KeyError: 'log_10(delayed:metallicity)'
The issue is that fit.fitted_model.params gets a reference to labels, which is later changed in place, thus changing the params names as well.
fit.fitted_model.params
labels
params
This PR fixes that issue by making labels a copy of the params. It also removes two unused imports.
Thanks Larry!
I recently ran into an issue where Bagpipes
fit_catalogue
(withmake_plots=True
) fails with aKeyError
on systems withoutlatex
:The issue is that
fit.fitted_model.params
gets a reference tolabels
, which is later changed in place, thus changing theparams
names as well.This PR fixes that issue by making
labels
a copy of theparams
. It also removes two unused imports.