vu-cog-sci / exptools2 Goto Github PK
View Code? Open in Web Editor NEWVersion 2 of exptools (by KnapenLab)
Version 2 of exptools (by KnapenLab)
Hey guys,
Both demo experiments as well as my own experiments completely run and write log files, but then crash with the following error:
2019-05-26 15:49:47.648 python[15224:110803] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7f93da0281d0
2019-05-26 15:49:47.650 python[15224:110803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7f93da0281d0'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff304be43d __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff5c3cb720 objc_exception_throw + 48
2 CoreFoundation 0x00007fff3053b255 -[NSObject(NSObject) __retain_OA] + 0
3 CoreFoundation 0x00007fff3045dad0 ___forwarding___ + 1486
4 CoreFoundation 0x00007fff3045d478 _CF_forwarding_prep_0 + 120
5 libtk8.6.dylib 0x0000000121a8831d TkpInit + 413
6 libtk8.6.dylib 0x00000001219e017e Initialize + 2622
7 _tkinter.cpython-36m-darwin.so 0x0000000121808a16 _tkinter_create + 1174
8 python 0x000000010ff59068 _PyCFunction_FastCallDict + 200
9 python 0x000000011002e61f call_function + 143
10 python 0x000000011002c175 _PyEval_EvalFrameDefault + 46837
11 python 0x000000011001f8c9 _PyEval_EvalCodeWithName + 425
12 python 0x000000011002f2cc _PyFunction_FastCallDict + 364
13 python 0x000000010fed7f80 _PyObject_FastCallDict + 320
14 python 0x000000010feff5f8 method_call + 136
15 python 0x000000010fedf5ce PyObject_Call + 62
16 python 0x000000010ff805b5 slot_tp_init + 117
17 python 0x000000010ff84af1 type_call + 241
18 python 0x000000010fed7ef1 _PyObject_FastCallDict + 177
19 python 0x000000010fee0137 _PyObject_FastCallKeywords + 327
20 python 0x000000011002e718 call_function + 392
21 python 0x000000011002c225 _PyEval_EvalFrameDefault + 47013
22 python 0x000000011002e9dc fast_function + 188
23 python 0x000000011002e67c call_function + 236
24 python 0x000000011002c175 _PyEval_EvalFrameDefault + 46837
25 python 0x000000011001f8c9 _PyEval_EvalCodeWithName + 425
26 python 0x000000011002f2cc _PyFunction_FastCallDict + 364
27 python 0x000000010fed7f80 _PyObject_FastCallDict + 320
28 python 0x000000010feff5f8 method_call + 136
29 python 0x000000010fedf5ce PyObject_Call + 62
30 python 0x000000011002c376 _PyEval_EvalFrameDefault + 47350
31 python 0x000000011001f8c9 _PyEval_EvalCodeWithName + 425
32 python 0x000000010ff2292d function_call + 125
33 python 0x000000010fedf5ce PyObject_Call + 62
34 python 0x000000011002c376 _PyEval_EvalFrameDefault + 47350
35 python 0x000000011001f8c9 _PyEval_EvalCodeWithName + 425
36 python 0x000000011002ea8a fast_function + 362
37 python 0x000000011002e67c call_function + 236
38 python 0x000000011002c225 _PyEval_EvalFrameDefault + 47013
39 python 0x000000011002e9dc fast_function + 188
40 python 0x000000011002e67c call_function + 236
41 python 0x000000011002c175 _PyEval_EvalFrameDefault + 46837
42 python 0x000000011002e9dc fast_function + 188
43 python 0x000000011002e67c call_function + 236
44 python 0x000000011002c175 _PyEval_EvalFrameDefault + 46837
45 python 0x000000011001f8c9 _PyEval_EvalCodeWithName + 425
46 python 0x000000011007855c PyRun_FileExFlags + 252
47 python 0x0000000110077a34 PyRun_SimpleFileExFlags + 372
48 python 0x000000011009e7c6 Py_Main + 3734
49 python 0x000000010fecff59 main + 313
50 libdyld.dylib 0x00007fff5d499085 start + 1
51 ??? 0x0000000000000002 0x0 + 2
Does this look familiar to anyone? Is this a pyschopy/qt-issue?
I use qt 5.9.7 and psychopy 3.1.2, wxpython 4.0.6 with mac os x 10.14.
Also when I follow the psychopy installation instructions exactly, but then replace python 3.5 with 3.6, I get the same errors, even though it uses tk 8.6.8 and wxpython 4.0.4
Having followed the previous installation steps, after running pip install git+https://github.com/VU-Cog-Sci/exptools2/
I am getting the following error:
Collecting pocketsphinx
Downloading pocketsphinx-0.1.15.tar.gz (29.1 MB)
---------------------------------------- 29.1/29.1 MB 13.6 MB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\leonb\AppData\Local\Temp\pip-install-ruvaa2uk\pocketsphinx_3b3fbb0f2d674c4f8065bf4bb006163c\setup.py", line 20, in <module>
from distutils.command.bdist_msi import bdist_msi as _bdist_msi
ModuleNotFoundError: No module named 'distutils.command.bdist_msi'
[end of output]
Any suggestions for troubleshooting?
I keep getting errors like this at the end of the experiment. Sometimes they happen and sometimes they don't.
Traceback (most recent call last):
File "main.py", line 124, in <module>
session.run()
File "main.py", line 114, in run
trial.run()
File "/Users/gilles/git/exptools2/exptools2/core/trial.py", line 237, in run
self.get_events()
File "/Users/gilles/git/exptools2/exptools2/core/trial.py", line 150, in get_events
self.session.close()
File "/Users/gilles/git/exptools2/exptools2/core/session.py", line 252, in close
self.global_log.loc[nonresp_idx, 'nr_frames'] = nr_frames.astype(int)
ValueError: cannot convert float NaN to integer
it seems that at that point self.global_log.loc[nonresp_idx, 'nr_frames'].values[1:]
is equal to [nan nan]
(or longer, like [nan nan nan nan nan nan nan nan nan nan nan nan nan nan]
) and self.nr_frames is a proper number (e.g., 358 in this case).
Can someone explain this line of code?
exptools2/exptools2/core/session.py
Line 250 in 723454f
As from title. I note that these files were produced when i did the pilot so this might have already been addressed in a more recent exptools2 version. Delete issue if that is the case!
Error 1: [Code 20] EVENTS_COLUMN_ONSET
First column of the events file must be named 'onset'
Error 2: [Code 21] EVENTS_COLUMN_DURATION
Second column of the events file must be named 'duration'
Error 3: [Code 22] TSV_EQUAL_ROWS
All rows must have the same number of columns as there are headers.
Error 4: [Code 23] TSV_EMPTY_CELL
Empty cell in TSV file detected: The proper way of labeling missing values is "n/a".
Warning 1: [Code 82] CUSTOM_COLUMN_WITHOUT_DESCRIPTION
Tabular file contains custom columns not described in a data dictionary
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
exptools2/exptools2/core/session.py
Line 251 in b41407a
self.global_log.loc[nonresp_idx, 'nr_frames'] = nr_frames.astype(np.float).astype('Int32')
Is not recursive, but should be.
When developing an experiment, I noticed that I can't overload the get_events()
-method of the Trial
-class, without repeating the logging part etc entirely: If you use super().get_events()
, that method flushes the event buffer using psychopy.events.getKeys()
, which means I can't access the events
/keys that were pressed.
I propose that we let Trial.get_events()
also return events
, so that overloaded methods can act on it, without repeating/rewriting the logging part. So you could do:
My Trial(...):
def get_events():
events = super().get_events()
if 'y' in events:
print("yo")
And still everything get logged.
Any ideas?
It appears the size of the window obtained from session.win is not the same size set through the parameter file. Looks like a psychopy issue, or maybe only my system.
Some requirements aren't listed in the readme. Microsoft Visual C++ 14 or higher and swig are necessary.
When following the steps described in 'Installation using conda', we ran in to
ERROR: Failed building wheel for pywinhook
...
error: command 'swig.exe' failed: None [end of output]
After installing swig using pip install swig
, the above was solved. It was then followed by
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
After installing Visual Studio Build Tools 2022 (17.5.1) using the Visual Studio Installer, Microsoft Visual C++ 14.35.31938 was installed (2015-2022 Redistributable).
This allowed pip install pywinhook
to complete successfully.
Suggested to update this in the readme!
Kind regards,
FGB Brain and Behavior Lab Team
Hi,
I am trying to install exptools2 in an Anaconda environment and followed the instructions of the readme. When running the command pip install zmq json-tricks pyparallel sounddevice pygame pysoundcard psychopy_ext psychopy
I get an error when Collecting Psychopy:
Downloading PsychoPy-2022.2.3.zip (26.2 MB)
|████████████████████████████████| 26.2 MB 6.8 MB/s
Downloading PsychoPy-2022.2.2.zip (26.2 MB)
|████████████████████████████████| 26.2 MB 104 kB/s
ERROR: Command errored out with exit status 1:
command: 'C:\Users\leonb\anaconda3\envs\exptools2\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\leonb\\AppData\\Local\\Temp\\pip-install-uu_o5bu8\\psychopy_84a574850b85419a8e4bb9ab601178bf\\setup.py'"'"'; __file__='"'"'C:\\Users\\leonb\\AppData\\Local\\Temp\\pip-install-uu_o5bu8\\psychopy_84a574850b85419a8e4bb9ab601178bf\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\leonb\AppData\Local\Temp\pip-pip-egg-info-tl9klxdl'
cwd: C:\Users\leonb\AppData\Local\Temp\pip-install-uu_o5bu8\psychopy_84a574850b85419a8e4bb9ab601178bf\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\leonb\AppData\Local\Temp\pip-install-uu_o5bu8\psychopy_84a574850b85419a8e4bb9ab601178bf\setup.py", line 41, in <module>
required.remove('pyqt5; python_version >= "3"')
ValueError: list.remove(x): x not in list
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/b9/91/7a2f0acb1c9ed4e4f03aab2e1e349d33e97e6904f2436ad36f4dccfbe116/PsychoPy-2022.2.2.zip#sha256=8bbb058e12674a83ca3266a894d7cb856c36876f690f455630f353f0dda2f4f8 (from https://pypi.org/simple/psychopy/) (requires-python:>=3.6). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
This error repeats for the next download (Downloading PsychoPy-2022.2.0.zip (27.3 MB)).
Hey guys,
Great work.
I'm starting a new project and developing an experiment from scratch . Since a year or two I try to do everything properly with with fixed Docker images and conda environments, but I keep spending a good portion of my precious postdoc time on duck taping backward compatibility issues of different Python packages. I think it would be super helpful if we could make different releases of exptools2 (rather than, e.g., commits) that we can use, so it's super clear with what exptools-code a given experiment was put together.
Github has a nice lemma on this:
https://help.github.com/en/articles/creating-releases
Cheers,
Gilles
Some issues I encountered when installing for the first time and trying to get the basic Stroop example to work.
wxpython & xlrd
psychopy-sounddevice and psychopy-mri-emulator
from psychopy.hardware.emulator import SyncGenerator
in exptools2.core.sessionpip install psychopy-sounddevice pscyhopy-mri-emulator
Recommended updated installation instruction
conda create -n exptools2 python=3.9
conda activate exptools2
conda install numpy scipy matplotlib pandas pyopengl pillow lxml openpyxl configobj pyyaml gevent greenlet msgpack-python psutil pytables requests[security] cffi seaborn cython pyzmq pyserial qt pyqt
conda install -c conda-forge pyglet pysoundfile python-bidi moviepy pyosf
pip install zmq json-tricks pyparallel sounddevice pygame pysoundcard psychopy_ext psychopy psychopy-sounddevice psychopy-mri-emulator
pip install git+https://github.com/VU-Cog-Sci/exptools2/
Hope this helps someone :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.