Repository navigation
Read the saved results of the analyses in a JASP file - #24
Merged
Merged
Conversation
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 13, 2026
Run the analyses of a .jasp file again through jaspSyntax and the R wrapper
jasp-stats/jaspTools#101
Open
…R sources test-no-regex-token-decoding forbids the legacy token pattern in R/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
jaspSyntax reads the options and the dataset of a
.jaspfile, but not the results JASP Desktop saved for its analyses. Those are the reference to compare a re-run of the analyses with (e.g. when jaspTools generates or runs the unit tests of a module from its.jaspfiles), so today jaspTools can only compare a re-run with a previous re-run of its own.Solution
readAnalysisResultsFromJaspFile(jaspFilePath)gives one record per analysis, in file order and named by analysis name:id(also the folder of its files underresources/),name,title,moduleName,moduleVersion,statusresults: the results tree fromanalyses.json(NULLwhen there is none): tables with their schema and raw cell values, plots, collections. Desktop saves them decoded, so the column names are the user's.jaspVersionandjaspArchiveVersionfrommanifest.jsonIt only reads the archive, no native bridge. The module/version lookup and the reading of a JSON entry are shared with
readAnalysisOptionsFromJaspFile()(.analysisIdentityFromJaspFile,.readJaspArchiveJson); the entry is now read as UTF-8.Not handled:
resources/, so plots cannot be compared with vdiffr against the file.JaspColumn_<i>_Encodedtokens; this reader returns them as stored. None of the 87.jasptest files of the modules (archive versions 5 and 6) has such a token in its results.Testing
test-jasp-file-results.R: two analyses (one without results, old-style module/version keys), non-ASCII text, full-precision numbers, no manifest, no analyses, a missing file, and the Desktop fixturedescriptives-sleep.jasp(Descriptives table values, plot entry).test-jasp-file-results.R,test-jasp-file-options.Randtest-desktop-jasp-contract.Rpass (1 skip: needsJASP_DESCRIPTIVES_MODULE), with the package installed against the releasedlibSyntaxInterface.test-dataset-info.R("rowCount follows the dataset loaded last"), which fail the same way onmasterwith that same released library.🤖 Generated with Claude Code