psychopy 2024.1.3__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/localizedStrings.py +11 -9
- 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 +1258 -1176
- 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 +152 -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/Feature Demos/progress/progressBar.psyexp +4 -4
- 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/buttonBox/__init__.py +21 -12
- 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/progress/__init__.py +1 -1
- 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 +7 -6
- 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 -11
- 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 +184 -16
- 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/progress.py +1 -1
- 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/web.py +5 -2
- {psychopy-2024.1.3.dist-info → psychopy-2024.2.0.dist-info}/METADATA +8 -13
- {psychopy-2024.1.3.dist-info → psychopy-2024.2.0.dist-info}/RECORD +313 -219
- {psychopy-2024.1.3.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.3.dist-info → psychopy-2024.2.0.dist-info}/entry_points.txt +0 -0
- {psychopy-2024.1.3.dist-info → psychopy-2024.2.0.dist-info}/licenses/AUTHORS.md +0 -0
- {psychopy-2024.1.3.dist-info → psychopy-2024.2.0.dist-info}/licenses/LICENSE +0 -0
psychopy/app/Resources/click.png
DELETED
|
Binary file
|
psychopy/app/Resources/next.png
DELETED
|
Binary file
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
# Part of the PsychoPy library
|
|
5
|
-
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
|
|
6
|
-
# Distributed under the terms of the GNU General Public License (GPL).
|
|
7
|
-
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
from psychopy.experiment.components import BaseVisualComponent, Param, getInitVals, _translate
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class PatchComponent(BaseVisualComponent):
|
|
13
|
-
"""An event class for presenting image-based stimuli"""
|
|
14
|
-
|
|
15
|
-
categories = ['Stimuli']
|
|
16
|
-
targets = ['PsychoPy']
|
|
17
|
-
iconFile = Path(__file__).parent / 'patch.png'
|
|
18
|
-
tooltip = _translate('Patch: present images (bmp, jpg, tif...) or textures '
|
|
19
|
-
'like gratings')
|
|
20
|
-
|
|
21
|
-
def __init__(self, exp, parentName, name='patch', image='sin', mask='None',
|
|
22
|
-
sf='None', interpolate='linear',
|
|
23
|
-
units='from exp settings', color='$[1,1,1]', colorSpace='rgb',
|
|
24
|
-
pos=(0, 0), size=(0.5, 0.5), ori=0, phase=0.0, texRes='128',
|
|
25
|
-
startType='time (s)', startVal=0.0,
|
|
26
|
-
stopType='duration (s)', stopVal=1.0,
|
|
27
|
-
startEstim='', durationEstim=''):
|
|
28
|
-
super(PatchComponent, self).__init__(
|
|
29
|
-
exp, parentName, name=name, units=units,
|
|
30
|
-
color=color, colorSpace=colorSpace,
|
|
31
|
-
pos=pos, size=size, ori=ori,
|
|
32
|
-
startType=startType, startVal=startVal,
|
|
33
|
-
stopType=stopType, stopVal=stopVal,
|
|
34
|
-
startEstim=startEstim, durationEstim=durationEstim)
|
|
35
|
-
|
|
36
|
-
self.type = 'Patch'
|
|
37
|
-
self.url = "https://www.psychopy.org/builder/components/patch.html"
|
|
38
|
-
# params
|
|
39
|
-
|
|
40
|
-
msg = _translate("The image to be displayed - 'sin','sqr'... or a "
|
|
41
|
-
"filename (including path)")
|
|
42
|
-
self.params['image'] = Param(
|
|
43
|
-
image, valType='file', inputType="file", allowedTypes=[], categ='Basic',
|
|
44
|
-
updates='constant',
|
|
45
|
-
allowedUpdates=['constant', 'set every repeat', 'set every frame'],
|
|
46
|
-
hint=msg,
|
|
47
|
-
label=_translate("Image/tex"))
|
|
48
|
-
|
|
49
|
-
msg = _translate("An image to define the alpha mask (ie shape)- "
|
|
50
|
-
"gauss, circle... or a filename (including path)")
|
|
51
|
-
self.params['mask'] = Param(
|
|
52
|
-
mask, valType='str', inputType="single", allowedTypes=[], categ='Texture',
|
|
53
|
-
updates='constant',
|
|
54
|
-
allowedUpdates=['constant', 'set every repeat', 'set every frame'],
|
|
55
|
-
hint=msg,
|
|
56
|
-
label=_translate("Mask"))
|
|
57
|
-
|
|
58
|
-
msg = _translate("Spatial frequency of image repeats across the "
|
|
59
|
-
"patch, e.g. 4 or [2,3]")
|
|
60
|
-
self.params['sf'] = Param(
|
|
61
|
-
sf, valType='list', inputType="single", allowedTypes=[], categ='Texture',
|
|
62
|
-
updates='constant',
|
|
63
|
-
allowedUpdates=['constant', 'set every repeat', 'set every frame'],
|
|
64
|
-
hint=msg,
|
|
65
|
-
label=_translate("Spatial frequency"))
|
|
66
|
-
|
|
67
|
-
msg = _translate(
|
|
68
|
-
"Spatial positioning of the image on the patch (in range 0-1.0)")
|
|
69
|
-
self.params['phase'] = Param(
|
|
70
|
-
phase, valType='num', inputType="single", allowedTypes=[], categ='Texture',
|
|
71
|
-
updates='constant',
|
|
72
|
-
allowedUpdates=['constant', 'set every repeat', 'set every frame'],
|
|
73
|
-
hint=msg,
|
|
74
|
-
label=_translate("Phase (in cycles)"))
|
|
75
|
-
|
|
76
|
-
msg = _translate(
|
|
77
|
-
"Resolution of the texture for standard ones such as sin, sqr "
|
|
78
|
-
"etc. For most cases a value of 256 pixels will suffice")
|
|
79
|
-
self.params['texture resolution'] = Param(
|
|
80
|
-
texRes, valType='num', inputType="choice", categ='Texture',
|
|
81
|
-
allowedVals=['32', '64', '128', '256', '512'],
|
|
82
|
-
updates='constant', allowedUpdates=[],
|
|
83
|
-
hint=msg,
|
|
84
|
-
label=_translate("Texture resolution"))
|
|
85
|
-
|
|
86
|
-
msg = _translate(
|
|
87
|
-
"How should the image be interpolated if/when rescaled")
|
|
88
|
-
self.params['interpolate'] = Param(
|
|
89
|
-
interpolate, valType='str', inputType="choice", allowedVals=['linear', 'nearest'], categ='Texture',
|
|
90
|
-
updates='constant', allowedUpdates=[],
|
|
91
|
-
hint=msg,
|
|
92
|
-
label=_translate("Interpolate"))
|
|
93
|
-
|
|
94
|
-
def writeInitCode(self, buff):
|
|
95
|
-
# do we need units code?
|
|
96
|
-
if self.params['units'].val == 'from exp settings':
|
|
97
|
-
unitsStr = ""
|
|
98
|
-
else:
|
|
99
|
-
unitsStr = "units=%(units)s, " % self.params
|
|
100
|
-
# replaces variable params with defaults
|
|
101
|
-
inits = getInitVals(self.params)
|
|
102
|
-
|
|
103
|
-
code = ("%s = visual.PatchStim(\n" % inits['name'] +
|
|
104
|
-
" win=win, name='%s',%s\n" % (inits['name'], unitsStr))
|
|
105
|
-
|
|
106
|
-
code += (" tex=%(image)s, mask=%(mask)s,\n"
|
|
107
|
-
" ori=%(ori)s, pos=%(pos)s, size=%(size)s, sf=%(sf)s, phase=%(phase)s,\n"
|
|
108
|
-
" color=%(color)s, colorSpace=%(colorSpace)s, opacity=%(opacity)s,\n"
|
|
109
|
-
# no newline - start optional parameters
|
|
110
|
-
" texRes=%(texture resolution)s" %
|
|
111
|
-
inits)
|
|
112
|
-
|
|
113
|
-
buff.writeIndentedLines(code)
|
|
114
|
-
|
|
115
|
-
if self.params['interpolate'].val == 'linear':
|
|
116
|
-
buff.write(", interpolate=True")
|
|
117
|
-
else:
|
|
118
|
-
buff.write(", interpolate=False")
|
|
119
|
-
|
|
120
|
-
depth = -self.getPosInRoutine()
|
|
121
|
-
buff.write(", depth=%.1f)\n" % depth) # finish with newline
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
# Part of the PsychoPy library
|
|
5
|
-
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
|
|
6
|
-
# Distributed under the terms of the GNU General Public License (GPL).
|
|
7
|
-
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
from psychopy.tools.stringtools import getArgs
|
|
10
|
-
from psychopy.experiment.components import BaseComponent, Param, _translate
|
|
11
|
-
|
|
12
|
-
__author__ = 'Jeremy Gray'
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class RatingScaleComponent(BaseComponent):
|
|
16
|
-
"""A class for presenting a rating scale as a builder Component
|
|
17
|
-
"""
|
|
18
|
-
categories = ['Responses']
|
|
19
|
-
targets = ['PsychoPy']
|
|
20
|
-
iconFile = Path(__file__).parent / 'ratingscale.png'
|
|
21
|
-
tooltip = _translate('Rating scale: obtain numerical or categorical '
|
|
22
|
-
'responses')
|
|
23
|
-
|
|
24
|
-
def __init__(self, exp, parentName,
|
|
25
|
-
name='rating',
|
|
26
|
-
scaleDescription='',
|
|
27
|
-
categoryChoices='',
|
|
28
|
-
visualAnalogScale=False,
|
|
29
|
-
low='1', high='7',
|
|
30
|
-
singleClick=False,
|
|
31
|
-
showAccept=True,
|
|
32
|
-
labels='',
|
|
33
|
-
size='1.0',
|
|
34
|
-
tickHeight='',
|
|
35
|
-
pos='0, -0.4',
|
|
36
|
-
startType='time (s)', startVal='0.0',
|
|
37
|
-
stopType='condition', stopVal='',
|
|
38
|
-
startEstim='', durationEstim='',
|
|
39
|
-
forceEndRoutine=True,
|
|
40
|
-
disappear=False,
|
|
41
|
-
marker='triangle',
|
|
42
|
-
markerStart='',
|
|
43
|
-
storeRating=True, storeRatingTime=True, storeHistory=False,
|
|
44
|
-
customize_everything=''):
|
|
45
|
-
super(RatingScaleComponent, self).__init__(
|
|
46
|
-
exp, parentName, name,
|
|
47
|
-
startType=startType, startVal=startVal,
|
|
48
|
-
stopType=stopType, stopVal=stopVal,
|
|
49
|
-
startEstim=startEstim, durationEstim=durationEstim)
|
|
50
|
-
self.type = 'RatingScale'
|
|
51
|
-
self.url = "https://www.psychopy.org/builder/components/ratingscale.html"
|
|
52
|
-
self.exp.requirePsychopyLibs(['visual', 'event'])
|
|
53
|
-
|
|
54
|
-
# params
|
|
55
|
-
self.order = ['name', 'visualAnalogScale', 'categoryChoices',
|
|
56
|
-
'scaleDescription', 'low', 'high', 'labels',
|
|
57
|
-
'markerStart', 'size', 'pos', 'tickHeight']
|
|
58
|
-
|
|
59
|
-
# normal params:
|
|
60
|
-
# = the usual as inherited from BaseVisual plus:
|
|
61
|
-
self.params['visualAnalogScale'] = Param(
|
|
62
|
-
visualAnalogScale, valType='bool', inputType="bool", allowedTypes=[], categ='Data',
|
|
63
|
-
updates='constant', allowedUpdates=[],
|
|
64
|
-
hint=_translate("Show a continuous visual analog scale; returns"
|
|
65
|
-
" 0.00 to 1.00; takes precedence over numeric "
|
|
66
|
-
"scale or categorical choices"),
|
|
67
|
-
label=_translate("Visual analog scale"))
|
|
68
|
-
self.params['categoryChoices'] = Param(
|
|
69
|
-
categoryChoices, valType='list', inputType="single", allowedTypes=[], categ='Basic',
|
|
70
|
-
updates='constant', allowedUpdates=[],
|
|
71
|
-
hint=_translate("A list of categories (non-numeric alternatives)"
|
|
72
|
-
" to present, space or comma-separated; these "
|
|
73
|
-
"take precedence over a numeric scale"),
|
|
74
|
-
label=_translate("Category choices"))
|
|
75
|
-
self.params['scaleDescription'] = Param(
|
|
76
|
-
scaleDescription, valType='str', inputType="single", allowedTypes=[], categ='Basic',
|
|
77
|
-
updates='constant', allowedUpdates=[],
|
|
78
|
-
hint=_translate("Brief instructions, such as a description of "
|
|
79
|
-
"the scale numbers as seen by the subject."),
|
|
80
|
-
label=_translate("Scale description"))
|
|
81
|
-
self.params['low'] = Param(
|
|
82
|
-
low, valType='num', inputType="single", allowedTypes=[], categ='Data',
|
|
83
|
-
updates='constant', allowedUpdates=[],
|
|
84
|
-
hint=_translate("Lowest rating (low end of the scale); not"
|
|
85
|
-
" used for categories."),
|
|
86
|
-
label=_translate("Lowest value"))
|
|
87
|
-
self.params['high'] = Param(
|
|
88
|
-
high, valType='num', inputType="single", allowedTypes=[], categ='Data',
|
|
89
|
-
updates='constant', allowedUpdates=[],
|
|
90
|
-
hint=_translate("Highest rating (top end of the scale); "
|
|
91
|
-
"not used for categories."),
|
|
92
|
-
label=_translate("Highest value"))
|
|
93
|
-
self.params['labels'] = Param(
|
|
94
|
-
labels, valType='list', inputType="single", allowedTypes=[], categ='Data',
|
|
95
|
-
updates='constant', allowedUpdates=[], # categ="Advanced",
|
|
96
|
-
hint=_translate("Labels for the ends of the scale, "
|
|
97
|
-
"separated by commas"),
|
|
98
|
-
label=_translate("Labels"))
|
|
99
|
-
self.params['marker'] = Param(
|
|
100
|
-
marker, valType='str', inputType="choice", allowedTypes=[], categ='Interface',
|
|
101
|
-
allowedVals=['triangle', 'circle', 'glow', 'slider', 'hover'],
|
|
102
|
-
updates='constant', allowedUpdates=[], # categ="Advanced",
|
|
103
|
-
hint=_translate("Style for the marker: triangle, circle, glow, "
|
|
104
|
-
"slider, hover"),
|
|
105
|
-
label=_translate("Marker type"))
|
|
106
|
-
self.params['markerStart'] = Param(
|
|
107
|
-
markerStart, valType='num', inputType="single", allowedTypes=[], categ='Data',
|
|
108
|
-
updates='constant', allowedUpdates=[], # categ="Advanced",
|
|
109
|
-
hint=_translate("initial position for the marker"),
|
|
110
|
-
label=_translate("Marker start"))
|
|
111
|
-
|
|
112
|
-
# advanced params:
|
|
113
|
-
self.params['singleClick'] = Param(
|
|
114
|
-
singleClick, valType='bool', inputType="bool", allowedTypes=[],
|
|
115
|
-
updates='constant', allowedUpdates=[], categ="Interface",
|
|
116
|
-
hint=_translate("Should clicking the line accept that rating "
|
|
117
|
-
"(without needing to confirm via 'accept')?"),
|
|
118
|
-
label=_translate("Single click"))
|
|
119
|
-
self.params['disappear'] = Param(
|
|
120
|
-
disappear, valType='bool', inputType="bool", allowedTypes=[],
|
|
121
|
-
updates='constant', allowedUpdates=[], categ="Interface",
|
|
122
|
-
hint=_translate("Hide the scale when a rating has been accepted;"
|
|
123
|
-
" False to remain on-screen"),
|
|
124
|
-
label=_translate("Disappear"))
|
|
125
|
-
self.params['showAccept'] = Param(
|
|
126
|
-
showAccept, valType='bool', inputType="bool", allowedTypes=[],
|
|
127
|
-
updates='constant', allowedUpdates=[], categ="Interface",
|
|
128
|
-
hint=_translate("Should the accept button by visible?"),
|
|
129
|
-
label=_translate("Show accept"))
|
|
130
|
-
self.params['storeRating'] = Param(
|
|
131
|
-
storeRating, valType='bool', inputType="bool", allowedTypes=[],
|
|
132
|
-
updates='constant', allowedUpdates=[], categ="Data",
|
|
133
|
-
hint=_translate("store the rating"),
|
|
134
|
-
label=_translate("Store rating"))
|
|
135
|
-
self.params['storeRatingTime'] = Param(
|
|
136
|
-
storeRatingTime, valType='bool', inputType="bool", allowedTypes=[],
|
|
137
|
-
updates='constant', allowedUpdates=[], categ="Data",
|
|
138
|
-
hint=_translate("store the time taken to make the choice (in "
|
|
139
|
-
"seconds)"),
|
|
140
|
-
label=_translate("Store rating time"))
|
|
141
|
-
self.params['storeHistory'] = Param(
|
|
142
|
-
storeHistory, valType='bool', inputType="bool", allowedTypes=[],
|
|
143
|
-
updates='constant', allowedUpdates=[], categ="Data",
|
|
144
|
-
hint=_translate("store the history of (selection, time)"),
|
|
145
|
-
label=_translate("Store history"))
|
|
146
|
-
self.params['forceEndRoutine'] = Param(
|
|
147
|
-
forceEndRoutine, valType='bool', inputType="bool", allowedTypes=[],
|
|
148
|
-
updates='constant', allowedUpdates=[], categ="Basic",
|
|
149
|
-
hint=_translate("Should accepting a rating cause the end of the "
|
|
150
|
-
"Routine (e.g. trial)?"),
|
|
151
|
-
label=_translate("Force end of Routine"))
|
|
152
|
-
self.params['tickHeight'] = Param(
|
|
153
|
-
tickHeight, valType='num', inputType="single", allowedTypes=[],
|
|
154
|
-
updates='constant', allowedUpdates=[], categ="Interface",
|
|
155
|
-
hint=_translate("height of tick marks (1 is upward, 0 is hidden,"
|
|
156
|
-
" -1 is downward)"),
|
|
157
|
-
label=_translate("Tick height"))
|
|
158
|
-
|
|
159
|
-
# customization:
|
|
160
|
-
self.params['customize_everything'] = Param(
|
|
161
|
-
customize_everything, valType='code', inputType="multi", allowedTypes=[],
|
|
162
|
-
updates='constant', allowedUpdates=[], categ="Custom",
|
|
163
|
-
hint=_translate("Use this text to create the rating scale as you"
|
|
164
|
-
" would in a code Component; overrides all"
|
|
165
|
-
" dialog settings except time parameters, "
|
|
166
|
-
"forceEndRoutine, storeRatingTime, storeRating"),
|
|
167
|
-
label=_translate("Customize everything :"))
|
|
168
|
-
|
|
169
|
-
self.params['size'] = Param(size,
|
|
170
|
-
valType='list', inputType="single", categ='Layout',
|
|
171
|
-
updates='constant', allowedTypes=[],
|
|
172
|
-
allowedUpdates=['constant', 'set every repeat', 'set every frame'],
|
|
173
|
-
hint=_translate("Size of this stimulus (either a single value or "
|
|
174
|
-
"x,y pair, e.g. 2.5, [1,2] "),
|
|
175
|
-
label=_translate("Size"))
|
|
176
|
-
|
|
177
|
-
self.params['pos'] = Param(pos,
|
|
178
|
-
valType='list', inputType="single", categ='Layout',
|
|
179
|
-
updates='constant', allowedTypes=[],
|
|
180
|
-
allowedUpdates=['constant', 'set every repeat', 'set every frame'],
|
|
181
|
-
hint=_translate("Position of this stimulus (e.g. [1,2] )"),
|
|
182
|
-
label=_translate("Position [x,y]"))
|
|
183
|
-
|
|
184
|
-
def writeInitCode(self, buff):
|
|
185
|
-
# build up an initialization string for RatingScale():
|
|
186
|
-
_in = "%(name)s = visual.RatingScale(win=win, name='%(name)s'"
|
|
187
|
-
init_str = _in % self.params
|
|
188
|
-
if self.params['customize_everything'].val.strip() != '':
|
|
189
|
-
# Add preamble
|
|
190
|
-
init_str += ", "
|
|
191
|
-
# Get arguments
|
|
192
|
-
args = getArgs(self.params['customize_everything'].val)
|
|
193
|
-
# Remove anything which would override win or name
|
|
194
|
-
if 'win' in args:
|
|
195
|
-
del args['win']
|
|
196
|
-
if 'name' in args:
|
|
197
|
-
del args['name']
|
|
198
|
-
# Convert each argument to a string
|
|
199
|
-
argList = [f"{key}={val}" for key, val in args.items()]
|
|
200
|
-
# Recombine these arguments into a (now santized) string
|
|
201
|
-
init_str += ", ".join(argList)
|
|
202
|
-
else:
|
|
203
|
-
if self.params['marker'].val:
|
|
204
|
-
init_str += ', marker=%s' % repr(self.params['marker'].val)
|
|
205
|
-
if self.params['marker'].val == 'glow':
|
|
206
|
-
init_str += ', markerExpansion=5'
|
|
207
|
-
|
|
208
|
-
s = str(self.params['size'].val)
|
|
209
|
-
s = s.lstrip('([ ').strip(')] ')
|
|
210
|
-
try:
|
|
211
|
-
size = list(map(float, s.split(','))) * 2
|
|
212
|
-
init_str += ", size=%s" % size[0]
|
|
213
|
-
except Exception:
|
|
214
|
-
pass # size = None
|
|
215
|
-
|
|
216
|
-
s = str(self.params['pos'].val)
|
|
217
|
-
s = s.lstrip('([ ').strip(')] ')
|
|
218
|
-
try:
|
|
219
|
-
pos = list(map(float, s.split(','))) * 2
|
|
220
|
-
init_str += ", pos=%s" % pos[0:2]
|
|
221
|
-
except Exception:
|
|
222
|
-
pass # pos = None
|
|
223
|
-
|
|
224
|
-
# type of scale:
|
|
225
|
-
choices = str(self.params['categoryChoices'].val)
|
|
226
|
-
if self.params['visualAnalogScale'].val:
|
|
227
|
-
init_str += (", low=0, high=1, precision=100, "
|
|
228
|
-
"showValue=False")
|
|
229
|
-
if not self.params['marker'].val:
|
|
230
|
-
init_str += ", marker='glow'"
|
|
231
|
-
elif len(choices):
|
|
232
|
-
if ',' in choices:
|
|
233
|
-
chc = choices.split(',')
|
|
234
|
-
else:
|
|
235
|
-
chc = choices.split(' ')
|
|
236
|
-
chc = [c.strip().strip(', ') for c in chc]
|
|
237
|
-
init_str += ', choices=%s' % str(chc)
|
|
238
|
-
if self.params['tickHeight'].val:
|
|
239
|
-
tickh = self.params['tickHeight'].val
|
|
240
|
-
init_str += ", tickHeight=%.1f" % float(tickh)
|
|
241
|
-
else:
|
|
242
|
-
init_str += ", tickHeight=-1"
|
|
243
|
-
else:
|
|
244
|
-
# try to add low as int; but might be a var instead
|
|
245
|
-
try:
|
|
246
|
-
init_str += ', low=%d' % int(self.params['low'].val)
|
|
247
|
-
except ValueError:
|
|
248
|
-
if self.params['low'].val:
|
|
249
|
-
init_str += ", low=%s" % self.params['low']
|
|
250
|
-
try:
|
|
251
|
-
init_str += ', high=%d' % int(self.params['high'].val)
|
|
252
|
-
except ValueError:
|
|
253
|
-
if self.params['high'].val:
|
|
254
|
-
init_str += ", high=%s" % self.params['high']
|
|
255
|
-
init_str += ', labels=%s' % repr(
|
|
256
|
-
self.params['labels'].val.split(','))
|
|
257
|
-
|
|
258
|
-
scale = str(self.params['scaleDescription'])
|
|
259
|
-
if not len(choices) and len(scale):
|
|
260
|
-
init_str += ", scale=%s" % self.params['scaleDescription']
|
|
261
|
-
if self.params['singleClick'].val:
|
|
262
|
-
init_str += ", singleClick=True"
|
|
263
|
-
if self.params['disappear'].val:
|
|
264
|
-
init_str += ", disappear=True"
|
|
265
|
-
if self.params['markerStart'].val:
|
|
266
|
-
init_str += ", markerStart=%s" % self.params['markerStart']
|
|
267
|
-
if not len(choices) and self.params['tickHeight'].val:
|
|
268
|
-
init_str += ", tickHeight=%s" % self.params['markerStart']
|
|
269
|
-
if not self.params['showAccept'].val:
|
|
270
|
-
init_str += ", showAccept=False"
|
|
271
|
-
# write the RatingScale() instantiation code:
|
|
272
|
-
init_str += ")\n"
|
|
273
|
-
buff.writeIndented(init_str)
|
|
274
|
-
|
|
275
|
-
def writeRoutineStartCode(self, buff):
|
|
276
|
-
buff.writeIndented("%(name)s.reset()\n" % (self.params))
|
|
277
|
-
|
|
278
|
-
def writeFrameCode(self, buff):
|
|
279
|
-
name = self.params['name']
|
|
280
|
-
buff.writeIndented("# *%(name)s* updates\n" % (self.params))
|
|
281
|
-
# try to handle blank start condition gracefully:
|
|
282
|
-
if not str(self.params['startVal'].val).strip():
|
|
283
|
-
self.params['startVal'].val = 0 # time, frame
|
|
284
|
-
if self.params['startType'].val == 'condition':
|
|
285
|
-
self.params['startVal'].val = 'True'
|
|
286
|
-
|
|
287
|
-
self.writeStartTestCode(buff)
|
|
288
|
-
buff.writeIndented("%(name)s.setAutoDraw(True)\n" % (self.params))
|
|
289
|
-
buff.setIndentLevel(-1, relative=True)
|
|
290
|
-
|
|
291
|
-
# handle a response:
|
|
292
|
-
# if requested, force end of trial when the subject 'accepts' the
|
|
293
|
-
# current rating:
|
|
294
|
-
if self.params['forceEndRoutine'].val:
|
|
295
|
-
code = ("continueRoutine &= %s.noResponse "
|
|
296
|
-
"# a response ends the trial\n")
|
|
297
|
-
buff.writeIndented(code % name)
|
|
298
|
-
|
|
299
|
-
# for completeness: could handle going beyond
|
|
300
|
-
# self.params['stopVal'].val with no response
|
|
301
|
-
|
|
302
|
-
def writeRoutineEndCode(self, buff):
|
|
303
|
-
name = self.params['name']
|
|
304
|
-
if len(self.exp.flow._loopList):
|
|
305
|
-
currLoop = self.exp.flow._loopList[-1] # last (outer-most) loop
|
|
306
|
-
else:
|
|
307
|
-
currLoop = self.exp._expHandler
|
|
308
|
-
|
|
309
|
-
# write the actual code
|
|
310
|
-
storeTime = self.params['storeRatingTime'].val
|
|
311
|
-
if self.params['storeRating'].val or storeTime:
|
|
312
|
-
if currLoop.type in ['StairHandler', 'QuestHandler']:
|
|
313
|
-
msg = ("# NB PsychoPy doesn't handle a 'correct answer' "
|
|
314
|
-
"for ratingscale events so doesn't know what to "
|
|
315
|
-
"tell a StairHandler (or QuestHandler)\n")
|
|
316
|
-
buff.writeIndented(msg)
|
|
317
|
-
elif currLoop.type in ['TrialHandler', 'ExperimentHandler']:
|
|
318
|
-
buff.writeIndented("# store data for %s (%s)\n" % (
|
|
319
|
-
currLoop.params['name'], currLoop.type))
|
|
320
|
-
if self.params['storeRating'].val == True:
|
|
321
|
-
code = "%s.addData('%s.response', %s.getRating())\n"
|
|
322
|
-
buff.writeIndented(code % (currLoop.params['name'],
|
|
323
|
-
name, name))
|
|
324
|
-
if self.params['storeRatingTime'].val == True:
|
|
325
|
-
code = "%s.addData('%s.rt', %s.getRT())\n"
|
|
326
|
-
buff.writeIndented(code % (currLoop.params['name'],
|
|
327
|
-
name, name))
|
|
328
|
-
if self.params['storeHistory'].val == True:
|
|
329
|
-
code = "%s.addData('%s.history', %s.getHistory())\n"
|
|
330
|
-
buff.writeIndented(code % (currLoop.params['name'],
|
|
331
|
-
name, name))
|
|
332
|
-
else:
|
|
333
|
-
buff.writeIndented("# RatingScaleComponent: unknown loop "
|
|
334
|
-
"type, not saving any data.\n")
|
|
335
|
-
|
|
336
|
-
# get parent to write code too (e.g. store onset/offset times)
|
|
337
|
-
super().writeRoutineEndCode(buff)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
# Part of the PsychoPy library
|
|
5
|
-
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
|
|
6
|
-
# Distributed under the terms of the GNU General Public License (GPL).
|
|
7
|
-
|
|
8
|
-
"""Placeholder for adding c (or ctypes) extensions to PsychoPy on linux
|
|
9
|
-
"""
|
|
10
|
-
def rush(value=True):
|
|
11
|
-
"""Raise the priority of the current thread/process.
|
|
12
|
-
NOT YET IMPLEMENTED ON posix (but you can use
|
|
13
|
-
> nice python ......
|
|
14
|
-
|
|
15
|
-
"""
|
|
16
|
-
return False
|