ACCarnall / bagpipes

Bagpipes is a state of the art code for generating realistic model galaxy spectra and fitting these to spectroscopic and photometric observations. Users should install with pip, not by cloning the repository.
http://bagpipes.readthedocs.io
GNU General Public License v3.0
71 stars 37 forks source link

Problem with fit.py #48

Open ssuarez972 opened 10 months ago

ssuarez972 commented 10 months ago

Hello, I am currently getting started on the different functions of bagpipes, and I got stuck with example 3; I managed to load the filter data, but when I try to run fit.fit() I get the following:

  1 fit = pipes.fit(galaxy, fit_instructions)

----> 2 fit.fit()

File ~/anaconda3/envs/astrolab39/lib/python3.9/site-packages/bagpipes/fitting/fit.py:129, in fit.fit(self, verbose, n_live, use_MPI) 127 with warnings.catch_warnings(): 128 warnings.simplefilter("ignore") --> 129 pmn.run(self.fitted_model.lnlike, 130 self.fitted_model.prior.transform, 131 self.fitted_model.ndim, n_live_points=n_live, 132 importance_nested_sampling=False, verbose=verbose, 133 sampling_efficiency="model", 134 outputfiles_basename=self.fname, use_MPI=use_MPI) 136 if rank == 0 or not use_MPI: 137 runtime = time.time() - start_time

NameError: name 'pmn' is not defined

I checked the fit.py but I couldn't manage to solve it, I would really appreciate any input on this issue

ACCarnall commented 10 months ago

You should be receiving an error when you first import bagpipes, reading "Bagpipes: PyMultiNest import failed, fitting will be unavailable." - you need to make sure pymultinest imports properly before you can run fits with the code.