Pybehave

Pybehave: a hardware agnostic, Python-based framework for controlling behavioral neuroscience experiments - Published in JOSS (2024)

https://github.com/tne-lab/py-behav-box-v2

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
  • Committers with academic emails
    2 of 5 committers (40.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Artificial Intelligence and Machine Learning Computer Science - 87% confidence
Last synced: 4 months ago · JSON representation ·

Repository

Pybehave is an open source software interface and framework for controlling behavioral experiments in neuroscience and psychology.

Basic Info
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 9
  • Open Issues: 7
  • Releases: 1
Created almost 4 years ago · Last pushed 11 months ago
Metadata Files
Readme Contributing License Citation

README.md

pybehave

Logo

A hardware-agnostic, Python-based framework for developing behavioral neuroscience experiments
Explore the docs »

Report Bug · Request Feature

Overview

Pybehave is an open source software interface and framework for controlling behavioral experiments in neuroscience and psychology built around a hardware-agnostic and highly object-oriented design philosophy.

Pybehave separates code for task design from specific hardware implementations to streamline development, accessibility, and data sharing. This approach, combined with task-specific Graphical User Interfaces (GUIs) enabling user control without external hardware, expedites and simplifies the creation and visualization of complex behavioral tasks. User created task definition files can interact with hardware-specific Source files both written in Python. Any and all local configuration can be handled outside of Python using Address Files and Protocols.

All pybehave tasks are coordinated via a Workstation GUI.

Pybehave software and documentation are available on GitHub.

Getting started

While pybehave is in principle cross-platform, it has only been extensively tested on Windows. We are happy to support other platforms so log any issues on GitHub if you have trouble installing. Additionally, some Sources are unlikely to work on all platforms.

Install with pip

We recommend installing pybehave in a virtual environment. Pybehave has been tested on Python 3.9, 3.10, and 3.11.

Install pybehave's default PYPI distribution with

pip install pybehave

This distribution does not include any of the dependencies for hardware specific functionality. To install the dependencies for all supported hardware use the following

pip install pybehave[full]

Alternatively, a subset of the dependencies can be downloaded, for example

pip install pybehave[oe,video]

A full list of the optional hardware-specific extras is below

oe              # Dependencies for the OpenEphys framework
whisker         # Dependencies for communication with WhiskerServer
video           # Dependencies for control of connected video systems
serial          # Dependencies for communication over serial
ni              # Dependencies for communication with NationalInstruments DAQs
hikvision       # Dependencies for communication with HikVision DVRs
bo              # Dependencies for a Bayesian Optimization framework

Run from source

Alternatively, you can clone the repository and run from source.

git clone https://github.com/tnelab/py-behav-box-v2.git
cd py-behav-box-v2
pip install .

Hardware-specific extras can be installed by adding square brackets after the '.' similarly to the above.

Starting pybehave

From the standard install, pybehave can be started by running the pybehave command from the virtual environment. Alternatively, if you have installed pybehave into a conda environment on Windows, we've provided an example batch script for starting pybehave in the root directory (py-behav.bat). This batch script can be copied to the Desktop and the first line should be modified to use the name of the environment where pybehave was installed. This batch file will also redirect all console outputs to a log file in the py-behav/logging directory.

Local folder structure

Pybehave uses a folder saved on the Desktop to handle all task files and local configuration:

-py-behav
    pybehave.ini            # Contains all settings for the GUI
    -Local
        -Tasks              # Task python files
        -GUIs               # Task GUI files
        -Sources            # User-created sources
    -Configurations         # Structured CSVs for quickly loading tasks
    -TaskName1              # All files associated with a Task called TaskName1
        -AddressFiles       # AddressFiles for this task
        -Protocols          # Protocols for this task
        -Data               # Any data associated with runs of the task
    -TaskName2          

We've included an example set of task files used by Translational Neuroengineering Lab. If you plan to edit or add tasks, you should make a new repository with the same structure (Tasks and GUIs folders) and include any existing tasks you might need. The contents of this repository should be saved in the Local directory.

Updating pybehave

Pybehave is explicitly designed in a manner where files for local configuration are separate from the root directory. This ensures that users can easily update to the newest version of the platform without compromising their experimental files. To update, simply pull the latest version from the upstream base pybehave code repository and the repository referenced by the Local folder.

Running a task

After opening pybehave, you will see a GUI window like that shown above.

Select File->Add Task from the menu bar. Choose your task and a chamber number from the dropdowns or load a Configuration file.

Enter a subject ID in the Subject text box and choose an Address File or Protocol if necessary to set up the local configuration of the task. Alternatively, tasks can be tested without hardware by interacting with elements in the task-specific GUI.

Any event information such as data saving or external communication or pre-task prompts can be configured by right-clicking the chamber widget and selecting Edit Configuration. All data will be saved to the Desktop in the py-behav/TASK_NAME/Data/SUBJECT/DATE folder.

Press the green play button to start the task.

The task can be paused or ended prematurely with the orange pause button or red stop button respectively.

Contributing, Questions, Issues, and Feedback

Users interested in expanding functionalities in pybehave are welcome to do so. Issues reports are encouraged through GitHub's issue tracker. See details on how to contribute and report issues in CONTRIBUTING.md.

Owner

  • Name: Translational NeuroEngineering Laboratory
  • Login: tne-lab
  • Kind: organization
  • Location: Minneapolis, MN

Developing technologies to reverse the effects of mental illness.

JOSS Publication

Pybehave: a hardware agnostic, Python-based framework for controlling behavioral neuroscience experiments
Published
June 05, 2024
Volume 9, Issue 98, Page 6515
Authors
Evan M. Dastin-van Rijn ORCID
Department of Psychiatry and Behavioral Sciences, University of Minnesota Medical Center, Minneapolis, MN 55454, United States of America
Joel Nielsen
Department of Psychiatry and Behavioral Sciences, University of Minnesota Medical Center, Minneapolis, MN 55454, United States of America
Elizabeth M. Sachse ORCID
Department of Psychiatry and Behavioral Sciences, University of Minnesota Medical Center, Minneapolis, MN 55454, United States of America
Christina Li
Department of Psychiatry and Behavioral Sciences, University of Minnesota Medical Center, Minneapolis, MN 55454, United States of America
Megan E. Mensinger
Department of Psychiatry and Behavioral Sciences, University of Minnesota Medical Center, Minneapolis, MN 55454, United States of America
Stefanie G. Simpson
Department of Psychiatry and Behavioral Sciences, University of Minnesota Medical Center, Minneapolis, MN 55454, United States of America
Michelle C. Buccini
Department of Psychiatry and Behavioral Sciences, University of Minnesota Medical Center, Minneapolis, MN 55454, United States of America
Francesca A. Iacobucci
Department of Psychiatry and Behavioral Sciences, University of Minnesota Medical Center, Minneapolis, MN 55454, United States of America
David J. Titus ORCID
Department of Psychiatry and Behavioral Sciences, University of Minnesota Medical Center, Minneapolis, MN 55454, United States of America
Alik S. Widge ORCID
Department of Psychiatry and Behavioral Sciences, University of Minnesota Medical Center, Minneapolis, MN 55454, United States of America
Editor
Stefan Appelhoff ORCID
Tags
Animal behavior Operant tasks

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Dastin-van Rijn
  given-names: Evan M.
  orcid: "https://orcid.org/0000-0002-1428-0723"
- family-names: Nielsen
  given-names: Joel
- family-names: Sachse
  given-names: Elizabeth M.
  orcid: "https://orcid.org/0000-0002-1669-8752"
- family-names: Li
  given-names: Christina
- family-names: Mensinger
  given-names: Megan E.
- family-names: Simpson
  given-names: Stefanie G.
- family-names: Buccini
  given-names: Michelle C.
- family-names: Iacobucci
  given-names: Francesca A.
- family-names: Titus
  given-names: David J.
  orcid: "https://orcid.org/0000-0001-7819-734X"
- family-names: Widge
  given-names: Alik S.
  orcid: "https://orcid.org/0000-0001-8510-341X"
contact:
- family-names: Dastin-van Rijn
  given-names: Evan M.
  orcid: "https://orcid.org/0000-0002-1428-0723"
doi: 10.5281/zenodo.11244351
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Dastin-van Rijn
    given-names: Evan M.
    orcid: "https://orcid.org/0000-0002-1428-0723"
  - family-names: Nielsen
    given-names: Joel
  - family-names: Sachse
    given-names: Elizabeth M.
    orcid: "https://orcid.org/0000-0002-1669-8752"
  - family-names: Li
    given-names: Christina
  - family-names: Mensinger
    given-names: Megan E.
  - family-names: Simpson
    given-names: Stefanie G.
  - family-names: Buccini
    given-names: Michelle C.
  - family-names: Iacobucci
    given-names: Francesca A.
  - family-names: Titus
    given-names: David J.
    orcid: "https://orcid.org/0000-0001-7819-734X"
  - family-names: Widge
    given-names: Alik S.
    orcid: "https://orcid.org/0000-0001-8510-341X"
  date-published: 2024-06-05
  doi: 10.21105/joss.06515
  issn: 2475-9066
  issue: 98
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 6515
  title: "Pybehave: a hardware agnostic, Python-based framework for
    controlling behavioral neuroscience experiments"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.06515"
  volume: 9
title: "Pybehave: a hardware agnostic, Python-based framework for
  controlling behavioral neuroscience experiments"

GitHub Events

Total
  • Watch event: 2
  • Push event: 3
  • Fork event: 1
Last Year
  • Watch event: 2
  • Push event: 3
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 275
  • Total Committers: 5
  • Avg Commits per committer: 55.0
  • Development Distribution Score (DDS): 0.058
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
theonlydvr t****r@g****m 259
JoelNielsen7 3****7 9
Andy Lustig a****3@g****m 4
jazlinumn j****n@u****u 2
bucci026 b****6@u****u 1
Committer Domains (Top 20 + Academic)
umn.edu: 2

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 62
  • Total pull requests: 33
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 2 hours
  • Total issue authors: 4
  • Total pull request authors: 3
  • Average comments per issue: 0.65
  • Average comments per pull request: 0.0
  • Merged pull requests: 32
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 0
  • Average time to close issues: 5 days
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.6
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • theonlydvr (47)
  • alustig3 (11)
  • GWDiehl (1)
  • tuliofalmeida (1)
Pull Request Authors
  • theonlydvr (34)
  • alustig3 (4)
  • JoelNielsen7 (1)
Top Labels
Issue Labels
bug (22) enhancement (18) documentation (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 22 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
pypi.org: pybehave

Pybehave

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 22 Last month
Rankings
Dependent packages count: 9.8%
Average: 37.4%
Dependent repos count: 65.0%
Maintainers (1)
Last synced: 4 months ago

Dependencies

docs/requirements.txt pypi
  • mkdocs >=1.2.2
environment.yml pypi
  • absl-py ==1.3.0
  • alembic ==1.8.0
  • appdirs ==1.4.4
  • arrow ==1.2.2
  • astunparse ==1.6.3
  • attrdict ==2.0.1
  • attrs ==21.4.0
  • automat ==20.2.0
  • banal ==1.0.6
  • beautifulsoup4 ==4.11.1
  • cachetools ==5.2.0
  • cardinal-pythonlib ==1.1.20
  • charset-normalizer ==2.1.0
  • cloudpickle ==2.2.0
  • colorama ==0.4.5
  • colorlog ==6.6.0
  • constantly ==15.1.0
  • contourpy ==1.0.5
  • cycler ==0.11.0
  • dataset ==1.5.2
  • decorator ==5.1.1
  • deprecated ==1.2.13
  • dill ==0.3.6
  • dm-tree ==0.1.7
  • et-xmlfile ==1.1.0
  • ffmpeg-python ==0.2.0
  • flatbuffers ==22.10.26
  • fonttools ==4.38.0
  • future ==0.18.2
  • gast ==0.4.0
  • google-auth ==2.13.0
  • google-auth-oauthlib ==0.4.6
  • google-pasta ==0.2.0
  • gpflow ==2.6.3
  • gpflux ==0.3.0
  • greenlet ==1.1.2
  • grpcio ==1.50.0
  • h5py ==3.7.0
  • hikload ==1.1.4
  • hyperlink ==21.0.0
  • idna ==3.3
  • incremental ==21.3.0
  • isodate ==0.6.1
  • keras ==2.8.0
  • keras-preprocessing ==1.1.2
  • kiwisolver ==1.4.4
  • lark ==1.1.3
  • libclang ==14.0.6
  • lxml ==4.9.1
  • mako ==1.2.0
  • markdown ==3.4.1
  • markupsafe ==2.1.1
  • matplotlib ==3.6.1
  • multipledispatch ==0.6.0
  • nidaqmx ==0.6.3
  • numpy ==1.22.4
  • oauthlib ==3.2.2
  • openpyxl ==3.0.10
  • opt-einsum ==3.3.0
  • packaging ==21.3
  • pandas ==1.4.2
  • pefile ==2022.5.30
  • pendulum ==2.1.2
  • pillow ==9.2.0
  • plotly ==5.11.0
  • prettytable ==3.3.0
  • protobuf ==3.19.6
  • psutil ==5.9.1
  • pyasn1 ==0.4.8
  • pyasn1-modules ==0.2.8
  • pygame ==2.1.2
  • pygments ==2.12.0
  • pyparsing ==3.0.9
  • pypdf2 ==2.3.1
  • pyqt5 ==5.15.7
  • pyqt5-qt5 ==5.15.2
  • pyqt5-sip ==12.11.0
  • pyserial ==3.5
  • pyserial-asyncio ==0.6
  • python-dateutil ==2.8.2
  • pytz ==2022.1
  • pytzdata ==2020.1
  • pywin32-ctypes ==0.2.0
  • pyyaml ==6.0
  • requests ==2.28.1
  • requests-oauthlib ==1.3.1
  • rsa ==4.9
  • scipy ==1.8.1
  • screeninfo ==0.8
  • semantic-version ==2.10.0
  • soupsieve ==2.3.2.post1
  • sqlalchemy ==1.4.37
  • sqlparse ==0.4.2
  • tabulate ==0.9.0
  • tenacity ==8.1.0
  • tensorboard ==2.8.0
  • tensorboard-data-server ==0.6.1
  • tensorboard-plugin-wit ==1.8.1
  • tensorflow ==2.8.3
  • tensorflow-estimator ==2.8.0
  • tensorflow-io-gcs-filesystem ==0.27.0
  • tensorflow-probability ==0.16.0
  • termcolor ==2.0.1
  • tqdm ==4.64.0
  • trieste ==0.13.0
  • twisted ==22.4.0
  • twisted-iocpsupport ==1.0.2
  • typing-extensions ==4.2.0
  • urllib3 ==1.26.10
  • wcwidth ==0.2.5
  • werkzeug ==2.2.2
  • whisker ==1.3.0
  • wrapt ==1.14.1
  • xmler ==0.2.0
  • zope-interface ==5.4.0