Repository navigation
Conversation
.omv files from jamovi now convert to XLSX, ODS, CSV and TSV (and on from there, to PDF, JSON, HTML, ...). The data table is read in managed code from the archive, the way jamovi itself writes it: metadata.json for the columns, xdata.json for the labels of text columns, the column-major data.bin and strings.bin for ID text. Integers and decimals stay numbers, missing values are empty cells, and filter columns, analyses and results are left out. Older archives without a dataType are read too. A file that isn't a jamovi archive, or whose data.bin is cut short, is refused. Schema v112 lets existing spreadsheet donuts learn the extension. Fixes KnifeLemon#1818 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The |
KnifeLemon
left a comment
There was a problem hiding this comment.
Thanks for this one, @YusufMntm. The reader follows jamovi's writer closely (virtual columns, cumulative string offsets, the dataType fallback, missing values), and the tests build every archive in code. A few things before it can go in:
1. No cap on cells or text (blocking)
data.bin is streamed, but nothing limits how many cells or how much text the workbook grows to. Two small files can run Filee out of memory:
- 2,000 Integer fields × 1,048,575 rows of zeros:
data.binis 8.4 GB but deflates to about 8 MB, and it becomes about 2.1 billion cells. strings.binholding 256 MB ofAand one terminating zero (about 250 KB packed), with every ID offset indata.binset to 0: every row decodes a fresh 256 MB string (ReadIdString), so about 30 rows fill 16 GB.
OdsReader already guards against exactly this: MaxCells = 10_000_000 and MaxTextCharacters = BoundedXml.MaxPartBytes, refused with error.document_too_large. Could you do the same here?
- Refuse up front when
rowCount × kept columnsis over the cell limit. - Spend a text budget on each text cell (labels and ID strings), and check
end - offsetagainst it before callingGetString.
A test for each, built in code like the others, would be great.
2. Archive version
jamovi itself refuses a jamovi-Archive-Version whose major version is above 12 ("A newer version of jamovi is required", in formatio/omv.py). Here any value is accepted, so a future layout would come out as wrong numbers with no error. Please parse the major version and refuse unknown ones.
3. Translated READMEs
Only README.md gained "OMV (jamovi) read". The spreadsheet row in docs/readme/README.*.md needs the same line, as you did in #1988.
4. Schema 112
#1994 and #1995 also take 112. Whichever merges later moves to the next number: the constant, the from < N step, and the ApplyToLibrary(...) calls and test names in OmvFormatTests and UserDataStoreTests. We'll tell you which number when it's time.
Smaller things, take or leave:
- The size refusals could use
error.document_too_large, as the ODS reader does. - jamovi's
columnCountincludes virtual columns andfieldsdoesn't, so thecolumnCountcheck can refuse a data set whose fields fit. Thefieldscount check is enough on its own. - jamovi's CSV export drops only active filters (
column.is_filter and column.active).metadata.jsonhasactive, so inactive filter columns could stay. - The v112 test appears twice, in
OmvFormatTestsandUserDataStoreTests. One is enough.
CI never started on this PR (no checks at all). Your next push should trigger it.
Fixes #1818
What
jamovi data files (
.omv) now open in Filee and convert to XLSX, ODS, CSV and TSV, and on from there to everything a spreadsheet reaches (PDF, JSON, HTML, HWPX, ...). Only the data table is read; analyses and results inside the file are ignored.How
Office/Sheets/OmvReader.csis a new built-in reader. It reads the archive the way jamovi's ownformatio/omv.pywrites it:meta, orMETA-INF/MANIFEST.MFin older files) must name ajamovi-Archive-Version;metadata.jsongives the columns,xdata.jsonthe labels;data.binis column-major: Decimal columns are 8-byte doubles (NaN = missing); every other column is a 4-byte int (int.MinValue= missing);strings.bin.dataType(NominalText,Continuous) are read with jamovi's own fallback rules.SpreadsheetConverter. Formatomvis Spreadsheet, read-only, graded Specialist in the science field (statistics, off by default)..omv.SharedPresetVersionsgetsomv = 2.6.0. README and ENGINES.md are updated.error.unsupported_source:metadata.json, or a missingdata.bin;data.binshorter than the columns need;strings.bin;Tests
OmvTests(Engines, 10 tests) builds.omvarchives in the test and checks:dataType;OmvFormatTests(Core): registry, donut, field and the v112 step.FormatFieldsTestsandUserDataStoreTestsare updated.Omv|Spreadsheet|Route216 passed / 5 skipped (LibreOffice/rhwp); the wholeFilee.Core.Tests1905 passed / 11 skipped;dotnet format --verify-no-changesis clean.Not tried by hand
No real
.omvfile was available (the issue has no sample). The test archives follow jamovi's writer code exactly, but I haven't opened a file saved by jamovi itself.The schema step is v112. My open PRs #1994 and #1995 also use v112, so whichever merges later needs renumbering; I'll do that on request.
CHANGELOG lines are in a comment below, per the changelog policy.
🤖 Generated with Claude Code