gentnerlab / pyoperant

python package for operant conditioning
BSD 3-Clause "New" or "Revised" License
13 stars 15 forks source link

some reorganization to allow more flexible running of behavioral scripts #81

Closed neuromusic closed 9 years ago

neuromusic commented 9 years ago

this code is currently running on vogel. there are some small changes and some big changes. the big ones:

this adds a new script to the path called behave which allows us to run any behavioral protocol without building out the full if __name__=="__main__" every single time

instead, we run behave -P 1 -S B999 TwoAltChoiceExp to run subject B999 on a two alt choice experiment on panel 1.

this should simplify the process of starting up a new behavioral protocol. currently if you have written a protocol, you need to do a few things for our Perl scripts that manage the panels...

  1. make sure Python file containined the protocol is executable
  2. add the protocol file to the path
  3. add the protocol file to the xstart perl script

now we have a few improvements:

  1. we can maintain more than one protocol per file
  2. we only need to register a python module containing behavioral protocols with the pyoperant local config rather than needing to register every single protocol
  3. loading of config files etc is all in behave now, so any bugs in loading protocols can be dealt with there.

finally, to deal with the new command format, I've replaced xstart with pyoperantctl. it works the same as it ever did, but will be installed to the command line when pip installs the package

minor changes:

neuromusic commented 9 years ago

also: behave requires some additional variables to be set in the local settings file. see local_vogel.py for an example

neuromusic commented 9 years ago

hey @MarvinT @wohlmp do you mind taking a look at these changes so we can wrap them into master & deploy on zog? they are working well on vogel so far. this puts all of our scripts for managing and monitoring pyoperant in this package