Repository navigation
Review round 1: tests in R CMD check, API errors, safer rmGeoIdentity - #14
Merged
Merged
Conversation
…rmGeoIdentity - tests were excluded by .Rbuildignore; outdated tests replaced with design-quality tests for randomise() and tests for rmGeoIdentity() - API tests read CLIMMOB_KEY from the environment - request bodies built with jsonlite; clear errors on HTTP error status - rmGeoIdentity(): seed no longer printed, caller's RNG restored, sf called by namespace, documentation warns that a known seed reveals the original locations - R CMD check workflow, AGENTS.md, NEWS Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LpE9sTbGPftSMogW6KpkrT
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.
First review round of ClimMobTools, same process as gosset.
Tests never ran.
.Rbuildignoreexcluded^tests$, soR CMD checkskipped them, and they had gone stale:test-seed_need.Rtests a function that no longer exists, andtest-randomise.Rused the old argumentsnobservers/nitems. Now:randomise(): distinct items per package, equal item counts, balance across positions A/B/C, connected comparison network, availability limits, reproducibility withset.seed();rmGeoIdentity(): displacement withindist, NAs kept, no output, RNG untouched;CLIMMOB_KEY(skip_without_key()helper) instead of a key written in the test file. Add aCLIMMOB_KEYrepository secret to run them in CI.Code changes
getDataCM(),getProjectProgress(): request body built withjsonlite::toJSON()(the pasted string broke with quotes in project codes); clear error on HTTP 401/403/404/5xx instead of a JSON parse error.rmGeoIdentity(): no longer prints the seed. The displacement does not depend on the original coordinates, so with the seed anyone can reproduce the offsets and recover exact locations; the docs now say so and the examples no longer use a seed. A given seed no longer changes the caller's RNG.sfis called by namespace, so it no longer has to be attached.New
randomise()algorithm (Jacob van Etten)ridge,polish,schedule; old arguments such ascompare ignored with a warning. Designs differ from earlier versions for the same seed.lpSolve,Matrix,RSpectraandmethodsare removed from Imports (now httr, jsonlite, stats, utils).ncomp = 2, ignored arguments. The old diagnostic script (needs gosset) moved fromtests/todev/.Infrastructure: R CMD check workflow (Linux, macOS, Windows) with failures shown as annotations;
AGENTS.md; NEWS.Not changed, for discussion
getDataCM()andgetSurvey(), the Overview vignette and the pkgdown site. If it is a public demo key that is fine; if not, it should be revoked on the server, since it is in the git history.Body={}&Apikey={}and httr appends the realBodyandApikey, so each parameter is sent twice. It works if the server reads the last value; worth cleaning with a server-side check.rankTricot()duplicatesgosset::rank_tricot(); fixes now land in gosset only.rmGeoIdentity()samples uniformly in the buffer, so a point can land very close to the original. Displacement with a minimum distance (as in DHS) would be stronger.https://claude.ai/code/session_01LpE9sTbGPftSMogW6KpkrT
Generated by Claude Code