Repository navigation
CLI: file argument, column options and wide input - #47
Merged
Merged
Conversation
…e tables Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…olumns Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 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.
Closes #40. Part of #38.
What this does
The CLI no longer needs the IR column names, and reads wide data and files:
rthsd scores.csv; stdin when it is missing or-.--block,--treatment,--value. A role you leave out takes the column calledtopic,systemorscore; if that still leaves a role open and the file has exactly three columns, the unused ones are taken in the order block, treatment, value. Sodataset,model,accuracyworks with no options at all, and the old files work unchanged.--format wide(defaulttidy). One row per block, one column per treatment, the header naming them;--block NAMEnames a column (an id) to leave out.--treatmentand--valuewith--format wideare an error.In the library (unexported, like the others from #37):
tidy_columns(names, block, treatment, value)decides the columns andwide_scores(names, columns)builds the matrix from a wide table. Both are unit-tested; the CLI stays glue.Decisions
--formatinstead of detection. A wide file and a tidy file can both have three columns, so guessing would be wrong sometimes.cannot tell which columns hold the block, treatment; columns are ...; name them with --block, --treatment and --value).--block's is a treatment. A non-numeric one is an error that names it.Verification
tidy_columns(the IR names, any order, extra columns, explicit names, three columns with other names, partial requests, three errors) andwide_scores(order,missingtoNaN, three errors).--seed 1and 500 trials ontiny.csv: the same output, byte for byte, from the original tidy file, a file with other column names (dataset,model,accuracy), a four-column file with explicit options, a file argument,-for stdin, a wide file with an id column and a wide file without one. The seven-input comparison from Move the CLI's input handling into the library #37 (NaN, absent row, empty cell, duplicate row, numeric names, large file;--missing erroranddrop) is unchanged apart from the known duplicate message.--format, tidy-only options with--format wide, a wide empty cell with--missing error(stops) anddrop(continues).Not done
🤖 Generated with Claude Code