Skip to content

parseQmlOptions reads the options of a form without preparing a run - #27

Open
boutinb wants to merge 5 commits into
jasp-stats:masterfrom
boutinb:defaultOptionsWithoutDatasets
Open

boutinb wants to merge 5 commits into
jasp-stats:masterfrom
boutinb:defaultOptionsWithoutDatasets

Conversation

@boutinb

@boutinb boutinb commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

parseQmlOptions() (also behind readAnalysisOptionsFromQml() and jaspTools' analysisOptions()) used the native parse for runs. That parse requires every dataset selection option of a multi-dataset form to name a loaded dataset, so the defaults of such a form could not be read at all, with or without datasets loaded.

Change

parseQmlOptions() now calls the new native loadQmlAndParseFormOptions() → syntaxBridgeLoadQmlAndParseFormOptionsStatus (jasp-stats/jasp-desktop#6414):

  • a dataset selection option that names no dataset stays empty (""), whatever is loaded;
  • a selection that is given must still name a loaded dataset;
  • no multi-dataset run is prepared.

parseQmlOptions() never prepares a run anyway: runs go through loadQmlAndParseOptions(Status) (jaspBase), which is unchanged and still refuses an empty selection.

Two tests in test-selection-surface.R: the defaults without a dataset, and with datasets loaded (empty stays empty, a given selection resolves, an unknown one fails, a run still needs one).

Version 1.4.5 (follows #24, #25 and #26; the version line may conflict trivially).

Merge order

This needs a SyntaxInterface release with the new export: it cannot build against v1.0.beta.8. Merge after jasp-stats/jasp-desktop#6414 is in a release, and bump the release tag in configure/configure.win then.

Tests

Against a SyntaxInterface built from #6414: 524 expectations, 0 failures (the 2 test-dataset-info.R failures seen with beta.8 pass too, as this library is newer). jaspTools' analysisOptions("multiDataSetFunc") + runAnalysis() with two datasets now runs, with the same results as with hand-built options; jaspTools has a test for it (jasp-stats/jaspTools#101), skipped below jaspSyntax 1.4.5.

🤖 Generated with Claude Code

boutinb and others added 3 commits November 16, 2026 16:43
* Read the saved results of the analyses in a JASP file

readAnalysisResultsFromJaspFile() gives, per analysis of a .jasp file, the
results JASP Desktop saved in analyses.json (decoded, raw cell values),
with its id, name, title, module, module version and status; the JASP and
archive versions of the file are attributes. This is the reference a re-run
of the analyses can be compared with.

The module/version lookup and the reading of a JSON entry of the archive
are shared with readAnalysisOptionsFromJaspFile(); the entry is read as
UTF-8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Version 1.4.2: readAnalysisResultsFromJaspFile

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* readAnalysisResultsFromJaspFile docs: no encoded-name grammar in the R sources

test-no-regex-token-decoding forbids the legacy token pattern in R/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…columns (jasp-stats#25)

The bridge gives nominal columns as factors and ordinal columns as ordered
factors, with their levels in the order of the file, but
readDatasetFromJaspFile turned them into character vectors. Loaded again
with loadDataSet(), their levels were then ordered alphabetically: in
puppies.jasp (jaspAnova) Dose became "15 mins", "30 mins", "No puppies"
instead of "No puppies", "15 mins", "30 mins", so its simple and custom
contrasts compared other levels than in JASP. The factors are now kept, and
loadDataSet() keeps their level order (jasp-stats#19).

Version 1.4.3 (after 1.4.2 of readAnalysisResultsFromJaspFile).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
parseQmlOptions (also behind readAnalysisOptionsFromQml and jaspTools'
analysisOptions) used the native parse for runs, which requires every dataset
selection option of a multi-dataset form to name a loaded dataset: the defaults of
such a form could not be read at all. It now uses the new native
syntaxBridgeLoadQmlAndParseFormOptionsStatus (jasp-desktop): a dataset selection
that names no dataset stays empty (""), and no multi-dataset run is prepared. A
selection that is given must still name a loaded dataset. Runs
(loadQmlAndParseOptions(Status), used by jaspBase) are unchanged.

Needs a SyntaxInterface release with that export. Version 1.4.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boutinb and others added 2 commits November 16, 2026 17:48
flattenTypes (jasp-stats#20) was added for jaspTools' analysisOptions(<file>.jasp), which split
the saved {value, types} options into <name> and <name>.types. jaspTools now gives
the saved options as they are: the QML form of the analysis reads that shape, and
it runs an analysis of a .jasp file through jaspBase::runWrappedAnalysis. Nothing
else used it, so the argument and the internal flattenedAnalysisOptionsFromJaspFile
go. The nested <name>.types that the option encoder writes are still dropped with
includeTypeOptions = FALSE, for the runtime options.

Version 1.4.4.

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.

1 participant