-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Datatype coercion is not allowed" when creating session with custom timeseries array #262
Comments
@nielsenmb couldn't reproduce this in Python 3.7 and neither can I with Python 3.7.4. I do, however, hit this with Python 3.8.2 and
|
Creating the LightCurve object seems to be fine so I had a closer look at why assigning the timeseries that are downloaded via Lightkurve works but passing a custom timeseries doesn't. Mimicking the code in PBjam, I tried this import numpy as np
import pandas as pd
import lightkurve as lk
import pbjam
n = 1000
data = np.zeros((2,n))
data[0] = np.arange(n, dtype=float)/720
data[1] = np.random.randn(n)
df = pd.DataFrame({'ID': np.array(['test']).reshape((-1,1)).flatten()})
df['timeseries'] = [lk.LightCurve(time=data[0], flux=data[1])] which is similar to the code path followed for custom timeseries and reproduces the If I change the last line to this, which tries to be more like the path for downloaded objects (i.e. when you pass a string identifier), it appears to work: df.at[0, 'timeseries'] = lk.LightCurve(time=data[0], flux=data[1], targetid='test') |
seems to work |
Here's a script that creates a basic timeseries of Gaussian noise in a 2×1000 array.
It fails with the following traceback:
I had a brief look around. The problem isn't the conversion of the timeseries into a Lightkurve object but rather when adding this to the
vardf
dataframe.I just did a
git pull
so I'm using the top ofmaster
(commit 0c5591a). If any other versions are relevant, they are:The text was updated successfully, but these errors were encountered: