Skip to content

Improve JMP17 writer and reader support - #2

Merged
alexandergwosdz merged 1 commit into
mainfrom
feat/jmp-writer-combined
Sep 1, 2026
Merged

Improve JMP17 writer and reader support#2
alexandergwosdz merged 1 commit into
mainfrom
feat/jmp-writer-combined

Conversation

@alexandergwosdz

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings September 1, 2026 21:27
@alexandergwosdz
alexandergwosdz merged commit a6e4dd4 into main Sep 1, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are a couple of confirmed correctness/robustness issues in the writer (non-string column labels and long variable-width string lengths) plus a portability issue in the new example script.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates jmpio to better match JMP 17.2.0’s on-disk format, improving writer header/metadata emission and expanding reader handling for additional markers and string encodings, with corresponding new/extended tests and a JMP JSL repro script.

Changes:

  • Update writer to emit a JMP 17.2.0-style header/preamble and column metadata/offset table layout.
  • Extend reader parsing for additional column-info markers and string/index decoding edge cases.
  • Expand test coverage for JMP17 writer structure and additional reader fixtures.
File summaries
File Description
tests/test_writer.py Adds JMP17 writer assertions (metadata, structure records) and adjusts round-trip comparisons.
tests/test_reader.py Adds fixture coverage for compact subtype variants, marker handling, and fixed-width string null padding behavior.
src/jmpio/writer.py Implements JMP 17.2.0-only writer path with new header/preamble, metadata records, offset table writing, and improved dtype handling.
src/jmpio/metadata.py Extends column-info scanning to skip an additional marker type (0xfc 0xff).
src/jmpio/column.py Fixes/extends decoding for row states, fixed-width strings with null padding, pooled string index widths, and adds an Int64 row state branch.
examples/create_bogus_data.jsl Adds a JSL script to generate a native JMP 17 table for debugging/fixtures.
Review details
  • Files reviewed: 6/13 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/jmpio/writer.py
Comment on lines +591 to +595
use_int16 = max_length >= 128

# Prepare header
header = bytearray([0] * 13)
header[9] = 2 if use_int16 else 1 # Width bytes
header[8] = 2 if use_int16 else 1 # Width bytes
Comment thread src/jmpio/writer.py
@@ -174,49 +230,25 @@ def write_column_metadata(file: BinaryIO, df: pd.DataFrame) -> list[int]:
width = min(max(len(column_name) * 8, 40), 300)
@@ -0,0 +1,43 @@
Names Default To Here( 1 );

out = "C:/GitHub/jmpio-python/examples/bogus_data_jmp17_native.jmp";
Comment thread tests/test_writer.py
Comment on lines +175 to +176
build_string = b"Jul 23 2023, 19:09:15, Release, JMP, Version 17.2.0"
build_end = data.index(build_string) + len(build_string)
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