Skip to main content

Rosetta

Rosetta names the columns of BioLogic EC-Lab .mpr files that your parser does not know. It shows the evidence for each answer, and it says so when the data cannot support a name.

When the instrument vendor adds a column ID, open-source parsers such as galvani stop reading the file until someone works out what the new column is. Rosetta reads the file anyway. It works out the byte width and storage type of each unknown column from the record size, and then identifies the physical quantity from the data. It uses no language model and no network.

$ rosetta drift.mpr --self-check
drift.mpr
  technique GCPL, 12057 rows, 79 bytes per record
  1 column ID(s) unknown to galvani: 950; widths solved from the record size (79 bytes)

  column ID 950 (<f8): Q charge or discharge [C or mA·h]  (confidence 0.533)
    evidence: relation: I*dt summed within half cycle: r2 1.0000, scale 0.0002778
    also considered: dQ, step time

  self-check: hid each of 11 known columns in turn; named 11, 11 correctly, 0 wrong, 0 abstained

drift.mpr is gcpl.mpr from the yadg test suite, with one column ID changed to 950, an ID no parser knows (see tests/test_cli.py).

Install

Python 3.10 or later:

pip install rosetta-eclab

To run the tests or reproduce the benchmark, clone the repository instead:

git clone https://github.com/Nataniel0212/rosetta-eclab.git
cd rosetta-eclab
pip install ".[test]"

Use

rosetta FILE.mpr                     # name every column unknown to galvani (the default reference parser)
rosetta FILE.mpr --reference yadg    # ... unknown to yadg instead
rosetta FILE.mpr --self-check        # also hide each known column in turn and report how many come back right
rosetta FILE.mpr --json              # machine-readable output

Each unknown column gets one of three answers:

  • NAME: an EC-Lab quantity, with its unit, a confidence and the evidence, for example the relation that holds and how well it fits.
  • DUPLICATE: identical in every row to a known column.
  • ABSTAIN: the data does not support a name. Rosetta prefers this to a guess.

--self-check shows how well Rosetta knows your kind of file. It hides each known column in turn and tries to name it.

If galvani stops with "Column ID … is unknown"

In files from EC-Lab 11.50 and later, galvani 0.5.0 reads only the low byte of each column ID. IDs of 256 and above therefore turn into other IDs:

Real ID Column galvani 0.5.0 sees
471 <Ece>/V 215
438 step time/s 182
431–433 |Zwe-ce|, Re(Zwe-ce), -Im(Zwe-ce) 175–177

The column is often one that galvani already knows. Rosetta reads the full IDs and says so:

$ rosetta peis.issue_225.with_ece.mpr
peis.issue_225.with_ece.mpr
  technique PEIS, 32 rows, 112 bytes per record
  galvani 0.5.0 reads only the low byte of each column ID in this file layout, so it misreads 471 as 215, 430 as 174, 431 as 175, 432 as 176, 433 as 177
  every column ID is in galvani's column map; nothing to name

