Skip to content

Commit

Permalink
STYLE: properly relocate from future import division
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremygray committed Nov 24, 2015
1 parent f28df1d commit 68fcfbf
Show file tree
Hide file tree
Showing 69 changed files with 237 additions and 142 deletions.
3 changes: 2 additions & 1 deletion psychopy/demos/coder/basic/hello_world.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
Demo: show a very basic program: hello world
"""

from __future__ import division

# Import key parts of the PsychoPy library:
from psychopy import visual, core

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
This analysis script takes one or more staircase datafiles as input from a GUI
Expand All @@ -12,6 +11,8 @@
size of the points according to how many trials were run at that level
"""

from __future__ import division

from psychopy import data, gui, core
from psychopy.tools.filetools import fromFile
import pylab, scipy
Expand Down Expand Up @@ -83,4 +84,4 @@

core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/experiment control/JND_staircase_exp.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
Measure your JND in orientation using a staircase method
"""

from __future__ import division

from psychopy import core, visual, gui, data, event
from psychopy.tools.filetools import fromFile, toFile
import time, numpy
Expand Down Expand Up @@ -108,4 +109,4 @@
win.close()
core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/experiment control/TrialHandler.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
Demo of TrialHandler
"""

from __future__ import division

from random import random
from psychopy import data

Expand Down Expand Up @@ -50,4 +51,4 @@
trials.saveAsPickle(fileName = 'testData') # this saves a copy of the whole object
df = trials.saveAsWideText("testDataWide.txt") # wide is useful for analysis with R or SPSS. Also returns dataframe df

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
9 changes: 5 additions & 4 deletions psychopy/demos/coder/experiment control/autoDraw_autoLog.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

from psychopy import visual, core, event

"""
One easy way to handle stimuli that are drawn repeatedly is to
Expand All @@ -13,6 +10,10 @@
This can be turned off for each call with stim.setAutoDraw(True, autoLog=False)
"""

from __future__ import division

from psychopy import visual, core, event

win = visual.Window([800, 800])

# a stim's name is used in log entries
Expand Down Expand Up @@ -48,4 +49,4 @@
win.close()
core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/experiment control/experimentHandler.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
Demo of class data.ExperimentHandler
"""

from __future__ import division

from psychopy import data, logging
from numpy import random
logging.console.setLevel(logging.DEBUG)
Expand Down Expand Up @@ -55,4 +56,4 @@
print("Done. 'exp' experimentHandler will now (end of script) save data to testExp.csv")
print(" and also to testExp.psydat, which is a pickled version of `exp`")

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/experiment control/fMRI_launchScan.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
This demo illustrates using hardware.emulator.launchScan() to either start a
real scan, or emulate sync pulses. Emulation is to allow debugging script timing
offline, without requiring a scanner (or a hardware sync pulse generator).
"""

from __future__ import division

# Author: Jeremy R. Gray

from psychopy import visual, event, core, gui
Expand Down Expand Up @@ -72,4 +73,4 @@
win.close()
core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
Use this script to analyze data from the gammaMotionNull.py
Expand All @@ -10,6 +9,8 @@
or shift-click) to plot the results
"""

from __future__ import division

import matplotlib
matplotlib.use('TKAgg')

Expand Down Expand Up @@ -66,4 +67,4 @@
pylab.show()
core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/experiment control/gammaMotionNull.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
Determine screen gamma using motion-nulling method
Expand All @@ -13,6 +12,8 @@
the apparent direction of motion of the bars.
"""

from __future__ import division

from psychopy import visual, core, event, gui, data
from psychopy.tools.filetools import fromFile, toFile
from psychopy import filters
Expand Down Expand Up @@ -169,4 +170,4 @@ def presentStimulus(direction):

core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/experiment control/logFiles.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
PsychoPy's log module is mostly a simple wrapper of the python logging module.
Expand All @@ -20,6 +19,8 @@
So setting to DEBUG level will include all possible messages, setting to ERROR will include only the absolutely essential messages.
"""

from __future__ import division

from psychopy import logging, core, visual

globalClock = core.Clock() # if this isn't provided the log times will reflect secs since python started
Expand Down Expand Up @@ -53,4 +54,4 @@
win.close()
core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/experiment control/runtimeInfo.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
Demo of some ways to use class psychopy.info.RunTimeInfo()
to obtain current system and other data at run-time.
"""

from __future__ import division

from psychopy import visual, logging, core
import psychopy.info

Expand Down Expand Up @@ -79,4 +80,4 @@
win.close()
core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/hardware/CRS_BitsBox.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
This demo shows you how to use a CRS BitsSharp device with PsychoPy
Expand All @@ -12,6 +11,8 @@
normal and PsychoPy will do the conversions for you
"""

from __future__ import division

from psychopy import visual, core, event, logging
from psychopy.hardware import crs
logging.console.setLevel(logging.INFO)
Expand Down Expand Up @@ -73,4 +74,4 @@
win.close()
core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/hardware/CRS_BitsPlusPlus.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division


"""
Expand All @@ -22,6 +21,8 @@
Check your experiment still works as expected!
"""

from __future__ import division

from psychopy import visual, core, event, logging
from psychopy.hardware import crs
import numpy
Expand Down Expand Up @@ -71,4 +72,4 @@
win.close()
core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/hardware/cedrusRB730.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
Demo of using Cedrus RB730 hardware
"""

from __future__ import division

from psychopy.hardware import cedrus
from psychopy import core
import sys
Expand Down Expand Up @@ -36,4 +37,4 @@
print('baseTime:', rb730.getBaseTimer())
core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/hardware/egi_netstation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
This demo comes from the simple_distilled example provided with pynetstation.
Expand All @@ -9,6 +8,8 @@
See the pynetstation documentation for further information.
"""

from __future__ import division

# Set up:

import egi.simple as egi
Expand Down Expand Up @@ -43,4 +44,4 @@
# ns.finalize()


# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/hardware/ioLab_bbox.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
Demo to illustrate using ioLabs button box.
"""

from __future__ import division

from __future__ import print_function

__author__ = 'Jonathan Roberts (orig demo); Jeremy Gray (rewrite 2013)'
Expand Down Expand Up @@ -62,4 +63,4 @@
win.close()
core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/hardware/labjack_u3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
Demo for using labjack DAC devices
Expand All @@ -12,6 +11,8 @@
line is slightly different to the documentation on LabJack's website
"""

from __future__ import division

from psychopy import visual, core, event, sound
from labjack import u3

Expand Down Expand Up @@ -56,4 +57,4 @@
win.close()
core.quit()

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
5 changes: 3 additions & 2 deletions psychopy/demos/coder/hardware/monitorDemo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division

"""
Often you can control monitors simply from the Monitor Center in the
Expand All @@ -19,11 +18,13 @@
More info is available at http: //www.psychopy.org/api/monitors.html
"""

from __future__ import division

from psychopy import monitors

names = monitors.getAllMonitors()
for thisName in names:
thisMon = monitors.Monitor(thisName)
print(thisMon.getDistance())

# The contents of this file are in the public domain.
# The contents of this file are in the public domain.
Loading

0 comments on commit 68fcfbf

Please sign in to comment.