grd349 / PBjam

A repo for our peak baggin code and tips on jam
MIT License
17 stars 6 forks source link

Fix bug in jar.py/format_col caused by incorrect order of arguments to arr_to_lk #152

Closed warrickball closed 5 years ago

warrickball commented 5 years ago

This excerpt

import numpy as np
import pbjam

timeseries = np.random.rand(2, 10000)
s = pbjam.session(timeseries=timeseries, ID=200093173, numax=(600.0, 10.0), dnu=(35.00, 2.00),
                  teff=(5360, 100), bp_rp=(0.9120, 0.16), make_plots=True)

fails with the error message

Traceback (most recent call last):
  File "test_pbjam.py", line 11, in <module>
    teff=(5360, 100), bp_rp=(0.9120, 0.16), make_plots=True)
  File "/home/wball/pypi/PBjam/pbjam/jar.py", line 599, in __init__
    format_col(vardf, timeseries, 'timeseries')
  File "/home/wball/pypi/PBjam/pbjam/jar.py", line 347, in format_col
    vardf[key] = np.array([arr_to_lk(x, y, vardf['ID'][0])], key)
TypeError: arr_to_lk() missing 1 required positional argument: 'typ'

because the close brackets in the offending line (vardf[key]...) seem to be in the wrong order.

This PR should fix it.