Skip to content

Instantly share code, notes, and snippets.

@jeremygray
jeremygray / py.testw
Last active Jan 6, 2018
py.testw: py.test, hacked to use a framework build of python in a conda-based installation (like pythonw does)
View py.testw
#!/Users/jgray/anaconda/python.app/Contents/MacOS/python
# above line was: #!/Users/jgray/anaconda/bin/python
# JRG: hacked py.test to use a framework build of python
# allows -k usage: py.testw -k polygon
# find your values inside your .../anaconda/bin/pythonw
if __name__ == '__main__':
import sys
View gist:d66f624c0fed5ae1dadb
file1: 40f61b33f559f1de61e698b9f46b65c985a98955
file2: c85320d9ddb90c13f4a215f1f0a87b531ab33310
@jeremygray
jeremygray / readme.txt
Last active Jun 26, 2017
PsychoPy timing test script. (public domain)
View readme.txt
** If you haven't done so, you may need to unzip these files before attempting to run the experiment **
** All three files should be in the same directory, then run timeFrames.psyexp in PsychoPy 1.79 or later **
This PsychoPy experiment allows you to test the refresh timing of your screen at a variety of rates. Feel free to add a BlackBoxToolkit or simple photometer to the system to confirm that the physical times fall exactly as expected from the times reported here.
The key to good timing is that the stimuli are specified in terms of the number of frames rather than as a number of (milli)seconds. It is also helpful to reduce potential interference, and so turning off internet access and bluetooth, and quitting any extra software is recommended.
This experiment is not intended as a demo as such, and it does contain some code segments. These are designed to go and check exactly when the screen flipped for each stimulus onset/offset. These times can be viewed in the resulting data files (summarised in the d
@jeremygray
jeremygray / test_20K_trials.psyexp
Created Oct 19, 2012
psychopy: test 20,000 trials with print statement, .psyexp version
View test_20K_trials.psyexp
<PsychoPy2experiment version="1.75.01" encoding="utf-8">
<Settings>
<Param name="Show mouse" val="False" valType="bool" updates="None"/>
<Param name="Save csv file" val="True" valType="bool" updates="None"/>
<Param name="Monitor" val="testMonitor" valType="str" updates="None"/>
<Param name="Enable Escape" val="True" valType="bool" updates="None"/>
<Param name="color" val="$[0,0,0]" valType="str" updates="None"/>
<Param name="Window size (pixels)" val="[80, 60]" valType="code" updates="None"/>
<Param name="Full-screen window" val="False" valType="bool" updates="None"/>
<Param name="colorSpace" val="rgb" valType="str" updates="None"/>
@jeremygray
jeremygray / test_20K_trials.py
Created Oct 9, 2012
run 20,000 trials of PsychoPy, save all data formats
View test_20K_trials.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script allows you to test whether your computer can run 20,000 trials using PsychoPy.
It attempts to run 20 repetitions of 1000 trials, and will save a .psydat files in ./data/
for each loop, plus a single .dlm, .csv, .xlsx, and .log files.
INSTRUCTIONS:
Just run the script from within the coder window (or from the command line) and let it run.