The fix was released in datalab-org-galvani 0.6.0 (galvani-mirror#11). IDs that are missing from the map altogether, such as 880 or 883 and 884, are what Rosetta names.

How it works

  1. Read the file (namer/mprfile.py). Columns the reference parser knows are typed from its column map. For unknown IDs the byte width is solved from the record size, and the storage type is chosen by plausibility.

  2. Code checks first. Constant columns and exact copies of a known column are reported as such. Names that a family of siblings makes obvious are filled in, for example the missing harmonic |Ewe h4|.

  3. Physics library (namer/library.py). Every candidate quantity is tested against the file's other columns:

    • charges: current × time, reset per half cycle, cycle or sequence
    • energies and power: E × I and its integrals
    • impedance: |Z| = √(Re² + Im²), the phase angle, Cs and Cp
    • clocks and step times, and counters stepping by one
    • set points that the measured potential or current holds to

    Each test reports r² and the fitted scale, which must match the expected unit conversion. A potential can therefore not pass as a current. Fits are robust to the single glitch rows that real records have at step transitions.

  4. Statistics fallback (namer/fallback.py). A nearest-neighbour vote over column statistics from public files. It is used only for columns that are not noise, and it is vetoed when a defining relation of the guessed quantity fails in the file.

  5. Abstain when nothing above supports a name.

How accurate it is

The numbers come from five hold-out sets of public EC-Lab files from Zenodo, Battery Data Format and navani: 373 real columns and 95 decoys. None of these files were used during development. Each set was frozen before the namer version that ran on it, and each was run once (results/open_runs.md).

In every task one real column is hidden and must be named from the data. There are also decoys, where the right answer is not to name the column:

  • noise and random integers
  • out-of-vocabulary columns: real columns whose name the tool is not allowed to use, the way a brand-new quantity would look
Rosetta (no model) Claude Opus 5.5 best code-only baseline
Real columns named correctly 350/373 (93.8 %) 359/373 (96.2 %) 77–100 % per hold-out¹
Wrong names on real columns 5 10 –
Decoys named (should abstain) 11/95 16/95 95/95
Last hold-out (70 columns) 70/70, 0 wrong, 1 decoy named 69/70, 1 wrong, 2 decoys named 78.6 %

¹ There are two code-only baselines. A technique prior names the column that is typical for this technique and missing here. A nearest-neighbour vote compares the column with labelled columns from other files. Both are strong when files have standard column sets, but they name every decoy and cannot name a genuinely new column.

The namer improved between hold-outs, so the total includes earlier versions. The history, including the language-model experiments that came first, is in docs/history.md.

Limitations

  • Values EC-Lab computes after the fact cannot be reconstructed reliably. For example, a capacitance is held per segment.
  • Noise-like DC currents in impedance records, and external analog inputs with no sibling column, usually get ABSTAIN.
  • Two quantities with the same definition in a file cannot be told apart from the data. In galvanostatic cycling, for example, dQ and Q charge or discharge reset at the same points. A prior over how common each name is for the technique decides between them, and the alternative is shown.
  • Supported formats: EC-Lab data-module versions 2, 3, 10 and 11. Very old files (version 0) are not supported yet.

Reproduce the benchmark

python scripts/fetch_testdata.py                 # development corpus (yadg + galvani test files)
python scripts/fetch_holdout.py holdout5         # any hold-out; see DATA_SOURCES.md
python -m spike2.tasks                           # v2 benchmark tasks (hashes in prereg2/tasks_manifest.json)
python -m holdout.build holdout5                 # hold-out tasks (hash in holdout/manifest_holdout5.json)
python -m namer.evaluate --split holdout5        # run the namer
python -m spike2.baselines --split holdout5      # code-only baselines
python -m bench.claude_cli --split holdout5 --score rules   # score (Claude runs need the Claude Code CLI)
python -m namer.golden check                     # regression check: every answer must match tests/golden
pytest tests

Data and licence

Rosetta is free software under the GNU General Public License v3.0 or later (see LICENSE). It uses yadg and galvani, both GPL. Measurement files are downloaded at run time and never committed. Sources, licences and attributions are listed in DATA_SOURCES.md. Rosetta is not affiliated with BioLogic.

Metadata

Release files for rosetta-eclab 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rosetta-eclab 0.1.2
File Size Uploaded Provenance
rosetta_eclab-0.1.2.tar.gz 109.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rosetta-eclab 0.1.2
File Interpreter ABI Platform
rosetta_eclab-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 224.3 kB

Release files / rosetta_eclab-0.1.2.tar.gz

Download URL rosetta_eclab-0.1.2.tar.gz
Size 109.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6d503c7f780a13c74a7b48189e7057220155414a942907131b0a9c20c7e1e5c0
BLAKE2b-256 checksum
How to use checksums
6c918d95b2bf6ee1b8d9e1446632d0e8d75a6a0d2cb5b23e7534f506313de66d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / rosetta_eclab-0.1.2-py3-none-any.whl

Download URL rosetta_eclab-0.1.2-py3-none-any.whl
Size 114.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55f76cc6d12ab4648ccd51253687a16bd3aa68d3a9674992ced16d955c7bac45
BLAKE2b-256 checksum
How to use checksums
1aff4251277ff0114687a4cf3b2492322b12bfa74949a4e2502a02eee8917d1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for rosetta-eclab 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rosetta_eclab-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page