Skip to content
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

closing session crashes when frames are dropped #24

Open
iverissimo opened this issue May 21, 2021 · 1 comment
Open

closing session crashes when frames are dropped #24

iverissimo opened this issue May 21, 2021 · 1 comment

Comments

@iverissimo
Copy link

Hey,

I'm designing a stimuli that has fairly fast flickering, and I want the trial to stop upon a keypress.

I noticed that the code would crash when defining and saving the global_log with the message:

File "/Users/verissimo/anaconda3/envs/i36/lib/python3.6/site-packages/exptools2-0.1.dev0-py3.6.egg/exptools2/core/session.py", line 251, in close
    self.global_log.loc[nonresp_idx, 'nr_frames'] = nr_frames.astype(int)
ValueError: cannot convert float NaN to integer

I think it's because of frames dropping throughout the trial. I solved it by replacing this line

self.global_log.loc[nonresp_idx, 'nr_frames'] = nr_frames.astype(int)

with:
self.global_log.loc[nonresp_idx, 'nr_frames'] = nr_frames.astype(np.float).astype('Int32')

@lukassnoek
Copy link
Contributor

Sounds good. Maybe easiest to just push to master? (@tknapen )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants