Skip to content

Read Igor Pro 8 long data-folder names - #30

Merged
paulmueller merged 1 commit into
AFM-analysis:masterfrom
CAOShurong:fix-igor8-long-folder-names
Nov 3, 2026
Merged

paulmueller merged 1 commit into
AFM-analysis:masterfrom
CAOShurong:fix-igor8-long-folder-names

Conversation

@CAOShurong

Copy link
Copy Markdown

Igor Pro 8 writes a data-folder start as record type 101 when the name does not fit in the 31-byte type 9 record. The payload is a uint32 byte count followed by exactly that many name bytes. A type 10 record still closes the folder. Type 33 is a 4-byte id after the folder start and stays skipped. In the attached experiment, type 26 is an XOP state marker, not a folder name.

packed.load did not know type 101, so those folders never appeared. Their variables and waves were created in the parent. On the experiment attached to #28 that raises ValueError: collision on name K0 in root.

This treats type 101 as a folder start. A length that does not match the payload raises ValueError.

The attached Test.pxp now loads. USAXS contains 24 sample folders, including AMC_25_crystalline_04_07_26_10min_0036 and the 82-byte name that contains spaces. Each of those folders has its 14 waves. Short type 9 folders are unchanged.

coverage run --source=igor2 -m pytest tests passed 20 tests. flake8 --exclude _version.py . passed. The Codecov upload was not run locally.

This does not add binary wave version 7. Every wave in the attached file is version 5.

Record type 101 is a folder start. Its payload is a uint32 byte count
followed by that many name bytes, and a type 10 record closes it.
Skipping the record dropped the folder and mixed its contents into
the parent.
@paulmueller
paulmueller merged commit 211f747 into AFM-analysis:master Nov 3, 2026
3 checks passed
paulmueller added a commit that referenced this pull request Nov 3, 2026
The experiment attached to #28 is trimmed to one wave per data folder
(122 KB). It has 18 folders whose names are longer than 31 bytes.
Before #30 it raised a name collision in root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants