In this case, you can create a plugin to not only fix the bug, but apply itĪcross multiple existing installations to save the day. You are in the middle of running scheduled experiments, even worse, you haveÄozens of test stations using the hardware. However, you cannot wait for the next release because /opt/local/lib/python2.5/site-packages/PsychoPy-1.62.00-py2.5.egg/psychopy/ext/init.py, line 18, in .The getData() method of the class to get it You notice that it has beenįixed in a pending release of PsychoPy ®, and that it involves a single change to Result, PsychoPyâs builtin support for their devices provided by the Recent release of PsychoPy ® by a hardware vendor updating their drivers. This file can be read and passed to the long_descriptionĪrgument of setup() in setup.py if desired by inserting the following intoĪs an example, consider a fictional scenario where a bug was introduced in a One should also include a README.md file which provides detailed informationĪbout the plugin. You can also specify install_requires to indicate which versions of PsychPy You should also use appropriate classifiers for your plugin, AttributesĪssigned to entry points should follow the naming conventions of PsychoPy ® (camelĬase), however plugins are free to use internally whatever style the authorĬhooses (eg. Looking at entry_points we can see that were assigning #!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup ( name = 'psychopy-rect-area', version = '1.0', description = 'Compute the area of a Rect stimulus.', long_description = '', url = '', author = 'Nobody', author_email =, license = 'GPå ', classifiers =, keywords = 'psychopy stimulus', packages =, install_requires =, include_package_data = True, entry_points =, zip_safe = False ) To do this, we use the followingÄictionary when defining entry point metadata with the setup() function in Psychopy.visual when the plugin is loaded. MyStim defined in the plugin module psychopy_plugin to appear in Within PsychoPyâs namespace to create links to the associated entry points inĪs an example, using entry point groups and specifiers, we can add a class called Group names are fully-qualified names of modules or unbound classes Any entry point belonging to groups whose names start with psychopy Matching the given project name, then gets the entry point mapping from its When loading a specified plugin, the plugin loader searches for a distribution How entry points are defined and added to package metadata isÄynamic Discovery of Services and Plugins Packages advertise their entry points by having them in their To PsychoPy ® without needing to create a separate plugin project.Ä®ntry points reference objects in a plugin module that PsychoPy ® will attach Python package can define entry points, allowing developers to add functionality operating system, CPU architecture, and Python version). The loader also ensures plugins are compatible with the PythonÄ®nvironment (ie. Usage: exp data.ExperimentHandler (nameFace Preference,versionâ0.1.0â) Parameters: name : a string or unicode. interleaved staircases or loops within loops. ![]() Useful for generating a single data file from an experiment with many different loops (e.g. Plugin loader where within PsychoPyâs namespace to place objects exported by the A container class for keeping track of multiple loops/handlers. The metadata of the package defines âentry pointsâ which tells the Installed plugins for PsychoPy ® are discoverable on the system using package Any changes made to PsychoPy ® with plugins do not persistĪcross sessions, meaning if Python is restarted, PsychoPy ® will return to itsÄefault behaviour unless loadPlugin() is called again. Once loadPlugin() returns, imported objects are () function and passing the project name of theÄesired plugin to it. The plugin system in PsychoPy ® functions as a dynamic importer, which importsĪdditional executable code from plugin packages then patches them into an active shuffle ( stims ) #shuffle order of stims for trial in range ( nTrials ): #loop through trials #point to a different filename for each image my_image. join ( main_dir, 'images' ) import numpy as np #for random shuffling stims = #create a list if images to show nTrials = 3 #create a number of trials for your images #create the stimulus but don't specify the precise image yet my_image = visual. chdir ( '/home/shoarly/Documents/pytutorial/exp' ) main_dir = os. Window ( monitor = mon ) #define a window import os #stuff you only have to define once at the top of your script os. Monitor ( 'myMonitor', width = 35.56, distance = 60 ) mon. From psychopy import visual, monitors, event #define the monitor parameters mon = monitors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |