Repository navigation
Read Igor Pro 8 binary wave version 7 names - #33
Conversation
A wave whose name is longer than 31 bytes is written as version 7. igor2 rejected that version, so packed.load dropped the record. The name follows the version 5 sections and replaces the placeholder in bname. Fixes AFM-analysis#32
|
It would be nice to have an actual (ideally stripped for size) test measurement file. Could you please add that to the PR? |
|
I looked for a version 7 measurement to add. The experiment attached on #28, Test.pxp, is 10,170,354 bytes and walks as 465 records with 336 waves. Every wave header is version 5, and the file does not contain I do not have Igor Pro here, so I cannot save a new wave and strip it. The tests in this PR still start from the checked-in version 5 samples and set the version, the length at offset 56, and the trailing name to the layout in #32. @jilavsky if you still have a small experiment that Igor wrote with one of these waves, that file is the fixture this needs. |
|
TestLongNames_liberal.pxp.zip Thank you. |
…karound igor2 0.5.16 (AFM-analysis/igor2#33) reads binary-wave version 7, the format Igor Pro 8 uses for wave names longer than 31 characters. Verified on temp/TestLongNames_liberalAll.pxp: the importer writes the same seven files with identical numeric data under 0.5.15 + our workaround and under 0.5.16 alone, and on 0.5.16 the workaround is never reached. - Pin igor2>=0.5.16 in pyproject.toml, requirements.txt, conda/meta.yaml (conda-forge has it; the TODO waiting for 0.5.15 is gone). - Remove _patch_v7_wave_to_v5, _v7_long_wave_name and _apply_v7_long_wave_name, and the type-101 counter: an old igor2 now fails fast in _require_igor2 with an upgrade message instead of silently dropping long-named waves. ExtractionResult keeps n_igor8_longname_markers (always 0) for existing callers. - batch.igor_to_nexus lets ImportError through so the GUI shows it. - _load_pxp_filesystem returns (filesystem, n_skipped) again, which the scripts/diag_tree.py and diag_folders.py already expected; diag_pxp.py no longer imports the removed helper. - append_smr_entry opens through open_h5 (main's SSHFS-Win rule, enforced by test_h5open after rebasing onto main). - Tests: version gate, batch surfacing, and an integration test on the real long-names experiment when present. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Igor Pro 8 writes a binary wave as version 7 when its name is longer than 31 bytes. igor2 only accepts versions 1, 2, 3, and 5, so loading that record raises
invalid binary wave version: 7and the wave is dropped from a packed experiment.Version 7 keeps the version 5 layout.
optionsSize1, which the older format note says to ignore, is the length of the name that follows the last version 5 section. Those bytes are not NUL-terminated. Whenbnameis the placeholder:wave name too long:, it is replaced with that name. A version 7 wave withoptionsSize1of 0 keeps the short name already stored inbname. IfoptionsSize1is non-zero butbnameis not the placeholder, the extra bytes are still read and the short name is left unchanged.optionsSize2is still ignored.Fixes #32
Verification
On master, the new tests raise
invalid binary wave version: 7. After the change,pytest testson Windows with Python 3.13: 27 passed. The version 7 cases start from the existing Windows and Macintosh version 5 sample waves, including the 32-byte name from the report and a longer name, and are read both as.ibwfiles and as type 3 records in a packed experiment.flake8passed.An Igor Pro experiment that already contains a version 7 wave was not available. The cases above are version 5 samples with the version field,
optionsSize1, and the trailing name set to the layout described in the report.