Skip to content

Unexport internals without callers outside jaspSyntax - #28

Open
boutinb wants to merge 3 commits into
jasp-stats:masterfrom
boutinb:unexportInternals
Open

boutinb wants to merge 3 commits into
jasp-stats:masterfrom
boutinb:unexportInternals

Conversation

@boutinb

@boutinb boutinb commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Change

Unexports the jaspSyntax functions that nothing outside jaspSyntax calls, and that the README does not present as API:

function why it can go
analysisOptionsFromJaspFile raw native reader; readAnalysisOptionsFromJaspFile() is the API
cleanUp clearNativeState() / clearQmlForms() / clearDatasetState() are the documented lifecycle controls
columnEncoderContext, decodeColumnText, decodeColumnNames the column decoding helpers the dataset readers use internally; decoding is the native table's job
analysisOptionsFromQml an alias of readAnalysisOptionsFromQml(), removed

They stay available as jaspSyntax:::. The NAMESPACE, the Rd files (the column helpers get \keyword{internal}), the README and the package doc are updated. The tests call them with :::, and the contract test checks that they stay unexported, like the earlier removals of decodeAnalysisResults/columnMapping.

Still exported, even though nothing outside jaspSyntax calls them, because they are documented API:

  • clearQmlForms, clearNativeState, setParameter;
  • the dataset-state readers (loadAnalysisDataset, readLoadedDataset, readRequestedDataset, readDatasetHeader);
  • readAnalysisOptionsFromQml, readDefaultAnalysisOptions, nativeBridgeProvenance.

readModuleDescription stays exported because jaspTestModule's Tools/buildBundle.R calls it without the prefix.

Who calls them

I searched every local checkout (R, C++, QML, Markdown, YAML, shell; jaspTools, jaspBase, jasp-desktop, jasp-mcp, jasp-actions, jaspModuleTools and the modules), with and without the jaspSyntax:: prefix. The only external use is jasp-desktop's Tests/R/test_multidataset_rlogic.R, which goes through getNamespace("jaspSyntax")$... and keeps working.

Tests

  • tools::undoc, tools::codoc, tools::checkRd: clean.
  • Full suite with the released native library (v1.0.beta.8): 559 expectations. The 2 failures are the known test-dataset-info.R ones, which also fail on master with that library.

Version 1.4.6 (after #26 = 1.4.4 and #27 = 1.4.5; the version line may conflict trivially).

🤖 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>
- analysisOptionsFromJaspFile: the raw native reader behind
  readAnalysisOptionsFromJaspFile, which is the API.
- cleanUp: clearNativeState (with clearQmlForms and clearDatasetState) is the
  documented way to clear native state.
- columnEncoderContext, decodeColumnText, decodeColumnNames: the column decoding
  helpers the dataset readers use; decoding is the native table's job.
- analysisOptionsFromQml, an alias of readAnalysisOptionsFromQml, is removed.

None of them is called outside jaspSyntax (jaspTools, jaspBase, jasp-desktop,
jasp-mcp, jasp-actions, the modules): jasp-desktop's Tests/R script reaches them
through getNamespace(), which still works. The tests use jaspSyntax::: and the
contract test checks that they stay unexported. The documented lower-level API
(lifecycle controls, setParameter, dataset-state readers, nativeBridgeProvenance)
stays exported.

Version 1.4.6.

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