MNGuenther / allesfitter

allesfitter is a convenient wrapper around the packages ellc (light curve and RV models), dynesty (static and dynamic nested sampling) emcee (Markov Chain Monte Carlo sampling) and celerite (Gaussian Process models).
MIT License
60 stars 36 forks source link

allesclass bug #70

Open franpoz opened 1 year ago

franpoz commented 1 year ago

Hi,

I can not use allesclass anymore. Here the script that used to work fine:

import allesfitter
import numpy as np
import matplotlib.pyplot as plt
import lightkurve as lk
from utils import lcbin
from transitleastsquares import (
    transitleastsquares,
    cleaned_array,
    catalog_info,
    transit_mask
    )

datadir = 'TOI2081_fit' #change this to what you need
inst = 'TESS' #change this to what you need
key = 'flux' #change this to what you need

alles = allesfitter.allesclass(datadir)

but now I have the following error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-8-3163506451a8> in <module>
      3 key = 'flux' #change this to what you need
      4 
----> 5 alles = allesfitter.allesclass(datadir)

~/anaconda3/lib/python3.8/site-packages/allesfitter/__init__.py in __init__(self, datadir, quiet)
    107         if os.path.exists( os.path.join(config.BASEMENT.outdir,'save_ns.pickle.gz') ):
    108             f = gzip.GzipFile(os.path.join(config.BASEMENT.outdir,'save_ns.pickle.gz'), 'rb')
--> 109             results = pickle.load(f)
    110             f.close()
    111             self.posterior_samples = nested_sampling_output.draw_ns_posterior_samples(results) # all weighted posterior_samples

TypeError: 'Results' object does not support item assignment

allesfitter 1.2.10