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
62 stars 36 forks source link

Import fails in Python 3.9 #38

Closed mwcraig closed 3 years ago

mwcraig commented 3 years ago

I installed allesfitter in a new python 3.9 environment and got the traceback below when I tried to import it. Installing in a python 3.8 environment instead fixed the issue.

In [1]: import allesfitter
Traceback (most recent call last):

  File "/Users/mattcraig/miniconda3/envs/alles/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3441, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-1-006995d2ab9b>", line 1, in <module>
    import allesfitter

  File "/Users/mattcraig/miniconda3/envs/alles/lib/python3.9/site-packages/allesfitter/__init__.py", line 45, in <module>
    from .mcmc import mcmc_fit

  File "/Users/mattcraig/miniconda3/envs/alles/lib/python3.9/site-packages/allesfitter/mcmc.py", line 37, in <module>
    from .computer import update_params, calculate_lnlike_total

  File "/Users/mattcraig/miniconda3/envs/alles/lib/python3.9/site-packages/allesfitter/computer.py", line 47, in <module>
    from .lightcurves import translate_limb_darkening_from_q_to_u as q_to_u

  File "/Users/mattcraig/miniconda3/envs/alles/lib/python3.9/site-packages/allesfitter/lightcurves.py", line 39, in <module>
    from .plotting import tessplot

  File "/Users/mattcraig/miniconda3/envs/alles/lib/python3.9/site-packages/allesfitter/plotting.py", line 36, in <module>
    from allesfitter.io import read_csv

  File "/Users/mattcraig/miniconda3/envs/alles/lib/python3.9/site-packages/allesfitter/io.py", line 62
    X = np.column_stack((*arrays))
                         ^
SyntaxError: can't use starred expression here
ganesh1076 commented 3 years ago

Yes, I am facing the same issue.

MNGuenther commented 3 years ago

Thanks for raising this, @mwcraig and @ganesh1076! This was caused by a syntax change in the new Python 3.9 (versus Python 3.8). I have updated the respective line of code and pushed allesfitter v1.2.6 to PyPI. If you now pip install the new version, it should run on all Python>=2.7 and >=3.5 again.