Skip to main content

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, max_fps=120)
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mxbiflow-0.3.15.tar.gz (4.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mxbiflow-0.3.15-py3-none-any.whl (4.5 MB view details)

Uploaded Python 3

File details

Details for the file mxbiflow-0.3.15.tar.gz.

File metadata

  • Download URL: mxbiflow-0.3.15.tar.gz
  • Upload date:
  • Size: 4.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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

Hashes for mxbiflow-0.3.15.tar.gz
Algorithm Hash digest
SHA256 885769b557fa676a7e6e58dcb35b6687043c4525f6763a09e0871cbf51f6e662
MD5 20f30babc91a0f8ac8eef2af37ffe339
BLAKE2b-256 39ad50f82af65019334a5b2dec3175588a1c6c60631fbb196e2e3bac0ff7d1ea

See more details on using hashes here.

File details

Details for the file mxbiflow-0.3.15-py3-none-any.whl.

File metadata

  • Download URL: mxbiflow-0.3.15-py3-none-any.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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

Hashes for mxbiflow-0.3.15-py3-none-any.whl
Algorithm Hash digest
SHA256 614e30a76dd8fbd4fd2f09c512f7a3f820fb137dab96193ed6575f35473e260e
MD5 35f8cc405e8346197739f23c4d36b8c8
BLAKE2b-256 e7189c4af7d8f55d4ac0835857620722841c2b4eda50169d31309e59d86aa123

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page