Skip to content

added tests trasnforms and scripts for v2 and added event.copy() at tranforms v2 EnglishBCBLPreprocessing._run mutates events #12

Open
Karan24Soni wants to merge 1 commit into
facebookresearch:mainfrom
Karan24Soni:main
Open

added tests trasnforms and scripts for v2 and added event.copy() at tranforms v2 EnglishBCBLPreprocessing._run mutates events #12
Karan24Soni wants to merge 1 commit into
facebookresearch:mainfrom
Karan24Soni:main

Conversation

@Karan24Soni

Copy link
Copy Markdown

Summary

v2 is missing test coverage that v1 already has. v1 has tests for transforms,
scripts, model and pl_module. v2 only had model and losses tests, nothing for
transforms.py or scripts/extract_predictions.py, even though those are the
most likely place for silent breakage (pandas event preprocessing, the
splitter, the CLI metrics script).

Added tests/test_v2_transforms.py covering EnglishBCBLPreprocessing,
Brain2QwertyV2Splitter, WordCreator and SentenceKeySeq - practice trial
removal, space -> "&" normalization, dropping / tokens and
any out-of-vocab key, perception trials and too-sparse sentences getting
dropped, button_UID ordering, and split determinism / no leakage across a
sentence's rows.

Added tests/test_v2_scripts.py covering extract_predictions.py
(compute_cer, compute_wer, summarize, print_summary, main) including the
CSV path resolution and the --output summary file.

Also fixed a SettingWithCopyWarning in EnglishBCBLPreprocessing._run -
events wasn't copied after the first filter, unlike the rest of the
pipeline. Doesn't change any computed values, just stops the warning.

Test plan

  • pytest passes locally
  • ruff check and ruff format --check pass

Checklist

@meta-cla meta-cla Bot added the cla signed label Jun 30, 2026
@Karan24Soni

Copy link
Copy Markdown
Author

@jarod1212 could you check this out if possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant