Skip to content

PyRAT database integration#16

Open
NeuroThom wants to merge 21 commits into
mainfrom
pyrat-dev
Open

PyRAT database integration#16
NeuroThom wants to merge 21 commits into
mainfrom
pyrat-dev

Conversation

@NeuroThom
Copy link
Copy Markdown
Member

Implements the PyRAT / Bonsai integration, allowing lab members to select a subject from the PyRAT colony database, run a Bonsai session, and automatically log water delivery and session events back to PyRAT.

  • Adds ucl_open.pyrat Python package with HTTP client, data models, and session schema
  • Adds UclOpen.Pyrat C# Bonsai package with AddComment, UpdateWaterAmount, and SetSessionEnd nodes
  • Adds PyRAT GUI (src/PyRAT_GUI/) for animal selection, Bonsai session launching, and post-session confirmation dialog
  • Posts #sessionstart, #waterdelivery, and #sessionend comments to PyRAT automatically
  • Adds documentation and a test workflow (docs/workflows/pyrat/pyrat_test.bonsai)

Closes ucl-open/support#11

NeuroThom and others added 19 commits March 24, 2026 17:45
[dev-sandbox](https://github.com/Coen-Lab/dev-sandbox)

Co-authored-by: Ryan Shen <zchaxsh@ucl.ac.uk>
Pydantic models, and comment parsers for
water delivery and session start/end events.
- typed exceptions
- helper posters
- add respx to dev dependencies for tests.
- Pydantic session schema exported to JSON
- JSON used to generate the
UclOpen.Pyrat C# operators.
- Includes a README overview.
- Update bonsai environment to load locally built packages
- Add simple bonsai workflow to test package functions
- `AddComment`, `SetSessionEnd`, `UpdateWaterAmount` operators
- Remove all `_` prefixes
- Fix return type errors and `None` types
- Moved test workflow
- built with powershell 7 (install independently)
@NeuroThom NeuroThom self-assigned this Apr 12, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 12, 2026

Codecov Report

❌ Patch coverage is 0% with 145 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ucl_open/pyrat/models.py 0.00% 67 Missing ⚠️
src/ucl_open/pyrat/client.py 0.00% 63 Missing ⚠️
src/ucl_open/pyrat/session.py 0.00% 11 Missing ⚠️
src/ucl_open/pyrat/__init__.py 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@NeuroThom NeuroThom added the feature New feature or request label Apr 12, 2026
Base automatically changed from refactor-bonsai-pkg to bonsai-pkg April 14, 2026 10:30
Base automatically changed from bonsai-pkg to main April 14, 2026 10:42
Copy link
Copy Markdown
Member

@glopesdev glopesdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the database client is named PyRAT we might want to name the package UclOpen.PyRat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants