Skip to content

v0.6.0 — one entry point for every format

Latest

Choose a tag to compare

@roaldarbol roaldarbol released this 18 Aug 14:50
· 2 commits to main since this release
74a9e84

New features

  • read_dataset() reads any supported format through one entry point, working out which source software wrote the file rather than requiring you to know in advance (#73). Pass source to name the format explicitly, or ... to reach a reader's own arguments. It returns whatever the underlying reader returns — an aniframe, or an anievent for read_boris().

  • detect_source() reports which software wrote a file without reading it. Candidates are narrowed by suffix, then each detector inspects the contents, which matters because twelve sources read .csv. DeepLabCut and LightningPose export structurally identical files, so it returns the combined name "deeplabcut/lightningpose" rather than guessing. Detectors needing an optional package (rhdf5, arrow, xml2, c3dr) are skipped when it is absent, and the error names what was skipped.

Breaking changes

  • get_supported_sources() no longer lists csv as a SLEAP suffix — read_sleap() cannot read it, and auto-detection would have routed such files straight into that error. Restored when the reader gains support (#87).

  • get_supported_sources() renames the trackball source to trackball_bonsai, matching the source metadata read_trackball() actually stamps.

Bug fixes

  • read_trackball() reads real two-sensor Bonsai optical-flow captures (#85). It previously either aborted with an error pointing nowhere near the cause, or silently returned a misaligned trajectory. Sensor alignment, start_datetime, corrupt rows, leading junk, microsecond clocks, gap filling and argument handling were each at fault; see the PR for the breakdown.

  • read_trackball() warns when col_time resolves to a non-datetime column and two sensors are given — a per-board counter has a sensor-local origin and cannot align two files. Warning class aniread_sensor_local_clock.

  • read_animalta() works out which export layout a file uses instead of being told (#88). detailed defaults to "auto" and reads the answer from the header. This was the one case where detect_source() identified a file correctly and read_dataset() then failed on it.

  • detect_source() recognises a Bonsai optical-flow capture whether or not it carries a header row.

  • ensure_header_match() no longer rejects a character col_time on files that do have named headers.

Documentation

  • ?read_trackball documents the raw Bonsai layout, the requirement that col_time be a shared clock with two sensors, and that empty time bins are filled with zero motion — an assumption about this logger rather than about optical flow generally.