psychopy 2024.1.4__py3-none-any.whl → 2024.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of psychopy might be problematic. Click here for more details.
- psychopy/.DS_Store +0 -0
- psychopy/CHANGELOG.txt +206 -0
- psychopy/GIT_SHA +1 -0
- psychopy/VERSION +1 -0
- psychopy/__init__.py +77 -15
- psychopy/app/Resources/classic/plugin16.png +0 -0
- psychopy/app/Resources/classic/plugin16@2x.png +0 -0
- psychopy/app/Resources/dark/plugin16.png +0 -0
- psychopy/app/Resources/dark/plugin16@2x.png +0 -0
- psychopy/app/Resources/light/plugin16.png +0 -0
- psychopy/app/Resources/light/plugin16@2x.png +0 -0
- psychopy/app/__init__.py +76 -2
- psychopy/app/_psychopyApp.py +126 -101
- psychopy/app/builder/builder.py +14 -10
- psychopy/app/builder/dialogs/__init__.py +8 -8
- psychopy/app/builder/dialogs/dlgsConditions.py +12 -13
- psychopy/app/builder/dialogs/paramCtrls.py +24 -57
- psychopy/app/builder/validators.py +2 -2
- psychopy/app/coder/codeEditorBase.py +8 -8
- psychopy/app/coder/coder.py +4 -4
- psychopy/app/connections/sendusage.py +2 -2
- psychopy/app/connections/updates.py +9 -9
- psychopy/app/dialogs.py +34 -2
- psychopy/app/idle.py +31 -0
- psychopy/app/jobs.py +21 -3
- psychopy/app/linuxconfig/__init__.py +9 -0
- psychopy/app/locale/ar_001/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/ar_001/LC_MESSAGE/messages.po +4602 -2540
- psychopy/app/locale/es_CO/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/es_CO/LC_MESSAGE/messages.po +56 -54
- psychopy/app/locale/es_ES/LC_MESSAGE/messages.po +53 -43
- psychopy/app/locale/es_US/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/es_US/LC_MESSAGE/messages.po +56 -54
- psychopy/app/locale/ja_JP/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/ja_JP/LC_MESSAGE/messages.po +1011 -942
- psychopy/app/locale/pt_PT/LC_MESSAGE/messages.po +9415 -5
- psychopy/app/pavlovia_ui/_base.py +33 -3
- psychopy/app/pavlovia_ui/search.py +0 -1
- psychopy/app/plugin_manager/dialog.py +104 -51
- psychopy/app/plugin_manager/packages.py +5 -0
- psychopy/app/plugin_manager/plugins.py +145 -67
- psychopy/app/preferencesDlg.py +8 -8
- psychopy/app/psychopyApp.py +11 -5
- psychopy/app/ribbon.py +124 -14
- psychopy/app/runner/runner.py +6 -1
- psychopy/app/stdout/stdOutRich.py +27 -11
- psychopy/app/themes/icons.py +52 -2
- psychopy/assets/__init__.py +0 -0
- psychopy/assets/click.png +0 -0
- psychopy/assets/clicknext.png +0 -0
- psychopy/assets/next.png +0 -0
- psychopy/assets/psychopy.ico +0 -0
- psychopy/assets/psychopy.png +0 -0
- psychopy/assets/templates/__init__.py +0 -0
- psychopy/assets/touch.png +0 -0
- psychopy/assets/touchnext.png +0 -0
- psychopy/assets/window.ico +0 -0
- psychopy/changes/2023.1.0.md +9 -0
- psychopy/changes/2024.1.0.md +16 -0
- psychopy/changes/__init__.py +0 -0
- psychopy/clock.py +2 -2
- psychopy/colors.py +2 -1
- psychopy/compatibility.py +53 -1
- psychopy/contrib/.DS_Store +0 -0
- psychopy/contrib/configobj/__init__.py +10 -8
- psychopy/data/__init__.py +3 -2
- psychopy/data/base.py +5 -5
- psychopy/data/experiment.py +130 -4
- psychopy/data/routine.py +56 -0
- psychopy/data/staircase.py +2 -2
- psychopy/data/trial.py +559 -97
- psychopy/data/utils.py +56 -21
- psychopy/demos/.DS_Store +0 -0
- psychopy/demos/builder/.DS_Store +0 -0
- psychopy/demos/builder/Design Templates/.DS_Store +0 -0
- psychopy/demos/builder/Experiments/.DS_Store +0 -0
- psychopy/demos/builder/Feature Demos/.DS_Store +0 -0
- psychopy/demos/builder/Feature Demos/buttonBox/buttonBoxDemo.psyexp +375 -0
- psychopy/demos/builder/Feature Demos/buttonBox/readme.md +5 -0
- psychopy/demos/builder/Feature Demos/pilotMode/pilotMode.psyexp +433 -0
- psychopy/demos/builder/Feature Demos/pilotMode/readme.md +7 -0
- psychopy/demos/builder/Hardware/.DS_Store +0 -0
- psychopy/demos/builder/Helper Tools/.DS_Store +0 -0
- psychopy/demos/coder/.DS_Store +0 -0
- psychopy/demos/coder/hardware/testSoundLatency.py +2 -2
- psychopy/demos/coder/iohub/.DS_Store +0 -0
- psychopy/demos/coder/misc/hdf5_2_csv +33 -0
- psychopy/event.py +30 -29
- psychopy/experiment/.DS_Store +0 -0
- psychopy/experiment/_experiment.py +6 -6
- psychopy/experiment/components/.DS_Store +0 -0
- psychopy/experiment/components/__init__.py +6 -3
- psychopy/experiment/components/_base.py +286 -131
- psychopy/experiment/components/aperture/.DS_Store +0 -0
- psychopy/experiment/components/brush/.DS_Store +0 -0
- psychopy/experiment/components/button/.DS_Store +0 -0
- psychopy/experiment/components/button/__init__.py +5 -1
- psychopy/experiment/components/buttonBox/.DS_Store +0 -0
- psychopy/experiment/components/camera/.DS_Store +0 -0
- psychopy/experiment/components/code/.DS_Store +0 -0
- psychopy/experiment/components/dots/.DS_Store +0 -0
- psychopy/experiment/components/eyetracker_record/.DS_Store +0 -0
- psychopy/experiment/components/eyetracker_record/__init__.py +92 -30
- psychopy/experiment/components/form/.DS_Store +0 -0
- psychopy/experiment/components/form/__init__.py +6 -2
- psychopy/experiment/components/grating/.DS_Store +0 -0
- psychopy/experiment/components/grating/__init__.py +14 -3
- psychopy/experiment/components/image/.DS_Store +0 -0
- psychopy/experiment/components/image/__init__.py +14 -3
- psychopy/experiment/components/joyButtons/.DS_Store +0 -0
- psychopy/experiment/components/joystick/.DS_Store +0 -0
- psychopy/experiment/components/keyboard/.DS_Store +0 -0
- psychopy/experiment/components/keyboard/__init__.py +22 -10
- psychopy/experiment/components/microphone/.DS_Store +0 -0
- psychopy/experiment/components/microphone/__init__.py +59 -39
- psychopy/experiment/components/mouse/.DS_Store +0 -0
- psychopy/experiment/components/mouse/__init__.py +44 -29
- psychopy/experiment/components/movie/.DS_Store +0 -0
- psychopy/experiment/components/movie/__init__.py +1 -1
- psychopy/experiment/components/panorama/.DS_Store +0 -0
- psychopy/experiment/components/parallelOut/.DS_Store +0 -0
- psychopy/experiment/components/patch/.DS_Store +0 -0
- psychopy/experiment/components/polygon/.DS_Store +0 -0
- psychopy/experiment/components/polygon/__init__.py +26 -6
- psychopy/experiment/components/progress/.DS_Store +0 -0
- psychopy/experiment/components/ratingScale/.DS_Store +0 -0
- psychopy/experiment/components/resourceManager/.DS_Store +0 -0
- psychopy/experiment/components/roi/.DS_Store +0 -0
- psychopy/experiment/components/roi/__init__.py +5 -0
- psychopy/experiment/components/routineSettings/.DS_Store +0 -0
- psychopy/experiment/components/routineSettings/__init__.py +57 -10
- psychopy/experiment/components/serialOut/.DS_Store +0 -0
- psychopy/experiment/components/settings/.DS_Store +0 -0
- psychopy/experiment/components/settings/__init__.py +117 -42
- psychopy/experiment/components/slider/.DS_Store +0 -0
- psychopy/experiment/components/sound/.DS_Store +0 -0
- psychopy/experiment/components/sound/__init__.py +54 -19
- psychopy/experiment/components/static/.DS_Store +0 -0
- psychopy/experiment/components/static/__init__.py +1 -1
- psychopy/experiment/components/text/.DS_Store +0 -0
- psychopy/experiment/components/text/__init__.py +28 -3
- psychopy/experiment/components/textbox/.DS_Store +0 -0
- psychopy/experiment/components/textbox/__init__.py +12 -2
- psychopy/experiment/components/unknown/.DS_Store +0 -0
- psychopy/experiment/components/unknown/__init__.py +1 -2
- psychopy/experiment/components/unknownPlugin/.DS_Store +0 -0
- psychopy/experiment/components/unknownPlugin/__init__.py +2 -2
- psychopy/experiment/components/variable/.DS_Store +0 -0
- psychopy/experiment/flow.py +11 -4
- psychopy/experiment/loops.py +85 -37
- psychopy/experiment/params.py +74 -32
- psychopy/experiment/py2js_transpiler.py +8 -1
- psychopy/experiment/routines/.DS_Store +0 -0
- psychopy/experiment/routines/_base.py +102 -22
- psychopy/experiment/routines/counterbalance/.DS_Store +0 -0
- psychopy/experiment/routines/counterbalance/__init__.py +5 -1
- psychopy/experiment/routines/eyetracker_calibrate/.DS_Store +0 -0
- psychopy/experiment/routines/eyetracker_validate/.DS_Store +0 -0
- psychopy/experiment/routines/pavlovia_survey/.DS_Store +0 -0
- psychopy/experiment/routines/photodiodeValidator/.DS_Store +0 -0
- psychopy/experiment/routines/photodiodeValidator/__init__.py +6 -5
- psychopy/experiment/routines/unknown/.DS_Store +0 -0
- psychopy/gui/wxgui.py +4 -4
- psychopy/hardware/.DS_Store +0 -0
- psychopy/hardware/__init__.py +1 -1
- psychopy/hardware/base.py +12 -0
- psychopy/hardware/camera/__init__.py +1 -15
- psychopy/hardware/cedrus.py +10 -11
- psychopy/hardware/crs/colorcal.py +13 -22
- psychopy/hardware/crs/optical.py +10 -20
- psychopy/hardware/emulator.py +17 -14
- psychopy/hardware/eyetracker.py +42 -118
- psychopy/hardware/gammasci.py +4 -15
- psychopy/hardware/keyboard.py +102 -10
- psychopy/hardware/listener.py +3 -0
- psychopy/hardware/microphone.py +148 -18
- psychopy/hardware/minolta.py +8 -15
- psychopy/hardware/photodiode.py +191 -16
- psychopy/hardware/photometer/__init__.py +11 -19
- psychopy/hardware/pr.py +8 -15
- psychopy/hardware/speaker.py +39 -4
- psychopy/info.py +0 -71
- psychopy/iohub/.DS_Store +0 -0
- psychopy/iohub/__init__.py +1 -1
- psychopy/iohub/client/__init__.py +30 -20
- psychopy/iohub/client/keyboard.py +24 -24
- psychopy/iohub/datastore/__init__.py +2 -2
- psychopy/iohub/datastore/util.py +2 -2
- psychopy/iohub/default_config.yaml +1 -1
- psychopy/iohub/devices/.DS_Store +0 -0
- psychopy/iohub/devices/__init__.py +112 -25
- psychopy/iohub/devices/deviceConfigValidation.py +2 -1
- psychopy/iohub/devices/experiment/default_experiment.yaml +12 -1
- psychopy/iohub/devices/experiment/supported_config_settings.yaml +5 -1
- psychopy/iohub/devices/eyetracker/.DS_Store +0 -0
- psychopy/iohub/devices/eyetracker/__init__.py +46 -0
- psychopy/iohub/devices/eyetracker/calibration/procedure.py +2 -2
- psychopy/iohub/devices/eyetracker/hw/gazepoint/__init__.py +14 -2
- psychopy/iohub/devices/eyetracker/hw/mouse/eyetracker.py +3 -4
- psychopy/iohub/server.py +2 -2
- psychopy/iohub/start_iohub_process.py +3 -0
- psychopy/iohub/util/__init__.py +62 -70
- psychopy/layout.py +5 -5
- psychopy/logging.py +8 -1
- psychopy/microphone.py +10 -37
- psychopy/platform_specific/__init__.py +0 -2
- psychopy/platform_specific/darwin.py +1 -3
- psychopy/platform_specific/linux.py +31 -33
- psychopy/platform_specific/win32.py +38 -13
- psychopy/plugins/__init__.py +148 -116
- psychopy/plugins/util.py +39 -0
- psychopy/preferences/Darwin.spec +4 -2
- psychopy/preferences/FreeBSD.spec +4 -2
- psychopy/preferences/Linux.spec +4 -2
- psychopy/preferences/Windows.spec +4 -2
- psychopy/preferences/baseNoArch.spec +4 -2
- psychopy/preferences/preferences.py +47 -24
- psychopy/projects/pavlovia.py +47 -4
- psychopy/scripts/psyexpCompile.py +0 -4
- psychopy/session.py +153 -21
- psychopy/sound/__init__.py +31 -21
- psychopy/sound/_base.py +20 -3
- psychopy/sound/audioclip.py +320 -33
- psychopy/sound/backend_ptb.py +47 -58
- psychopy/sound/backend_pygame.py +1 -1
- psychopy/sound/backend_pysound.py +6 -15
- psychopy/sound/transcribe.py +53 -0
- psychopy/tests/.DS_Store +0 -0
- psychopy/tests/data/.DS_Store +0 -0
- psychopy/tests/data/TestUnknownPluginComponent_load_resave.psyexp +135 -0
- psychopy/tests/data/Test_textbox/test_ori_0_bottom right.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_0_center.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_0_top left.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_120_bottom right.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_120_center.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_120_top left.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_180_bottom right.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_180_center.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_180_top left.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_240_bottom right.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_240_center.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_240_top left.png +0 -0
- psychopy/tests/data/correctScript/.DS_Store +0 -0
- psychopy/tests/data/test_components/testClearKeyboard/testClearKeyboard.psyexp +200 -0
- psychopy/tests/data/test_session/.DS_Store +0 -0
- psychopy/tests/data/test_session/root/testFutureTrials/testFutureTrials.psyexp +155 -0
- psychopy/tests/data/test_session/root/testTrialNav/trialNav.psyexp +158 -0
- psychopy/tests/test_app/.DS_Store +0 -0
- psychopy/tests/test_app/conftest.py +2 -2
- psychopy/tests/test_app/test_speed.py +4 -1
- psychopy/tests/test_data/test_TrialHandler2.py +146 -1
- psychopy/tests/test_experiment/.DS_Store +0 -0
- psychopy/tests/test_experiment/needs_wx/genComponsTemplate.py +3 -3
- psychopy/tests/test_experiment/needs_wx/test_components.py +2 -2
- psychopy/tests/test_experiment/test_components/test_KeyboardComponent.py +28 -0
- psychopy/tests/test_experiment/test_components/test_UnknownPluginComponent.py +27 -0
- psychopy/tests/test_experiment/test_components/test_base_components.py +58 -0
- psychopy/tests/test_experiment/test_py2js.py +1 -1
- psychopy/tests/test_hardware/test_keyboard.py +31 -0
- psychopy/tests/test_hardware/test_ports.py +1 -11
- psychopy/tests/test_liaison/test_Liaison.py +47 -0
- psychopy/tests/test_misc/test_core.py +5 -0
- psychopy/tests/test_session/test_Session.py +5 -1
- psychopy/tests/test_tools/test_versionchooser.py +39 -8
- psychopy/tests/test_visual/test_all_stimuli.py +0 -97
- psychopy/tests/test_visual/test_image.py +6 -5
- psychopy/tests/test_visual/test_textbox.py +36 -0
- psychopy/tests/utils.py +4 -0
- psychopy/tools/filetools.py +1 -1
- psychopy/tools/pkgtools.py +160 -137
- psychopy/tools/versionchooser.py +10 -10
- psychopy/tools/wizard.py +3 -3
- psychopy/visual/.DS_Store +0 -0
- psychopy/visual/backends/pygletbackend.py +24 -13
- psychopy/visual/basevisual.py +5 -11
- psychopy/visual/button.py +2 -14
- psychopy/visual/helpers.py +5 -5
- psychopy/visual/line.py +1 -2
- psychopy/visual/movie2.py +7 -816
- psychopy/visual/movie3.py +7 -589
- psychopy/visual/movies/__init__.py +8 -11
- psychopy/visual/movies/frame.py +5 -2
- psychopy/visual/movies/players/ffpyplayer_player.py +5 -2
- psychopy/visual/noise.py +8 -7
- psychopy/visual/patch.py +7 -16
- psychopy/visual/radial.py +9 -7
- psychopy/visual/ratingscale.py +8 -1415
- psychopy/visual/secondorder.py +10 -9
- psychopy/visual/shape.py +7 -2
- psychopy/visual/text.py +1 -1
- psychopy/visual/textbox2/textbox2.py +28 -5
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/METADATA +8 -13
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/RECORD +307 -213
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/WHEEL +1 -1
- psychopy/app/Resources/click.png +0 -0
- psychopy/app/Resources/next.png +0 -0
- psychopy/experiment/components/patch/__init__.py +0 -121
- psychopy/experiment/components/patch/classic/patch.png +0 -0
- psychopy/experiment/components/patch/dark/patch.png +0 -0
- psychopy/experiment/components/patch/dark/patch@2x.png +0 -0
- psychopy/experiment/components/patch/light/patch.png +0 -0
- psychopy/experiment/components/patch/light/patch@2x.png +0 -0
- psychopy/experiment/components/ratingScale/__init__.py +0 -337
- psychopy/experiment/components/ratingScale/classic/ratingscale.png +0 -0
- psychopy/experiment/components/ratingScale/classic/ratingscale@2x.png +0 -0
- psychopy/experiment/components/ratingScale/dark/ratingScale@2x.png +0 -0
- psychopy/experiment/components/ratingScale/dark/ratingscale.png +0 -0
- psychopy/experiment/components/ratingScale/light/ratingScale@2x.png +0 -0
- psychopy/experiment/components/ratingScale/light/ratingscale.png +0 -0
- psychopy/platform_specific/posix.py +0 -16
- psychopy/tests/test_sound/test_microphone.py +0 -217
- psychopy/tests/test_visual/test_ratingScale.py +0 -299
- /psychopy/{app/Resources → assets}/Psychopy Window Favicon@16w.png +0 -0
- /psychopy/{app/Resources → assets}/Psychopy Window Favicon@32w.png +0 -0
- /psychopy/{app/Resources → assets}/USB-C.png +0 -0
- /psychopy/{app/Resources → assets}/USB.png +0 -0
- /psychopy/{app/Resources → assets}/creditCard.png +0 -0
- /psychopy/{app/Resources → assets}/default.mp3 +0 -0
- /psychopy/{app/Resources → assets}/default.mp4 +0 -0
- /psychopy/{app/Resources → assets}/default.png +0 -0
- /psychopy/{app/Resources → assets/templates}/instruct1.png +0 -0
- /psychopy/{app/Resources → assets/templates}/instruct2.png +0 -0
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/entry_points.txt +0 -0
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/licenses/AUTHORS.md +0 -0
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/licenses/LICENSE +0 -0
psychopy/data/utils.py
CHANGED
|
@@ -14,7 +14,7 @@ import numpy as np
|
|
|
14
14
|
import pandas as pd
|
|
15
15
|
|
|
16
16
|
from collections import OrderedDict
|
|
17
|
-
from
|
|
17
|
+
from packaging.version import Version
|
|
18
18
|
|
|
19
19
|
from psychopy import logging, exceptions
|
|
20
20
|
from psychopy.tools.filetools import pathToString
|
|
@@ -22,7 +22,7 @@ from psychopy.localization import _translate
|
|
|
22
22
|
|
|
23
23
|
try:
|
|
24
24
|
import openpyxl
|
|
25
|
-
if
|
|
25
|
+
if Version(openpyxl.__version__) >= Version('2.4.0'):
|
|
26
26
|
# openpyxl moved get_column_letter to utils.cell
|
|
27
27
|
from openpyxl.utils.cell import get_column_letter
|
|
28
28
|
else:
|
|
@@ -250,18 +250,63 @@ def importConditions(fileName, returnFieldNames=False, selection=""):
|
|
|
250
250
|
|
|
251
251
|
"""
|
|
252
252
|
|
|
253
|
-
def _attemptImport(fileName
|
|
253
|
+
def _attemptImport(fileName):
|
|
254
254
|
"""Attempts to import file with specified settings and raises
|
|
255
255
|
ConditionsImportError if fails due to invalid format
|
|
256
256
|
|
|
257
257
|
:param filename: str
|
|
258
|
-
:param sep: str indicating the separator for cells (',', ';' etc)
|
|
259
|
-
:param dec: str indicating the decimal point ('.', '.')
|
|
260
258
|
:return: trialList, fieldNames
|
|
261
259
|
"""
|
|
262
260
|
if fileName.endswith(('.csv', '.tsv')):
|
|
263
|
-
trialsArr =
|
|
264
|
-
|
|
261
|
+
trialsArr = None
|
|
262
|
+
errs = []
|
|
263
|
+
# list of possible delimiters
|
|
264
|
+
delims = (",", ".", ";", "\t")
|
|
265
|
+
# try a variety of separator / decimal pairs
|
|
266
|
+
for sep, dec in [
|
|
267
|
+
# most common in US, EU
|
|
268
|
+
(',', '.'),
|
|
269
|
+
(';', ','),
|
|
270
|
+
# other possible formats
|
|
271
|
+
('\t', '.'),
|
|
272
|
+
('\t', ','),
|
|
273
|
+
(';', '.')
|
|
274
|
+
]:
|
|
275
|
+
# try to load
|
|
276
|
+
try:
|
|
277
|
+
thisAttempt = pd.read_csv(
|
|
278
|
+
fileName, encoding='utf-8-sig', sep=sep, decimal=dec
|
|
279
|
+
)
|
|
280
|
+
# if there's only one header, check that it doesn't contain delimiters
|
|
281
|
+
# (one column with delims probably means it's parsed without error but not
|
|
282
|
+
# recognised columns correctly)
|
|
283
|
+
if len(thisAttempt.columns) == 1:
|
|
284
|
+
for delim in delims:
|
|
285
|
+
if delim in thisAttempt.columns[0]:
|
|
286
|
+
msg = _translate(
|
|
287
|
+
"Could not load {}. \n"
|
|
288
|
+
"Delimiter in heading: {} in {}."
|
|
289
|
+
).format(fileName, delim, thisAttempt.columns[0])
|
|
290
|
+
err = exceptions.ConditionsImportError(msg)
|
|
291
|
+
errs.append(err)
|
|
292
|
+
raise err
|
|
293
|
+
# if it's all good, use received array
|
|
294
|
+
trialsArr = thisAttempt
|
|
295
|
+
except:
|
|
296
|
+
continue
|
|
297
|
+
else:
|
|
298
|
+
# if successful, check the variable names
|
|
299
|
+
_assertValidVarNames(trialsArr.columns, fileName)
|
|
300
|
+
# skip other pairs now we've got it
|
|
301
|
+
break
|
|
302
|
+
# if all options failed, raise last error
|
|
303
|
+
if errs and trialsArr is None:
|
|
304
|
+
raise errs[-1]
|
|
305
|
+
elif trialsArr is None:
|
|
306
|
+
raise ValueError(
|
|
307
|
+
_translate("Could not parse file {}.").format(fileName)
|
|
308
|
+
)
|
|
309
|
+
# if we made it herre, we successfully loaded the file
|
|
265
310
|
for col in trialsArr.columns:
|
|
266
311
|
for row, cell in enumerate(trialsArr[col]):
|
|
267
312
|
if isinstance(cell, str):
|
|
@@ -358,17 +403,7 @@ def importConditions(fileName, returnFieldNames=False, selection=""):
|
|
|
358
403
|
|
|
359
404
|
if (fileName.endswith(('.csv', '.tsv'))
|
|
360
405
|
or (fileName.endswith(('.xlsx', '.xls', '.xlsm')) and haveXlrd)):
|
|
361
|
-
|
|
362
|
-
for sep, dec in [ (',', '.'), (';', ','), # most common in US, EU
|
|
363
|
-
('\t', '.'), ('\t', ','), (';', '.')]:
|
|
364
|
-
try:
|
|
365
|
-
trialList, fieldNames = _attemptImport(fileName=fileName,
|
|
366
|
-
sep=sep, dec=dec)
|
|
367
|
-
break # seems to have worked
|
|
368
|
-
except exceptions.ConditionsImportError as e:
|
|
369
|
-
continue # try a different format
|
|
370
|
-
else:
|
|
371
|
-
trialList, fieldNames = _attemptImport(fileName=fileName)
|
|
406
|
+
trialList, fieldNames = _attemptImport(fileName=fileName)
|
|
372
407
|
|
|
373
408
|
elif fileName.endswith(('.xlsx','.xlsm')): # no xlsread so use openpyxl
|
|
374
409
|
if not haveOpenpyxl:
|
|
@@ -378,7 +413,7 @@ def importConditions(fileName, returnFieldNames=False, selection=""):
|
|
|
378
413
|
)
|
|
379
414
|
|
|
380
415
|
# data_only was added in 1.8
|
|
381
|
-
if
|
|
416
|
+
if Version(openpyxl.__version__) < Version('1.8'):
|
|
382
417
|
wb = load_workbook(filename=fileName)
|
|
383
418
|
else:
|
|
384
419
|
wb = load_workbook(filename=fileName, data_only=True)
|
|
@@ -398,7 +433,7 @@ def importConditions(fileName, returnFieldNames=False, selection=""):
|
|
|
398
433
|
fieldNames = []
|
|
399
434
|
rangeCols = []
|
|
400
435
|
for colN in range(nCols):
|
|
401
|
-
if
|
|
436
|
+
if Version(openpyxl.__version__) < Version('2.0'):
|
|
402
437
|
fieldName = ws.cell(_getExcelCellName(col=colN, row=0)).value
|
|
403
438
|
else:
|
|
404
439
|
# From 2.0, cells are referenced with 1-indexing: A1 == cell(row=1, column=1)
|
|
@@ -414,7 +449,7 @@ def importConditions(fileName, returnFieldNames=False, selection=""):
|
|
|
414
449
|
for rowN in range(1, nRows): # skip header first row
|
|
415
450
|
thisTrial = {}
|
|
416
451
|
for rangeColsIndex, colN in enumerate(rangeCols):
|
|
417
|
-
if
|
|
452
|
+
if Version(openpyxl.__version__) < Version('2.0'):
|
|
418
453
|
val = ws.cell(_getExcelCellName(col=colN, row=0)).value
|
|
419
454
|
else:
|
|
420
455
|
# From 2.0, cells are referenced with 1-indexing: A1 == cell(row=1, column=1)
|
psychopy/demos/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
<?xml version="1.0" ?>
|
|
2
|
+
<PsychoPy2experiment encoding="utf-8" version="2024.2.0">
|
|
3
|
+
<Settings>
|
|
4
|
+
<Param val="3" valType="str" updates="None" name="Audio latency priority"/>
|
|
5
|
+
<Param val="ptb" valType="str" updates="None" name="Audio lib"/>
|
|
6
|
+
<Param val="" valType="str" updates="None" name="Completed URL"/>
|
|
7
|
+
<Param val="auto" valType="str" updates="None" name="Data file delimiter"/>
|
|
8
|
+
<Param val="u'data/%s_%s_%s' % (expInfo['participant'], expName, expInfo['date'])" valType="code" updates="None" name="Data filename"/>
|
|
9
|
+
<Param val="True" valType="bool" updates="None" name="Enable Escape"/>
|
|
10
|
+
<Param val="Thank you for your patience." valType="str" updates="None" name="End Message"/>
|
|
11
|
+
<Param val="{'participant':'f"{randint(0, 999999):06.0f}"', 'session':'001'}" valType="code" updates="None" name="Experiment info"/>
|
|
12
|
+
<Param val="True" valType="bool" updates="None" name="Force stereo"/>
|
|
13
|
+
<Param val="True" valType="bool" updates="None" name="Full-screen window"/>
|
|
14
|
+
<Param val="" valType="str" updates="None" name="HTML path"/>
|
|
15
|
+
<Param val="" valType="str" updates="None" name="Incomplete URL"/>
|
|
16
|
+
<Param val="testMonitor" valType="str" updates="None" name="Monitor"/>
|
|
17
|
+
<Param val="[]" valType="list" updates="None" name="Resources"/>
|
|
18
|
+
<Param val="False" valType="bool" updates="None" name="Save csv file"/>
|
|
19
|
+
<Param val="False" valType="bool" updates="None" name="Save excel file"/>
|
|
20
|
+
<Param val="False" valType="bool" updates="None" name="Save hdf5 file"/>
|
|
21
|
+
<Param val="True" valType="bool" updates="None" name="Save log file"/>
|
|
22
|
+
<Param val="True" valType="bool" updates="None" name="Save psydat file"/>
|
|
23
|
+
<Param val="True" valType="bool" updates="None" name="Save wide csv file"/>
|
|
24
|
+
<Param val="1" valType="num" updates="None" name="Screen"/>
|
|
25
|
+
<Param val="True" valType="bool" updates="None" name="Show info dlg"/>
|
|
26
|
+
<Param val="False" valType="bool" updates="None" name="Show mouse"/>
|
|
27
|
+
<Param val="height" valType="str" updates="None" name="Units"/>
|
|
28
|
+
<Param val="" valType="str" updates="None" name="Use version"/>
|
|
29
|
+
<Param val="(1024, 768)" valType="list" updates="None" name="Window size (pixels)"/>
|
|
30
|
+
<Param val="none" valType="str" updates="None" name="backgroundFit"/>
|
|
31
|
+
<Param val="" valType="str" updates="None" name="backgroundImg"/>
|
|
32
|
+
<Param val="avg" valType="str" updates="None" name="blendMode"/>
|
|
33
|
+
<Param val="float" valType="str" updates="None" name="clockFormat"/>
|
|
34
|
+
<Param val="{'thisRow.t': 'priority.CRITICAL', 'expName': 'priority.LOW'}" valType="dict" updates="None" name="colPriority"/>
|
|
35
|
+
<Param val="$[0,0,0]" valType="color" updates="None" name="color"/>
|
|
36
|
+
<Param val="rgb" valType="str" updates="None" name="colorSpace"/>
|
|
37
|
+
<Param val="warning" valType="code" updates="None" name="consoleLoggingLevel"/>
|
|
38
|
+
<Param val="default" valType="str" updates="None" name="ecSampleRate"/>
|
|
39
|
+
<Param val="100.1.1.1" valType="str" updates="None" name="elAddress"/>
|
|
40
|
+
<Param val="FILTER_LEVEL_2" valType="str" updates="None" name="elDataFiltering"/>
|
|
41
|
+
<Param val="FILTER_LEVEL_OFF" valType="str" updates="None" name="elLiveFiltering"/>
|
|
42
|
+
<Param val="EYELINK 1000 DESKTOP" valType="str" updates="None" name="elModel"/>
|
|
43
|
+
<Param val="ELLIPSE_FIT" valType="str" updates="None" name="elPupilAlgorithm"/>
|
|
44
|
+
<Param val="PUPIL_AREA" valType="str" updates="None" name="elPupilMeasure"/>
|
|
45
|
+
<Param val="1000" valType="num" updates="None" name="elSampleRate"/>
|
|
46
|
+
<Param val="False" valType="bool" updates="None" name="elSimMode"/>
|
|
47
|
+
<Param val="RIGHT_EYE" valType="str" updates="None" name="elTrackEyes"/>
|
|
48
|
+
<Param val="PUPIL_CR_TRACKING" valType="str" updates="None" name="elTrackingMode"/>
|
|
49
|
+
<Param val="buttonBoxDemo" valType="str" updates="None" name="expName"/>
|
|
50
|
+
<Param val="on Sync" valType="str" updates="None" name="exportHTML"/>
|
|
51
|
+
<Param val="None" valType="str" updates="None" name="eyetracker"/>
|
|
52
|
+
<Param val="" valType="code" updates="None" name="frameRate"/>
|
|
53
|
+
<Param val="Attempting to measure frame rate of screen, please wait..." valType="str" updates="None" name="frameRateMsg"/>
|
|
54
|
+
<Param val="127.0.0.1" valType="str" updates="None" name="gpAddress"/>
|
|
55
|
+
<Param val="4242" valType="num" updates="None" name="gpPort"/>
|
|
56
|
+
<Param val="ioHub" valType="str" updates="None" name="keyboardBackend"/>
|
|
57
|
+
<Param val="info" valType="code" updates="None" name="logging level"/>
|
|
58
|
+
<Param val="True" valType="bool" updates="None" name="measureFrameRate"/>
|
|
59
|
+
<Param val="MIDDLE_BUTTON" valType="list" updates="None" name="mgBlink"/>
|
|
60
|
+
<Param val="CONTINUOUS" valType="str" updates="None" name="mgMove"/>
|
|
61
|
+
<Param val="0.5" valType="num" updates="None" name="mgSaccade"/>
|
|
62
|
+
<Param val="neon.local" valType="str" updates="None" name="plCompanionAddress"/>
|
|
63
|
+
<Param val="8080" valType="num" updates="None" name="plCompanionPort"/>
|
|
64
|
+
<Param val="True" valType="bool" updates="None" name="plCompanionRecordingEnabled"/>
|
|
65
|
+
<Param val="0.6" valType="num" updates="None" name="plConfidenceThreshold"/>
|
|
66
|
+
<Param val="True" valType="bool" updates="None" name="plPupilCaptureRecordingEnabled"/>
|
|
67
|
+
<Param val="" valType="str" updates="None" name="plPupilCaptureRecordingLocation"/>
|
|
68
|
+
<Param val="127.0.0.1" valType="str" updates="None" name="plPupilRemoteAddress"/>
|
|
69
|
+
<Param val="50020" valType="num" updates="None" name="plPupilRemotePort"/>
|
|
70
|
+
<Param val="1000" valType="num" updates="None" name="plPupilRemoteTimeoutMs"/>
|
|
71
|
+
<Param val="False" valType="bool" updates="None" name="plPupillometryOnly"/>
|
|
72
|
+
<Param val="psychopy_iohub_surface" valType="str" updates="None" name="plSurfaceName"/>
|
|
73
|
+
<Param val="0" valType="code" updates="None" name="runMode"/>
|
|
74
|
+
<Param val="False" valType="bool" updates="None" name="rush"/>
|
|
75
|
+
<Param val="time" valType="str" updates="None" name="sortColumns"/>
|
|
76
|
+
<Param val="" valType="str" updates="None" name="tbLicenseFile"/>
|
|
77
|
+
<Param val="" valType="str" updates="None" name="tbModel"/>
|
|
78
|
+
<Param val="60" valType="num" updates="None" name="tbSampleRate"/>
|
|
79
|
+
<Param val="" valType="str" updates="None" name="tbSerialNo"/>
|
|
80
|
+
<Param val="pyglet" valType="str" updates="None" name="winBackend"/>
|
|
81
|
+
</Settings>
|
|
82
|
+
<Routines>
|
|
83
|
+
<Routine name="trial">
|
|
84
|
+
<RoutineSettingsComponent name="trial" plugin="None">
|
|
85
|
+
<Param val="none" valType="str" updates="None" name="backgroundFit"/>
|
|
86
|
+
<Param val="" valType="str" updates="None" name="backgroundImg"/>
|
|
87
|
+
<Param val="$[0,0,0]" valType="color" updates="None" name="color"/>
|
|
88
|
+
<Param val="rgb" valType="str" updates="None" name="colorSpace"/>
|
|
89
|
+
<Param val="" valType="str" updates="constant" name="desc"/>
|
|
90
|
+
<Param val="False" valType="bool" updates="None" name="disabled"/>
|
|
91
|
+
<Param val="" valType="code" updates="None" name="durationEstim"/>
|
|
92
|
+
<Param val="False" valType="code" updates="None" name="forceNonSlip"/>
|
|
93
|
+
<Param val="trial" valType="code" updates="None" name="name"/>
|
|
94
|
+
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
|
|
95
|
+
<Param val="" valType="code" updates="constant" name="skipIf"/>
|
|
96
|
+
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
|
|
97
|
+
<Param val="" valType="code" updates="constant" name="stopVal"/>
|
|
98
|
+
<Param val="False" valType="bool" updates="None" name="useWindowParams"/>
|
|
99
|
+
</RoutineSettingsComponent>
|
|
100
|
+
<ButtonBoxComponent name="buttonBox" plugin="None">
|
|
101
|
+
<Param val="" valType="list" updates="None" name="allowedButtons"/>
|
|
102
|
+
<Param val="" valType="list" updates="None" name="correctAns"/>
|
|
103
|
+
<Param val="keyboard" valType="str" updates="None" name="deviceBackend"/>
|
|
104
|
+
<Param val="demoButtonBox" valType="str" updates="None" name="deviceLabel"/>
|
|
105
|
+
<Param val="False" valType="bool" updates="None" name="disabled"/>
|
|
106
|
+
<Param val="" valType="code" updates="None" name="durationEstim"/>
|
|
107
|
+
<Param val="False" valType="bool" updates="None" name="forceEndRoutine"/>
|
|
108
|
+
<Param val="'q', 'w', 'e', 'r', 't'" valType="list" updates="None" name="kbButtonAliases"/>
|
|
109
|
+
<Param val="buttonBox" valType="code" updates="None" name="name"/>
|
|
110
|
+
<Param val="True" valType="code" updates="None" name="registerOn"/>
|
|
111
|
+
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
|
|
112
|
+
<Param val="" valType="code" updates="None" name="startEstim"/>
|
|
113
|
+
<Param val="time (s)" valType="str" updates="None" name="startType"/>
|
|
114
|
+
<Param val="0.0" valType="code" updates="None" name="startVal"/>
|
|
115
|
+
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
|
|
116
|
+
<Param val="" valType="code" updates="constant" name="stopVal"/>
|
|
117
|
+
<Param val="first" valType="str" updates="constant" name="store"/>
|
|
118
|
+
<Param val="False" valType="bool" updates="constant" name="storeCorrect"/>
|
|
119
|
+
<Param val="False" valType="bool" updates="None" name="syncScreenRefresh"/>
|
|
120
|
+
</ButtonBoxComponent>
|
|
121
|
+
<PolygonComponent name="button0" plugin="None">
|
|
122
|
+
<Param val="center" valType="str" updates="constant" name="anchor"/>
|
|
123
|
+
<Param val="rgb" valType="str" updates="constant" name="colorSpace"/>
|
|
124
|
+
<Param val="1" valType="num" updates="constant" name="contrast"/>
|
|
125
|
+
<Param val="False" valType="bool" updates="None" name="disabled"/>
|
|
126
|
+
<Param val="False" valType="code" updates="constant" name="draggable"/>
|
|
127
|
+
<Param val="" valType="code" updates="None" name="durationEstim"/>
|
|
128
|
+
<Param val="$buttonBox.getState(0)" valType="color" updates="set every frame" name="fillColor"/>
|
|
129
|
+
<Param val="linear" valType="str" updates="constant" name="interpolate"/>
|
|
130
|
+
<Param val="white" valType="color" updates="constant" name="lineColor"/>
|
|
131
|
+
<Param val="4" valType="num" updates="constant" name="lineWidth"/>
|
|
132
|
+
<Param val="4" valType="int" updates="constant" name="nVertices"/>
|
|
133
|
+
<Param val="button0" valType="code" updates="None" name="name"/>
|
|
134
|
+
<Param val="" valType="num" updates="constant" name="opacity"/>
|
|
135
|
+
<Param val="0" valType="num" updates="constant" name="ori"/>
|
|
136
|
+
<Param val="(-0.4, 0)" valType="list" updates="constant" name="pos"/>
|
|
137
|
+
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
|
|
138
|
+
<Param val="circle" valType="str" updates="None" name="shape"/>
|
|
139
|
+
<Param val="(0.1, 0.1)" valType="list" updates="constant" name="size"/>
|
|
140
|
+
<Param val="" valType="code" updates="None" name="startEstim"/>
|
|
141
|
+
<Param val="time (s)" valType="str" updates="None" name="startType"/>
|
|
142
|
+
<Param val="0.0" valType="code" updates="None" name="startVal"/>
|
|
143
|
+
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
|
|
144
|
+
<Param val="" valType="code" updates="constant" name="stopVal"/>
|
|
145
|
+
<Param val="True" valType="bool" updates="None" name="syncScreenRefresh"/>
|
|
146
|
+
<Param val="height" valType="str" updates="None" name="units"/>
|
|
147
|
+
<Param val="" valType="code" updates="None" name="validator"/>
|
|
148
|
+
<Param val="" valType="list" updates="constant" name="vertices"/>
|
|
149
|
+
</PolygonComponent>
|
|
150
|
+
<PolygonComponent name="button1" plugin="None">
|
|
151
|
+
<Param val="center" valType="str" updates="constant" name="anchor"/>
|
|
152
|
+
<Param val="rgb" valType="str" updates="constant" name="colorSpace"/>
|
|
153
|
+
<Param val="1" valType="num" updates="constant" name="contrast"/>
|
|
154
|
+
<Param val="False" valType="bool" updates="None" name="disabled"/>
|
|
155
|
+
<Param val="False" valType="code" updates="constant" name="draggable"/>
|
|
156
|
+
<Param val="" valType="code" updates="None" name="durationEstim"/>
|
|
157
|
+
<Param val="$buttonBox.getState(1)" valType="color" updates="set every frame" name="fillColor"/>
|
|
158
|
+
<Param val="linear" valType="str" updates="constant" name="interpolate"/>
|
|
159
|
+
<Param val="white" valType="color" updates="constant" name="lineColor"/>
|
|
160
|
+
<Param val="4" valType="num" updates="constant" name="lineWidth"/>
|
|
161
|
+
<Param val="4" valType="int" updates="constant" name="nVertices"/>
|
|
162
|
+
<Param val="button1" valType="code" updates="None" name="name"/>
|
|
163
|
+
<Param val="" valType="num" updates="constant" name="opacity"/>
|
|
164
|
+
<Param val="0" valType="num" updates="constant" name="ori"/>
|
|
165
|
+
<Param val="(-0.2, 0)" valType="list" updates="constant" name="pos"/>
|
|
166
|
+
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
|
|
167
|
+
<Param val="circle" valType="str" updates="None" name="shape"/>
|
|
168
|
+
<Param val="(0.1, 0.1)" valType="list" updates="constant" name="size"/>
|
|
169
|
+
<Param val="" valType="code" updates="None" name="startEstim"/>
|
|
170
|
+
<Param val="time (s)" valType="str" updates="None" name="startType"/>
|
|
171
|
+
<Param val="0.0" valType="code" updates="None" name="startVal"/>
|
|
172
|
+
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
|
|
173
|
+
<Param val="" valType="code" updates="constant" name="stopVal"/>
|
|
174
|
+
<Param val="True" valType="bool" updates="None" name="syncScreenRefresh"/>
|
|
175
|
+
<Param val="height" valType="str" updates="None" name="units"/>
|
|
176
|
+
<Param val="" valType="code" updates="None" name="validator"/>
|
|
177
|
+
<Param val="" valType="list" updates="constant" name="vertices"/>
|
|
178
|
+
</PolygonComponent>
|
|
179
|
+
<PolygonComponent name="button2" plugin="None">
|
|
180
|
+
<Param val="center" valType="str" updates="constant" name="anchor"/>
|
|
181
|
+
<Param val="rgb" valType="str" updates="constant" name="colorSpace"/>
|
|
182
|
+
<Param val="1" valType="num" updates="constant" name="contrast"/>
|
|
183
|
+
<Param val="False" valType="bool" updates="None" name="disabled"/>
|
|
184
|
+
<Param val="False" valType="code" updates="constant" name="draggable"/>
|
|
185
|
+
<Param val="" valType="code" updates="None" name="durationEstim"/>
|
|
186
|
+
<Param val="$buttonBox.getState(2)" valType="color" updates="set every frame" name="fillColor"/>
|
|
187
|
+
<Param val="linear" valType="str" updates="constant" name="interpolate"/>
|
|
188
|
+
<Param val="white" valType="color" updates="constant" name="lineColor"/>
|
|
189
|
+
<Param val="4" valType="num" updates="constant" name="lineWidth"/>
|
|
190
|
+
<Param val="4" valType="int" updates="constant" name="nVertices"/>
|
|
191
|
+
<Param val="button2" valType="code" updates="None" name="name"/>
|
|
192
|
+
<Param val="" valType="num" updates="constant" name="opacity"/>
|
|
193
|
+
<Param val="0" valType="num" updates="constant" name="ori"/>
|
|
194
|
+
<Param val="(0.0, 0)" valType="list" updates="constant" name="pos"/>
|
|
195
|
+
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
|
|
196
|
+
<Param val="circle" valType="str" updates="None" name="shape"/>
|
|
197
|
+
<Param val="(0.1, 0.1)" valType="list" updates="constant" name="size"/>
|
|
198
|
+
<Param val="" valType="code" updates="None" name="startEstim"/>
|
|
199
|
+
<Param val="time (s)" valType="str" updates="None" name="startType"/>
|
|
200
|
+
<Param val="0.0" valType="code" updates="None" name="startVal"/>
|
|
201
|
+
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
|
|
202
|
+
<Param val="" valType="code" updates="constant" name="stopVal"/>
|
|
203
|
+
<Param val="True" valType="bool" updates="None" name="syncScreenRefresh"/>
|
|
204
|
+
<Param val="height" valType="str" updates="None" name="units"/>
|
|
205
|
+
<Param val="" valType="code" updates="None" name="validator"/>
|
|
206
|
+
<Param val="" valType="list" updates="constant" name="vertices"/>
|
|
207
|
+
</PolygonComponent>
|
|
208
|
+
<PolygonComponent name="button3" plugin="None">
|
|
209
|
+
<Param val="center" valType="str" updates="constant" name="anchor"/>
|
|
210
|
+
<Param val="rgb" valType="str" updates="constant" name="colorSpace"/>
|
|
211
|
+
<Param val="1" valType="num" updates="constant" name="contrast"/>
|
|
212
|
+
<Param val="False" valType="bool" updates="None" name="disabled"/>
|
|
213
|
+
<Param val="False" valType="code" updates="constant" name="draggable"/>
|
|
214
|
+
<Param val="" valType="code" updates="None" name="durationEstim"/>
|
|
215
|
+
<Param val="$buttonBox.getState(3)" valType="color" updates="set every frame" name="fillColor"/>
|
|
216
|
+
<Param val="linear" valType="str" updates="constant" name="interpolate"/>
|
|
217
|
+
<Param val="white" valType="color" updates="constant" name="lineColor"/>
|
|
218
|
+
<Param val="4" valType="num" updates="constant" name="lineWidth"/>
|
|
219
|
+
<Param val="4" valType="int" updates="constant" name="nVertices"/>
|
|
220
|
+
<Param val="button3" valType="code" updates="None" name="name"/>
|
|
221
|
+
<Param val="" valType="num" updates="constant" name="opacity"/>
|
|
222
|
+
<Param val="0" valType="num" updates="constant" name="ori"/>
|
|
223
|
+
<Param val="(0.2, 0)" valType="list" updates="constant" name="pos"/>
|
|
224
|
+
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
|
|
225
|
+
<Param val="circle" valType="str" updates="None" name="shape"/>
|
|
226
|
+
<Param val="(0.1, 0.1)" valType="list" updates="constant" name="size"/>
|
|
227
|
+
<Param val="" valType="code" updates="None" name="startEstim"/>
|
|
228
|
+
<Param val="time (s)" valType="str" updates="None" name="startType"/>
|
|
229
|
+
<Param val="0.0" valType="code" updates="None" name="startVal"/>
|
|
230
|
+
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
|
|
231
|
+
<Param val="" valType="code" updates="constant" name="stopVal"/>
|
|
232
|
+
<Param val="True" valType="bool" updates="None" name="syncScreenRefresh"/>
|
|
233
|
+
<Param val="height" valType="str" updates="None" name="units"/>
|
|
234
|
+
<Param val="" valType="code" updates="None" name="validator"/>
|
|
235
|
+
<Param val="" valType="list" updates="constant" name="vertices"/>
|
|
236
|
+
</PolygonComponent>
|
|
237
|
+
<PolygonComponent name="button4" plugin="None">
|
|
238
|
+
<Param val="center" valType="str" updates="constant" name="anchor"/>
|
|
239
|
+
<Param val="rgb" valType="str" updates="constant" name="colorSpace"/>
|
|
240
|
+
<Param val="1" valType="num" updates="constant" name="contrast"/>
|
|
241
|
+
<Param val="False" valType="bool" updates="None" name="disabled"/>
|
|
242
|
+
<Param val="False" valType="code" updates="constant" name="draggable"/>
|
|
243
|
+
<Param val="" valType="code" updates="None" name="durationEstim"/>
|
|
244
|
+
<Param val="$buttonBox.getState(4)" valType="color" updates="set every frame" name="fillColor"/>
|
|
245
|
+
<Param val="linear" valType="str" updates="constant" name="interpolate"/>
|
|
246
|
+
<Param val="white" valType="color" updates="constant" name="lineColor"/>
|
|
247
|
+
<Param val="4" valType="num" updates="constant" name="lineWidth"/>
|
|
248
|
+
<Param val="4" valType="int" updates="constant" name="nVertices"/>
|
|
249
|
+
<Param val="button4" valType="code" updates="None" name="name"/>
|
|
250
|
+
<Param val="" valType="num" updates="constant" name="opacity"/>
|
|
251
|
+
<Param val="0" valType="num" updates="constant" name="ori"/>
|
|
252
|
+
<Param val="(0.4, 0)" valType="list" updates="constant" name="pos"/>
|
|
253
|
+
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
|
|
254
|
+
<Param val="circle" valType="str" updates="None" name="shape"/>
|
|
255
|
+
<Param val="(0.1, 0.1)" valType="list" updates="constant" name="size"/>
|
|
256
|
+
<Param val="" valType="code" updates="None" name="startEstim"/>
|
|
257
|
+
<Param val="time (s)" valType="str" updates="None" name="startType"/>
|
|
258
|
+
<Param val="0.0" valType="code" updates="None" name="startVal"/>
|
|
259
|
+
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
|
|
260
|
+
<Param val="" valType="code" updates="constant" name="stopVal"/>
|
|
261
|
+
<Param val="True" valType="bool" updates="None" name="syncScreenRefresh"/>
|
|
262
|
+
<Param val="height" valType="str" updates="None" name="units"/>
|
|
263
|
+
<Param val="" valType="code" updates="None" name="validator"/>
|
|
264
|
+
<Param val="" valType="list" updates="constant" name="vertices"/>
|
|
265
|
+
</PolygonComponent>
|
|
266
|
+
<TextboxComponent name="instr" plugin="None">
|
|
267
|
+
<Param val="center" valType="str" updates="constant" name="alignment"/>
|
|
268
|
+
<Param val="top-center" valType="str" updates="constant" name="anchor"/>
|
|
269
|
+
<Param val="True" valType="bool" updates="constant" name="autoLog"/>
|
|
270
|
+
<Param val="False" valType="bool" updates="constant" name="bold"/>
|
|
271
|
+
<Param val="None" valType="color" updates="constant" name="borderColor"/>
|
|
272
|
+
<Param val="2" valType="num" updates="constant" name="borderWidth"/>
|
|
273
|
+
<Param val="white" valType="color" updates="constant" name="color"/>
|
|
274
|
+
<Param val="rgb" valType="str" updates="constant" name="colorSpace"/>
|
|
275
|
+
<Param val="1" valType="num" updates="constant" name="contrast"/>
|
|
276
|
+
<Param val="False" valType="bool" updates="None" name="disabled"/>
|
|
277
|
+
<Param val="False" valType="code" updates="constant" name="draggable"/>
|
|
278
|
+
<Param val="" valType="code" updates="None" name="durationEstim"/>
|
|
279
|
+
<Param val="False" valType="bool" updates="constant" name="editable"/>
|
|
280
|
+
<Param val="None" valType="color" updates="constant" name="fillColor"/>
|
|
281
|
+
<Param val="False" valType="bool" updates="constant" name="flipHoriz"/>
|
|
282
|
+
<Param val="False" valType="bool" updates="constant" name="flipVert"/>
|
|
283
|
+
<Param val="Arial" valType="str" updates="constant" name="font"/>
|
|
284
|
+
<Param val="False" valType="bool" updates="constant" name="italic"/>
|
|
285
|
+
<Param val="LTR" valType="str" updates="None" name="languageStyle"/>
|
|
286
|
+
<Param val="0.05" valType="num" updates="constant" name="letterHeight"/>
|
|
287
|
+
<Param val="1.0" valType="num" updates="constant" name="lineSpacing"/>
|
|
288
|
+
<Param val="instr" valType="code" updates="None" name="name"/>
|
|
289
|
+
<Param val="" valType="num" updates="constant" name="opacity"/>
|
|
290
|
+
<Param val="0" valType="num" updates="constant" name="ori"/>
|
|
291
|
+
<Param val="visible" valType="str" updates="constant" name="overflow"/>
|
|
292
|
+
<Param val="0" valType="num" updates="constant" name="padding"/>
|
|
293
|
+
<Param val="Type here..." valType="str" updates="constant" name="placeholder"/>
|
|
294
|
+
<Param val="(0, 0.4)" valType="list" updates="constant" name="pos"/>
|
|
295
|
+
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
|
|
296
|
+
<Param val="(1, 0.3)" valType="list" updates="constant" name="size"/>
|
|
297
|
+
<Param val="" valType="list" updates="constant" name="speechPoint"/>
|
|
298
|
+
<Param val="" valType="code" updates="None" name="startEstim"/>
|
|
299
|
+
<Param val="time (s)" valType="str" updates="None" name="startType"/>
|
|
300
|
+
<Param val="0.0" valType="code" updates="None" name="startVal"/>
|
|
301
|
+
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
|
|
302
|
+
<Param val="" valType="code" updates="constant" name="stopVal"/>
|
|
303
|
+
<Param val="True" valType="bool" updates="None" name="syncScreenRefresh"/>
|
|
304
|
+
<Param val="Press some buttons! You should see the corresponding circle turn white when you press it." valType="str" updates="constant" name="text"/>
|
|
305
|
+
<Param val="from exp settings" valType="str" updates="None" name="units"/>
|
|
306
|
+
<Param val="" valType="code" updates="None" name="validator"/>
|
|
307
|
+
</TextboxComponent>
|
|
308
|
+
<TextboxComponent name="instrEnd" plugin="None">
|
|
309
|
+
<Param val="center" valType="str" updates="constant" name="alignment"/>
|
|
310
|
+
<Param val="bottom-center" valType="str" updates="constant" name="anchor"/>
|
|
311
|
+
<Param val="True" valType="bool" updates="constant" name="autoLog"/>
|
|
312
|
+
<Param val="False" valType="bool" updates="constant" name="bold"/>
|
|
313
|
+
<Param val="None" valType="color" updates="constant" name="borderColor"/>
|
|
314
|
+
<Param val="2" valType="num" updates="constant" name="borderWidth"/>
|
|
315
|
+
<Param val="white" valType="color" updates="constant" name="color"/>
|
|
316
|
+
<Param val="rgb" valType="str" updates="constant" name="colorSpace"/>
|
|
317
|
+
<Param val="1" valType="num" updates="constant" name="contrast"/>
|
|
318
|
+
<Param val="False" valType="bool" updates="None" name="disabled"/>
|
|
319
|
+
<Param val="False" valType="code" updates="constant" name="draggable"/>
|
|
320
|
+
<Param val="" valType="code" updates="None" name="durationEstim"/>
|
|
321
|
+
<Param val="False" valType="bool" updates="constant" name="editable"/>
|
|
322
|
+
<Param val="None" valType="color" updates="constant" name="fillColor"/>
|
|
323
|
+
<Param val="False" valType="bool" updates="constant" name="flipHoriz"/>
|
|
324
|
+
<Param val="False" valType="bool" updates="constant" name="flipVert"/>
|
|
325
|
+
<Param val="Arial" valType="str" updates="constant" name="font"/>
|
|
326
|
+
<Param val="False" valType="bool" updates="constant" name="italic"/>
|
|
327
|
+
<Param val="LTR" valType="str" updates="None" name="languageStyle"/>
|
|
328
|
+
<Param val="0.05" valType="num" updates="constant" name="letterHeight"/>
|
|
329
|
+
<Param val="1.0" valType="num" updates="constant" name="lineSpacing"/>
|
|
330
|
+
<Param val="instrEnd" valType="code" updates="None" name="name"/>
|
|
331
|
+
<Param val="" valType="num" updates="constant" name="opacity"/>
|
|
332
|
+
<Param val="0" valType="num" updates="constant" name="ori"/>
|
|
333
|
+
<Param val="visible" valType="str" updates="constant" name="overflow"/>
|
|
334
|
+
<Param val="0" valType="num" updates="constant" name="padding"/>
|
|
335
|
+
<Param val="Type here..." valType="str" updates="constant" name="placeholder"/>
|
|
336
|
+
<Param val="(0, -0.4)" valType="list" updates="constant" name="pos"/>
|
|
337
|
+
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
|
|
338
|
+
<Param val="(1, 0.3)" valType="list" updates="constant" name="size"/>
|
|
339
|
+
<Param val="" valType="list" updates="constant" name="speechPoint"/>
|
|
340
|
+
<Param val="" valType="code" updates="None" name="startEstim"/>
|
|
341
|
+
<Param val="time (s)" valType="str" updates="None" name="startType"/>
|
|
342
|
+
<Param val="0.0" valType="code" updates="None" name="startVal"/>
|
|
343
|
+
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
|
|
344
|
+
<Param val="" valType="code" updates="constant" name="stopVal"/>
|
|
345
|
+
<Param val="True" valType="bool" updates="None" name="syncScreenRefresh"/>
|
|
346
|
+
<Param val="Press ENTER to finish." valType="str" updates="constant" name="text"/>
|
|
347
|
+
<Param val="from exp settings" valType="str" updates="None" name="units"/>
|
|
348
|
+
<Param val="" valType="code" updates="None" name="validator"/>
|
|
349
|
+
</TextboxComponent>
|
|
350
|
+
<KeyboardComponent name="ender" plugin="None">
|
|
351
|
+
<Param val="'return'" valType="list" updates="constant" name="allowedKeys"/>
|
|
352
|
+
<Param val="" valType="str" updates="constant" name="correctAns"/>
|
|
353
|
+
<Param val="" valType="str" updates="None" name="deviceLabel"/>
|
|
354
|
+
<Param val="False" valType="bool" updates="None" name="disabled"/>
|
|
355
|
+
<Param val="True" valType="bool" updates="constant" name="discard previous"/>
|
|
356
|
+
<Param val="" valType="code" updates="None" name="durationEstim"/>
|
|
357
|
+
<Param val="True" valType="bool" updates="constant" name="forceEndRoutine"/>
|
|
358
|
+
<Param val="ender" valType="code" updates="None" name="name"/>
|
|
359
|
+
<Param val="press" valType="str" updates="constant" name="registerOn"/>
|
|
360
|
+
<Param val="True" valType="bool" updates="None" name="saveStartStop"/>
|
|
361
|
+
<Param val="" valType="code" updates="None" name="startEstim"/>
|
|
362
|
+
<Param val="time (s)" valType="str" updates="None" name="startType"/>
|
|
363
|
+
<Param val="0.0" valType="code" updates="None" name="startVal"/>
|
|
364
|
+
<Param val="duration (s)" valType="str" updates="None" name="stopType"/>
|
|
365
|
+
<Param val="" valType="code" updates="constant" name="stopVal"/>
|
|
366
|
+
<Param val="last key" valType="str" updates="constant" name="store"/>
|
|
367
|
+
<Param val="False" valType="bool" updates="constant" name="storeCorrect"/>
|
|
368
|
+
<Param val="True" valType="bool" updates="constant" name="syncScreenRefresh"/>
|
|
369
|
+
</KeyboardComponent>
|
|
370
|
+
</Routine>
|
|
371
|
+
</Routines>
|
|
372
|
+
<Flow>
|
|
373
|
+
<Routine name="trial"/>
|
|
374
|
+
</Flow>
|
|
375
|
+
</PsychoPy2experiment>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Button Box Component Demo
|
|
2
|
+
|
|
3
|
+
This demo shows a minimal example of the Button Box Component. Currently, it is in keyboard emulation mode - meaning you can press keys on your keyboard to emulate button presses. To configure it to use a particular kind of button box, you should install the relevant plugin (e.g. `psychopy-cedrus` for Cedrus devices), which will add options to the Component's "Device backend" parameter.
|
|
4
|
+
|
|
5
|
+
Once set up, you should be able to push buttons on your device and see corresponding circles on screen turn white! To use more than the first 5 buttons, just copy the existing circles and change their fill color & position.
|