nespinoza / juliet

A versatile modelling tool for transiting and non-transiting (single and multiple) exoplanetary systems
MIT License
55 stars 30 forks source link

ValueError: min() arg is an empty sequence #49

Closed redeaglekr closed 3 years ago

redeaglekr commented 3 years ago

Hi Nestor,

Thank you for making such a powerful and ready to use tool for exoplanet detection.

I was trying to get a RV model comparison using Juliet. I have two instruments say Instument1 and Instrument2. I first evaluated a one planet model, using the codes given in your tutorial (https://juliet.readthedocs.io/en/latest/tutorials/rvfits.html). I changed the code accordingly. I am able to get the posteriors and evidence values for the single planet model.

dataset = juliet.load(priors = priors, rvfilename=filename, out_folder = 'planeta_1planet')
results = dataset.fit(n_live_points = 300)

Then I added a 2nd planet according to the above tutorial and changed the code for adding the parameters.

dataset = juliet.load(priors = priors, rvfilename=filename, out_folder = 'planeta_2planet')
results2 = dataset.fit(n_live_points = 300)

Now when I run the code, I am getting the following error.

results2 = dataset.fit(n_live_points = 300)
  File "/home/user/.local/lib/python3.8/site-packages/juliet/fit.py", line 716, in fit
    return fit(self, use_dynesty = use_dynesty, dynamic = dynamic, dynesty_bound = dynesty_bound, dynesty_sample = dynesty_sample, \
  File "/home/user/.local/lib/python3.8/site-packages/juliet/fit.py", line 1176, in __init__
    sampler.run_nested(nlive_init = self.n_live_points)
  File "/home/user/.local/lib/python3.8/site-packages/dynesty/dynamicsampler.py", line 1663, in run_nested
    passback = self.add_batch(nlive=nlive_batch,
  File "/home/user/.local/lib/python3.8/site-packages/dynesty/dynamicsampler.py", line 1771, in add_batch
    logl_bounds = wt_function(res, wt_kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/dynesty/dynamicsampler.py", line 152, in weight_function
    bounds = (min(bounds) - lpad, min(max(bounds) + lpad, nsamps - 1))
ValueError: min() arg is an empty sequence.

This error has been repeating, when I was trying to fit 2 planets at a time, as opposed to previous case where we iteratively added the second planet keeping the parameters of the first planet fixed.

I checked the prior dictionaries in all cases, nothing is missed and juliet is able to load the datasets.

Could you please help me!


Regards,
sreenivas