arena_interface_python
Python interface to the Reiser lab ArenaController.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (6.2%) to scientific vocabulary
Repository
Python interface to the Reiser lab ArenaController.
Basic Info
Statistics
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
About
markdown
- Python Package Name: arena_interface
- Description: Python interface to the Reiser lab ArenaController.
- Version: 2.0.0
- Python Version: 3.11
- Release Date: 2025-09-03
- Creation Date: 2023-10-17
- License: BSD-3-Clause
- URL: https://github.com/janelia-python/arena_interface_python
- Author: Peter Polidoro
- Email: peter@polidoro.io
- Copyright: 2025 Howard Hughes Medical Institute
- References:
- https://github.com/janelia-arduino/ArenaController
- Dependencies:
- click
- schedule
- pyserial
Example Usage
Python
```python from arena_interface import ArenaInterface
ai = ArenaInterface(debug=True) ai.setethernetmode()
or
ai.setserialmode(port='/dev/ttyACM0', baudrate=115200) ai.allon() ai.alloff() ai.streamframe(path='./patterns/pat0004.pat', frameindex=0) ai.streamframes(path='./patterns/pat0004.pat', framerate=20, runtimeduration=50) ai.trialparams(patternid=3, framerate=20, runtimeduration=50) ai.trialparams(patternid=3, framerate=-20, runtime_duration=50) ```
Command Line
help
```sh arena-interface --help
Usage: arena-interface [OPTIONS] COMMAND [ARGS]...
Options: --help Show this message and exit.
Commands: all-off all-on display-reset set-refresh-rate stream-frame trial-params ```
```sh arena-interface stream-frame --help
Usage: arena-interface [OPTIONS] PATH FRAME_INDEX
Options: --help Show this message and exit. ```
example commands
sh arena-interface all-onsh $FRAME_INDEX=0 arena-interface stream-frame ./patterns/pat0004.pat $FRAME_INDEX arena-interface stream-frame ./patterns/pat0004.pat 0sh FRAME_RATE=2 RUNTIME_DURATION=50 # 50 * 100ms = 5000ms = 5s arena-interface stream-frames ./patterns/pat0004.pat $FRAME_RATE $RUNTIME_DURATION arena-interface stream-frames ./patterns/pat0004.pat 2 50sh PATTERN_ID=3 FRAME_RATE=20 RUNTIME_DURATION=50 # 50 * 100ms = 5000ms = 5s arena-interface trial-params -- $PATTERN_ID $FRAME_RATE $RUNTIME_DURATION arena-interface trial-params -- 3 20 50sh PATTERN_ID=3 FRAME_RATE=-20 RUNTIME_DURATION=50 # 50 * 100ms = 5000ms = 5s arena-interface trial-params -- $PATTERN_ID $FRAME_RATE $RUNTIME_DURATION arena-interface trial-params -- 3 -20 50sh arena-interface all-offadvanced commands
sh arena-interface set-refresh-rate 175sh arena-interface switch-grayscale 0 # 0=binary, 1=grayscale
Installation
https://github.com/janelia-python/python_setup
GNU/Linux
Ethernet
C-x C-f /sudo::/etc/network/interfaces
```sh auto eth1
iface eth1 inet static
address 192.168.10.2
netmask 255.255.255.0
gateway 192.168.10.1
dns-nameserver 8.8.8.8 8.8.4.4
```
sh
nmap -sn 192.168.10.0/24
nmap -p 62222 192.168.10.62
nmap -sV -p 62222 192.168.10.0/24
sh
sudo -E guix shell nmap
sudo -E guix shell wireshark -- wireshark
sh
make guix-container
Serial
Drivers
GNU/Linux computers usually have all of the necessary drivers already installed, but users need the appropriate permissions to open the device and communicate with it.
Udev is the GNU/Linux subsystem that detects when things are plugged into your computer.
Udev may be used to detect when a device is plugged into the computer and automatically give permission to open that device.
If you plug a sensor into your computer and attempt to open it and get an error such as: "FATAL: cannot open /dev/ttyACM0: Permission denied", then you need to install udev rules to give permission to open that device.
Udev rules may be downloaded as a file and placed in the appropriate directory using these instructions:
Download rules into the correct directory
sh curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/master/scripts/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rulesRestart udev management tool
sh sudo service udev restartUbuntu/Debian users may need to add own “username” to the “dialout” group
sh sudo usermod -a -G dialout $USER sudo usermod -a -G plugdev $USERAfter setting up rules and groups
You will need to log out and log back in again (or reboot) for the user group changes to take effect.
After this file is installed, physically unplug and reconnect your board.
Python Code
The Python code in this library may be installed in any number of ways, chose one.
pip
sh python3 -m venv ~/venvs/arena_interface source ~/venvs/arena_interface/bin/activate pip install arena_interfaceguix
Setup guix-janelia channel:
https://github.com/guix-janelia/guix-janelia
sh guix install python-arena-interface
Windows
Python Code
The Python code in this library may be installed in any number of ways, chose one.
pip
sh python3 -m venv C:\venvs\arena_interface C:\venvs\arena_interface\Scripts\activate pip install arena_interface
Development
Clone Repository
sh
git clone git@github.com:janelia-python/arena_interface_python.git
cd arena_interface_python
Guix
Install Guix
Edit metadata.org
sh
make metadata-edits
Tangle metadata.org
sh
make metadata
Develop Python package
sh
make guix-dev-container
exit
Test Python package using ipython shell
sh
make guix-dev-container-ipython
import arena_interface
exit
Test Python package installation
sh
make guix-container
exit
Upload Python package to pypi
sh
make upload
Test direct device interaction using serial terminal
```sh make guix-dev-container-port-serial # PORT=/dev/ttyACM0
make PORT=/dev/ttyACM1 guix-dev-container-port-serial
? # help [C-a][C-x] # to exit ```
Docker
Install Docker Engine
https://docs.docker.com/engine/
Develop Python package
sh
make docker-dev-container
exit
Test Python package using ipython shell
sh
make docker-dev-container-ipython
import arena_interface
exit
Test Python package installation
sh
make docker-container
exit
Owner
- Name: Janelia Python
- Login: janelia-python
- Kind: organization
- Repositories: 2
- Profile: https://github.com/janelia-python
Janelia Python Packages
CodeMeta (codemeta.json)
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"license": "https://spdx.org/licenses/BSD-3-Clause",
"codeRepository": "https://github.com/janelia-python/arena_interface_python",
"dateCreated": "2023-10-17",
"dateModified": "2025-09-18",
"name": "arena_interface",
"version": "4.0.0",
"description": "Python interface to the Reiser lab ArenaController.",
"programmingLanguage": [
"Python 3"
],
"author": [
{
"@type": "Person",
"givenName": "Peter",
"familyName": "Polidoro",
"email": "peter@polidoro.io",
"affiliation": {
"@type": "Organization",
"name": "Howard Hughes Medical Institute"
}
}
]
}
GitHub Events
Total
- Push event: 34
- Create event: 2
Last Year
- Push event: 34
- Create event: 2
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0