mxbiflow is a toolkit based on pygame and pymxbi
Project description
mxbiflow
A framework for building multi-animal, multi-stage behavioral neuroscience experiments with touchscreen interfaces.
Overview
mxbiflow provides the core infrastructure for cognitive and behavioral experiment scheduling. It handles the experiment lifecycle — from configuration wizards and session management to real-time scene rendering and data logging — so you can focus on designing your experiment logic.
Architecture
┌─────────────────────────────────────────────────────────┐
│ mxbiflow │
│ │
│ Wizard (PySide6) Game Loop (pygame-ce) │
│ ┌────────────────┐ ┌───────────────────┐ │
│ │ MXBIPanel │ │ SceneManager │ │
│ │ ExperimentPanel│ ──────▶ │ ├─ Scene A │ │
│ └────────────────┘ │ ├─ Scene B │ │
│ │ └─ ... │ │
│ │ │ │
│ │ Scheduler │ │
│ │ DetectorBridge │ │
│ └───────────────────┘ │
│ │
│ ConfigStore ◄──── JSON config files │
│ DataLogger ────► session data output │
└─────────────────────────────────────────────────────────┘
│
▼
┌───────────────────┐
│ pymxbi │
│ RFID / Rewarder │
│ Detector / Audio │
└───────────────────┘
Usage
Implement your experiment as a set of scenes, register them, and launch:
from mxbiflow import set_base_path
from mxbiflow.scene import SceneManager
from mxbiflow.wizard import config_wizard, init_gameloop
scene_manager = SceneManager()
scene_manager.register([IDLE, Detect, Discriminate])
config_wizard(scene_manager)
game = init_gameloop(scene_manager)
game.play()
Each scene implements SceneProtocol:
class MyScene:
_running: bool
level_table: dict[str, list[int]] = {"default": [1, 2, 3]}
def start(self) -> None: ...
def quit(self) -> None: ...
@property
def running(self) -> bool: ...
def handle_event(self, event: Event) -> None: ...
def update(self, dt_s: float) -> None: ...
def draw(self, screen: Surface) -> None: ...
Installation
uv add mxbiflow
Requirements
- Python 3.14+
- pygame-ce, PySide6, pymxbi
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mxbiflow-0.3.7.tar.gz.
File metadata
- Download URL: mxbiflow-0.3.7.tar.gz
- Upload date:
- Size: 4.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05a55b221608ade121eb0a9f2e4bd29c85f049384846b7bb7b3847f0b1cb5569
|
|
| MD5 |
f9a1974dcc80a4bceb71ecaccc0079ba
|
|
| BLAKE2b-256 |
e9350403d859f427294129c96ae9334d94e02361f380b9dc20c304a5da1a7510
|
File details
Details for the file mxbiflow-0.3.7-py3-none-any.whl.
File metadata
- Download URL: mxbiflow-0.3.7-py3-none-any.whl
- Upload date:
- Size: 4.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3abea13c250b5aa25aa9eaa842b569419ee71adbf38487c9e3564f921232570c
|
|
| MD5 |
c8d395ff95fbbcfb7a2f3949c4e36e43
|
|
| BLAKE2b-256 |
c1f46e359342b7c4a336fb137e86db8bfff1ebf85f24d478ac1351d3e5414bd1
|