ebachelet / pyLIMA

GNU General Public License v3.0
31 stars 8 forks source link

Bug in DE_fit.py line 84? #86

Closed ytsapras closed 6 months ago

ytsapras commented 6 months ago

Looks like there's a problem in the latest pyLIMA DoubleSource version. My latest DE run finished and then it gave me this message:

differential_evolution step 15000: f(x)= 535250.0350261995
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/Tux/Installed_Programs/pyLIMA/pyLIMA/fits/**DE_fit.py", line 84, in fit
    self.trials = np.array(self.trials)**
  File "<string>", line 2, in __getitem__
  File "/home/Tux/Installed_Programs/anaconda3/envs/pyLIMA/lib/python3.10/multiprocessing/managers.py", line 818, in _callmethod
    kind, result = conn.recv()
  File "/home/Tux/Installed_Programs/anaconda3/envs/pyLIMA/lib/python3.10/multiprocessing/connection.py", line 250, in recv
    buf = self._recv_bytes()
  File "/home/Tux/Installed_Programs/anaconda3/envs/pyLIMA/lib/python3.10/multiprocessing/connection.py", line 414, in _recv_bytes
    buf = self._recv(4)
  File "/home/Tux/Installed_Programs/anaconda3/envs/pyLIMA/lib/python3.10/multiprocessing/connection.py", line 383, in _recv
    raise EOFError
EOFError
>>> 

fit_.fit_results is still empty so It did not save the 'best_model' or 'DE_population':

>>> fit_5.fit_results['best_model']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'best_model'
>>> fit_5.fit_results['DE_population']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'DE_population'

The model to be fitted was:

mymodel = USBL_model. USBLmodel(current_event, parallax=['Full', 2459409.77], 
                                   orbital_motion=['Keplerian', 2459409.77],   
                                   xallarap=['Static', 2459409.77],
                                   fancy_parameters=fancy)

And the fit object:

fit_5 = DE_fit.DEfit(mymodel, telescopes_fluxes_method='polyfit',
                         DE_population_size=22, max_iteration=15000, display_progress=True,
                         strategy='best1bin')
ytsapras commented 6 months ago

Tested the same code at my home computer and it seems to work. Will investigate further, it could be a library issue.

ytsapras commented 6 months ago

This issue was due to not having updated to the latest version on my work machine. I am therefore closing this ticket.