Skip to content

Support parsing BioLogic .mpr (binary) files #18

Description

@hitheshrai

pyimpspec already parses BioLogic's .mpt text export, but not the raw binary .mpr files that EC-Lab produces by default. Users currently have to manually export each measurement to .mpt first, and archives that only kept the .mpr can't be read at all.

Would you accept a parser for .mpr? The format is undocumented and version-dependent, so the cleanest approach is to delegate parsing to the existing galvani package as an optional dependency (lazy import, with a clear error directing users to pip install galvani or to export .mpt). The magnitude/phase → impedance conversion and multi-sweep splitting are handled by the existing dataframe_to_data_sets helper, so the parser is small.

Two things I'd value your call on:

  1. Optional vs. hard dependency for galvani (I've assumed optional/lazy-imported).
  2. Test fixture: only EC-Lab hardware can write .mpr, so a fixture matching the shared control spectrum can't be generated programmatically. I can supply a representative .mpr, or you may prefer to add one of your own that encodes the standard control spectrum. The test I wrote skips gracefully when no data*.mpr fixture is present.

I have a working implementation + test ready to submit as a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions