add jabs-cli command for converting jabs pose file to nwb pose file - #306
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a convert-to-nwb subcommand to the jabs-cli tool that converts JABS pose estimation HDF5 files (v2–v8) into NWB format. It separates the conversion logic into convert_to_nwb.py and wires it into the CLI via cli.py, and adds a ruff.toml per-file ignore entry to accommodate Click's \b docstring escape convention.
Changes:
- Adds
src/jabs/scripts/cli/convert_to_nwb.pywithpose_to_pose_dataandrun_conversionhelpers for convertingPoseEstimationobjects toPoseDataand writing NWB files. - Registers the new
convert-to-nwbClick command incli.py, wiring upinput_path,output,--per-identity, and--session-descriptionparameters. - Updates
ruff.tomlwith per-file linting ignores (D301, D412) forcli.pyto allow Click's\bhelp-text formatting.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/jabs/scripts/cli/convert_to_nwb.py |
Core conversion logic: builds PoseData from any PoseEstimation object and calls jabs.io.save |
src/jabs/scripts/cli/cli.py |
New convert-to-nwb Click command wired to run_conversion |
ruff.toml |
Per-file ruff ignores to allow Click \b docstring formatting in cli.py |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 14 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…d only added reading in the v7 pose class
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… jabs-nwb-format doc
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add jabs-cli convert-to-nwb command
Summary
Usage
Convert to a single NWB file (all identities)
jabs-cli convert-to-nwb session_pose_est_v6.h5 session.nwb
Write one NWB file per identity
jabs-cli convert-to-nwb session_pose_est_v6.h5 session.nwb --per-identity
Override the NWB session description
jabs-cli convert-to-nwb session_pose_est_v6.h5 session.nwb --session-description "My experiment"
Notes