psychopy.info - functions for getting information about the system

This module has tools for fetching data about the system or the current Python process. Such info can be useful for understanding the context in which an experiment was run.

class psychopy.info.RunTimeInfo(author=None, version=None, win=None, refreshTest='grating', userProcsDetailed=False, verbose=False)[source]

Returns a snapshot of your configuration at run-time, for immediate or archival use.

Returns a dict-like object with info about PsychoPy, your experiment script, the system & OS, your window and monitor settings (if any), python & packages, and openGL.

If you want to skip testing the refresh rate, use ‘refreshTest=None’

Example usage: see runtimeInfo.py in coder demos.

Parameters:
  • win (Window, False or None) – 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 one.

  • author (str or None) – None will try to autodetect first __author__ in sys.argv[0], whereas a str being user-supplied author info (of an experiment).

  • version (str or None) – None try to autodetect first __version__ in sys.argv[0] or str being the user-supplied version info (of an experiment).

  • verbose (bool) – Show additional information. Default is False.

  • refreshTest (str, bool or None) – 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. Default is ‘grating’.

  • userProcsDetailed (bool) – Get details about concurrent user’s processes (command, process-ID). Default is False.

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, …

_setCurrentProcessInfo(verbose=False, userProcsDetailed=False)[source]

What other processes are currently active for this user?

_setExperimentInfo(author, version, verbose)[source]

Auto-detect __author__ and __version__ in sys.argv[0] (= the # users’s script)

_setPythonInfo()[source]

External python packages, python details

_setSystemInfo()[source]

System info

_setWindowInfo(win, verbose=False, refreshTest='grating', usingTempWin=True)[source]

Find and store info about the window: refresh rate, configuration info.

psychopy.info._getHgVersion(filename)[source]

Tries to discover the mercurial (hg) parent and id of a file.

Not thoroughly tested; untested on Windows Vista, Win 7, FreeBSD

Author:
  • 2010 written by Jeremy Gray

psychopy.info._getSha1hexDigest(thing, isfile=False)[source]

Returns base64 / hex encoded sha1 digest of str(thing), or of a file contents. Return None if a file is requested but no such file exists

Author:
  • 2010 Jeremy Gray; updated 2011 to be more explicit,

  • 2012 to remove sha.new()

>>> _getSha1hexDigest('1')
'356a192b7913b04c54574d18c28d46e6395428ab'
>>> _getSha1hexDigest(1)
'356a192b7913b04c54574d18c28d46e6395428ab'
psychopy.info._getSvnVersion(filename)[source]

Tries to discover the svn version (revision #) for a file.

Not thoroughly tested; untested on Windows Vista, Win 7, FreeBSD

Author:
  • 2010 written by Jeremy Gray

psychopy.info._getUserNameUID()[source]

Return user name, UID.

UID values can be used to infer admin-level: -1=undefined, 0=full admin/root, >499=assume non-admin/root (>999 on debian-based)

Author:
  • 2010 written by Jeremy Gray

psychopy.info.getMemoryUsage()[source]

Get the memory (RAM) currently used by this Python process, in M.

psychopy.info.getRAM()[source]

Return system’s physical RAM & available RAM, in M.


Back to top