Skip to content

mef3io 1.1.3

Released 2026-09-21

This version was published to PyPI only; there is no GitHub release or MATLAB bundle for it. MATLAB users should use 1.1.4, which contains everything below.

Highlights

  • Errors you can tell apart. Errors are now mef3io.MefError subclasses: PasswordError, CrcError, FormatError, IoError and WriteConflictError. They still subclass RuntimeError, so existing except RuntimeError code keeps working.
  • Check and repair a session. mef3io.Validator(path).validate() (or python -m mef3io validate SESSION.mefd) compares what a session's headers declare with the data it actually holds, and never writes. mef3io.repair_session(path, [check ids]) (or python -m mef3io repair SESSION.mefd --check ID) fixes only the checks you name, rewrites headers only (never samples), and keeps a backup. See Validation.
  • Recover after an interrupted write. mef3io.recover_session / python -m mef3io recover brings the block index and the data file back into agreement after a crash or power cut. It is a dry run unless you pass --apply.
  • Built for recordings appended to for days or months. Each append now costs time in proportion to the new data only, not to everything already recorded, and memory used for block indexes on very long sessions is capped. Writer(durability="full") adds flush-to-disk barriers on every append; the default "fast" skips them. See Long recordings.
  • Reader warns once (SessionDeclarationWarning) when a session has the missing buffer-size declarations described below. Reading is unaffected.

Fixes

  • Buffer sizes declared as 0. Sessions written by mef3io 1.1.2 and earlier declared some buffer sizes in their metadata as 0. meflib-based readers allocate memory from these values before decoding, and can crash on such files. mef3io now measures and writes all six values correctly.
  • Appending to a session written by other software no longer damages its metadata (extra bytes at the end of .tmet files, and application-specific metadata regions, are now preserved).
  • archive_session and extract_session no longer block other Python threads while they run.

Upgrading

  • Sessions written by mef3io 1.1.2 or earlier carry the 0 buffer sizes. mef3io and pymef read them fine, but a meflib-based reader may crash. Appending with this version repairs the segment it extends; for the rest, run python -m mef3io validate SESSION.mefd, then mef3io.repair_session(path, [check ids]) or python -m mef3io repair SESSION.mefd --check ID. See Validation.
  • With the default durability="fast", run python -m mef3io recover on a session after an unclean shutdown during writing.