mriener / gausspyplus

Fully automated Gaussian decomposition package for emission line spectra
46 stars 14 forks source link

decompose.decompose() appears to be broken following lmfit v1.0.0 update #1

Open nic-kill opened 4 years ago

nic-kill commented 4 years ago

may be an easy fix with the minimizer.py function? Not sure if that was in the previous version.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-90-14e9c299597e> in <module>()
     48     decompose.single_prepared_spectrum = prepared_spectrum
     49 
---> 50     decomposition[f'{noise_level}'] = decompose.decompose()
     51     decomposition[f'{noise_level}']['input_spec'] = prepared_spectrum['data_list'][0]

~/.local/lib/python3.6/site-packages/gausspyplus-0.0.dev95-py3.6.egg/gausspyplus/decompose.py in decompose(self)
    172             self.log_output = False
    173             self.getting_ready()
--> 174             return self.start_decomposition()
    175         else:
    176             self.check_settings()

~/.local/lib/python3.6/site-packages/gausspyplus-0.0.dev95-py3.6.egg/gausspyplus/decompose.py in start_decomposition(self)
    245         say('\ndecomposing data...', logger=self.logger)
    246 
--> 247         from .gausspy_py3 import gp as gp
    248         g = gp.GaussianDecomposer()  # Load GaussPy
    249         g.set('use_ncpus', self.use_ncpus)

~/.local/lib/python3.6/site-packages/gausspyplus-0.0.dev95-py3.6.egg/gausspyplus/gausspy_py3/gp.py in <module>()
     13 import numpy as np
     14 
---> 15 from . import AGD_decomposer
     16 from . import gradient_descent
     17 from . import ioHDF5

~/.local/lib/python3.6/site-packages/gausspyplus-0.0.dev95-py3.6.egg/gausspyplus/gausspy_py3/AGD_decomposer.py in <module>()
     12 from scipy.interpolate import interp1d
     13 # from scipy.optimize import leastsq, minimize
---> 14 from lmfit import minimize as lmfit_minimize
     15 from lmfit import Parameters
     16 

ImportError: cannot import name 'minimize'
mriener commented 4 years ago

Just checked, but I cannot reproduce the error. For me everything runs with python-3.6.10, lmfit-1.0.0, numpy-1.18.4, and scipy-1.4.1. Can you specify the version numbers of the individual packages that cause the error (via conda list or pip list)?

I recently upgraded GaussPy+ to v0.2 and this new version includes also fixes to ensure compatibility with Python 3.8. I tested the code with python-3.8.2, lmfit-1.0.1, numpy-1.18.4, and scipy-1.4.1, and everything ran okay.

I would recommend updating GaussPy+ to the newest version (v0.2) and if possible also updating the individual dependencies (lmfit, numpy, scipy) to the versions above.