Beispiel #1
0
    def __init__(self, author=None, version=None, win=None,
                 refreshTest='grating', userProcsDetailed=False,
                 verbose=False):
        # this will cause an object to be created with all the same methods as
        # a dict
        dict.__init__(self)

        self['psychopyVersion'] = psychopyVersion
        # NB: this looks weird, but avoids setting high-priority incidentally
        self['psychopyHaveExtRush'] = rush(False)
        d = os.path.abspath(os.path.dirname(__file__))
        githash = _getHashGitHead(d)  # should be .../psychopy/psychopy/
        if githash:
            self['psychopyGitHead'] = githash

        self._setExperimentInfo(author, version, verbose)
        self._setSystemInfo()  # current user, locale, other software
        self._setCurrentProcessInfo(verbose, userProcsDetailed)

        # need a window for frame-timing, and some openGL drivers want
        # a window open
        if win is None:  # make a temporary window, later close it
            win = visual.Window(
                fullscr=True, monitor="testMonitor", autoLog=False)
            refreshTest = 'grating'
            usingTempWin = True
        elif win != False:
            # we were passed a window instance, use it:
            usingTempWin = False
            self.winautoLog = win.autoLog
            win.autoLog = False
        else:  # don't want any window
            usingTempWin = False

        if win:
            self._setWindowInfo(win, verbose, refreshTest, usingTempWin)

        self['pythonVersion'] = sys.version.split()[0]
        if verbose:
            self._setPythonInfo()
            if win:
                self._setOpenGLInfo()
        if usingTempWin:
            win.close()  # close after doing openGL
        elif win != False:
            win.autoLog = self.winautoLog  # restore
Beispiel #2
0
    def __init__(self,
                 author=None,
                 version=None,
                 win=None,
                 refreshTest='grating',
                 userProcsDetailed=False,
                 verbose=False,
                 randomSeed=None):
        """
        :Parameters:
            
            win : *None*, False, :class:`~psychopy.visual.Window` instance
                what window to use for refresh rate testing (if any) and settings. None -> temporary window using
                defaults; False -> no window created, used, nor profiled; a Window() instance you have already created
            
            author : *None*, string
                None = try to autodetect first __author__ in sys.argv[0]; string = user-supplied author info (of an experiment)
            
            version : *None*, string
                None = try to autodetect first __version__ in sys.argv[0]; string = user-supplied version info (of an experiment)
            
            verbose : *False*, True; how much detail to assess
            
            refreshTest : None, False, True, *'grating'*
                True or 'grating' = assess refresh average, median, and SD of 60 win.flip()s, using visual.getMsPerFrame()
                'grating' = show a visual during the assessment; True = assess without a visual
                
            userProcsDetailed: *False*, True
                get details about concurrent user's processses (command, process-ID)
                
            randomSeed: *None*
                a way for the user to record, and optionally set, a random seed for making reproducible random sequences
                'set:XYZ' will both record the seed, 'XYZ', and set it: random.seed('XYZ'); numpy.random.seed() is NOT set
                None defaults to python default;
                'time' = use time.time() as the seed, as obtained during RunTimeInfo()
                randomSeed='set:time' will give a new random seq every time the script is run, with the seed recorded.
                
        :Returns: 
            a flat dict (but with several groups based on key names):
            
            psychopy : version, rush() availability
                psychopyVersion, psychopyHaveExtRush, git branch and current commit hash if available
                
            experiment : author, version, directory, name, current time-stamp, 
                SHA1 digest, VCS info (if any, svn or hg only),
                experimentAuthor, experimentVersion, ...
                
            system : hostname, platform, user login, count of users, user process info (count, cmd + pid), flagged processes
                systemHostname, systemPlatform, ...
                
            window : (see output; many details about the refresh rate, window, and monitor; units are noted)
                windowWinType, windowWaitBlanking, ...windowRefreshTimeSD_ms, ... windowMonitor.<details>, ...
                
            python : version of python, versions of key packages (wx, numpy, scipy, matplotlib, pyglet, pygame)
                pythonVersion, pythonScipyVersion, ...
                
            openGL : version, vendor, rendering engine, plus info on whether several extensions are present
                openGLVersion, ..., openGLextGL_EXT_framebuffer_object, ...
        """

        dict.__init__(
            self
        )  # this will cause an object to be created with all the same methods as a dict

        self['psychopyVersion'] = psychopyVersion
        self['psychopyHaveExtRush'] = rush(
            False
        )  # NB: this looks weird, but avoids setting high-priority incidentally
        d = os.path.abspath(os.path.dirname(__file__))
        githash = _getHashGitHead(dir=d)  # should be .../psychopy/psychopy/
        if githash:
            self['psychopyGitHead'] = githash

        self._setExperimentInfo(author, version, verbose, randomSeed)
        self._setSystemInfo()  # current user, locale, other software
        self._setCurrentProcessInfo(verbose, userProcsDetailed)

        # need a window for frame-timing, and some openGL drivers want a window open
        if win == None:  # make a temporary window, later close it
            win = visual.Window(fullscr=True, monitor="testMonitor")
            refreshTest = 'grating'
            usingTempWin = True
        else:  # either False, or we were passed a window instance, use it for timing and profile it:
            usingTempWin = False
        if win:
            self._setWindowInfo(win, verbose, refreshTest, usingTempWin)

        self['pythonVersion'] = sys.version.split()[0]
        if verbose:
            self._setPythonInfo()
            if win: self._setOpenGLInfo()
        if usingTempWin:
            win.close()  # close after doing openGL
Beispiel #3
0
    def __init__(self, author=None, version=None, win=None,
                 refreshTest='grating', userProcsDetailed=False,
                 verbose=False):
        """
        :Parameters:

            win : *None*, False, :class:`~psychopy.visual.Window` instance
                what window to use for refresh rate testing (if any) and
                settings. None -> temporary window using
                defaults; False -> no window created, used, nor profiled;
                a Window() instance you have already created

            author : *None*, string
                None = try to autodetect first __author__ in sys.argv[0];
                string = user-supplied author info (of an experiment)

            version : *None*, string
                None = try to autodetect first __version__ in sys.argv[0];
                string = user-supplied version info (of an experiment)

            verbose : *False*, True; how much detail to assess

            refreshTest : None, False, True, *'grating'*
                True or 'grating' = assess refresh average, median, and SD
                of 60 win.flip()s, using visual.getMsPerFrame()
                'grating' = show a visual during the assessment;
                True = assess without a visual

            userProcsDetailed: *False*, True
                get details about concurrent user's processses
                (command, process-ID)

        :Returns:
            a flat dict (but with several groups based on key names):

            psychopy : version, rush() availability
                psychopyVersion, psychopyHaveExtRush, git branch and current
                commit hash if available

            experiment : author, version, directory, name, current time-stamp,
                SHA1 digest, VCS info (if any, svn or hg only),
                experimentAuthor, experimentVersion, ...

            system : hostname, platform, user login, count of users,
                user process info (count, cmd + pid), flagged processes
                systemHostname, systemPlatform, ...

            window : (see output; many details about the refresh rate, window,
                and monitor; units are noted)
                windowWinType, windowWaitBlanking, ...windowRefreshTimeSD_ms,
                ... windowMonitor.<details>, ...

            python : version of python, versions of key packages
                (wx, numpy, scipy, matplotlib, pyglet, pygame)
                pythonVersion, pythonScipyVersion, ...

            openGL : version, vendor, rendering engine, plus info on whether
                several extensions are present
                openGLVersion, ..., openGLextGL_EXT_framebuffer_object, ...
        """

        # this will cause an object to be created with all the same methods as
        # a dict
        dict.__init__(self)

        self['psychopyVersion'] = psychopyVersion
        # NB: this looks weird, but avoids setting high-priority incidentally
        self['psychopyHaveExtRush'] = rush(False)
        d = os.path.abspath(os.path.dirname(__file__))
        githash = _getHashGitHead(d)  # should be .../psychopy/psychopy/
        if githash:
            self['psychopyGitHead'] = githash

        self._setExperimentInfo(author, version, verbose)
        self._setSystemInfo()  # current user, locale, other software
        self._setCurrentProcessInfo(verbose, userProcsDetailed)

        # need a window for frame-timing, and some openGL drivers want
        # a window open
        if win is None:  # make a temporary window, later close it
            win = visual.Window(
                fullscr=True, monitor="testMonitor", autoLog=False)
            refreshTest = 'grating'
            usingTempWin = True
        elif win != False:
            # we were passed a window instance, use it:
            usingTempWin = False
            self.winautoLog = win.autoLog
            win.autoLog = False
        else:  # don't want any window
            usingTempWin = False

        if win:
            self._setWindowInfo(win, verbose, refreshTest, usingTempWin)

        self['pythonVersion'] = sys.version.split()[0]
        if verbose:
            self._setPythonInfo()
            if win:
                self._setOpenGLInfo()
        if usingTempWin:
            win.close()  # close after doing openGL
        elif win != False:
            win.autoLog = self.winautoLog  # restore