Repository navigation
AGGREGATE: a period after a function name counts user-missing values; every function against R - #454
Merged
Merged
Conversation
… every function against R
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.
The guide lets a period after a function name count user-missing values as valid (SUM.(x), PGT.(x, 30), FIRST.(x), N.(x), NMISS.(x)); Statscraft refused every such call as an unexpected character, because a name cannot end in a period. Found by an R audit of every AGGREGATE function. Fixed in AGGREGATE only: the lexer keeps the period with the name of an aggregate function when ( or a slash follows (a period that ends the line still ends the command, in AGGREGATE and everywhere else; a period in another command or after a variable is still an error), the parser records include_missing, the engine counts user-missing values as valid for that aggregation (N.(x) valid or user-missing, NMISS.(x) system-missing only, FIRST. and LAST. may take a user-missing value, whose status the target keeps). Help text, generated docs and CHANGELOG updated.
Tests: every function of the guide against R on 48 invented cases in six groups (one all missing, one a single case, the code -9 user-missing), in six runs: as is, weighted, with the period, weighted with the period, MISSING=COLUMNWISE, weighted columnwise with the period; bounds written the wrong way round and equal bounds; strings in character order; wrong-way and period parser tests. Everything else agrees with R; a count function of a group with no valid case is 0 (kept). Whole engine and syntax suites, clippy, overlap check pass. Review: medium (the low level skips test files), three rounds on the worktree; round one: the lexer change applied to every command (now AGGREGATE only, and only after a function name), whitespace forms, a docs line break; rounds two and three: nits (blank before the parenthesis allowed, NUMISS and picked values documented).