Repository navigation
feat(review): time-bin export with one sheet per measure, and bouts per bin - #236
Merged
Merged
Conversation
A tick in the time-bin dialog writes an Excel workbook instead of a CSV: each behaviour, zone and distance measure on its own sheet, a row per session (with its group) and a column per bin, plus Bins and Measures sheets saying what the columns and sheet names are. Measures no session has are left out. Sheet names are made legal and unique for Excel. The tick is remembered. Adds openpyxl as a dependency.
The flow-schedule tests failed on the macOS runner when one gap of four woke 15-75 ms late, with nothing wrong in the schedule. A drift -- what these tests guard against -- moves every gap, so the median catches it and the total run time still bounds the whole flow.
Each behaviour gets a bouts measure: the bouts that start in a range. A bout under way at the range's start belongs to the range before, so the bins of a session add up to its bout total; counting every bout a bin touches would count one crossing an edge in both. It is offered in the epoch table, the CSV exports and, as its own sheet, the per-measure workbook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new tick in Export → Time bins (CSV)…: One sheet per measure (Excel workbook).
When ticked, the export is an
.xlsxinstead of a CSV:0-1 min,1-2 min, …). The header row is frozen.[]:*?/\) and unique, ignoring case.Bouts per bin
Each behaviour now has a bouts measure (e.g. Groom bouts), with its own sheet in the workbook. It's also offered in the epoch table and the CSV exports.
Flow timing tests
The macOS runner failed
test_flow_schedule.pytwice when one gap of four woke 15–75 ms late. Those tests now check the median gap, which still catches the systematic drift they guard against.Dependency
Adds
openpyxl>=3.1.0(pure Python) to the core dependencies, and updatesuv.lock. If it's missing, the export says how to install it rather than failing.Tests
test_epochs.py::TestMetricSheets: layout, order, empty measures skipped, sheet-name rules.test_time_bins_dialog.py(new): the tick and the greyed-out layout.test_analysis_window.py: a sheet per measure from a real cohort, and an end-to-end.xlsxread back with pandas.test_session_view.py::TestBoutOnsetsand bin tests: onsets, edge-crossing bouts, bins summing to the whole, the bouts sheet.🤖 Generated with Claude Code