Skip to content

Case insensitive control prefix - #9

Merged
mcnaughtonadm merged 6 commits into
mainfrom
case-insensitive-control-prefix
Oct 1, 2026
Merged

mcnaughtonadm merged 6 commits into
mainfrom
case-insensitive-control-prefix

Conversation

@mcnaughtonadm

@mcnaughtonadm mcnaughtonadm commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Makes --control-prefix case-insensitive and renames --nonstandard_dims to
--nonstandard-dims, so it matches every other option's hyphenated spelling.

Changes

  • Case-insensitive control detection. With --control-prefix control-,
    CONTROL-2 and Control-3 were treated as variable samples and reshuffled on
    every plate, with no warning. load_sample_ids now matches the prefix ignoring
    case. Sample IDs are not rewritten, so a fixed map must still name a control
    exactly as it appears in the sample file (A1:CONTROL-2). Updated the
    --control-prefix help text and README.
  • --nonstandard_dims → --nonstandard-dims. The only one of twelve options
    with an underscore. Renamed outright, no alias. Updated the README examples, the
    docstring and the tests. The Python parameter is still nonstandard_dims (PEP 8).
  • Also: added example_files/60_samples_w_controls_initial_pos_non_standard.csv,
    a 60-sample variant on a 10-column layout. Bumped to 0.2.1 and synced
    uv.lock.

⚠️ Breaking change

--nonstandard_dims no longer works. Scripts using it must switch to
--nonstandard-dims; click names the valid spelling in the error:

Error: No such option: --nonstandard_dims (Possible options: --nonstandard, --nonstandard-dims)

Testing

uv run pytest: 65 passed. New CLI tests cover a mixed-case control in a fixed map
and --nonstandard-dims 6,10 producing a 6×10 plate. ruff, mypy . and
prettier are clean.

60_samples_w_controls_initial_pos_non_standard.csv places its samples on a
10-column layout, pairing with the --nonstandard_dims=6,10 example in the
README.
A sample file naming controls as control-1, CONTROL-2 and Control-3
classified only the first as a control under --control-prefix control-, so the
other two were treated as variable samples and reshuffled on every plate.
Matching the prefix case-insensitively classifies all of them, and a fixed
map may then name a control in whatever case the file uses.

Sample IDs are not rewritten, so comparisons against control_samples
elsewhere still match verbatim.
The behaviour was previously only covered through the mapper interface,
because test_cli.py did not exist on this branch when the fix was written.
Also records the 0.2.0 version in uv.lock, which had not been updated when
the version was bumped.
--nonstandard_dims was the only option of twelve using an underscore. Add
--nonstandard-dims as the primary spelling and keep the underscore form as an
alias, so existing commands and the README examples keep working.
--nonstandard_dims was the only option of twelve using an underscore. Rename it
to --nonstandard-dims outright rather than keeping the old spelling as an alias,
so the interface carries one spelling. Click names the valid option when the old
form is used, and the project is pre-1.0 with a single author, so there is no
compatibility to preserve.

The Python parameter stays nonstandard_dims per PEP 8. The test now checks the
hyphenated flag alone instead of asserting both spellings agree.
@mcnaughtonadm
mcnaughtonadm merged commit c714c0f into main Oct 1, 2026
4 checks passed
@mcnaughtonadm
mcnaughtonadm deleted the case-insensitive-control-prefix branch October 1, 2026 23:54
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