test: use synthetic data instead of downloading a real dataset in sampler tests (#545)#1035
Open
YihengLi-1 wants to merge 2 commits into
Open
test: use synthetic data instead of downloading a real dataset in sampler tests (#545)#1035YihengLi-1 wants to merge 2 commits into
YihengLi-1 wants to merge 2 commits into
Conversation
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.
Summary
Partially addresses #545. The sampler unit tests (
test/unit_tests/samplers/test_samplers.py) downloaded the realBNCI2014_001MOABB dataset (subject 4) in theirwindows_dsandtarget_windows_dsfixtures. These tests only depend on the dataset structure — the number of recordings, the number of windows, and thesubject/session/run/targetmetadata columns — not on real EEG signals, so the download is unnecessary.This replaces the two fixtures' data source with small synthetic data built from the existing
braindecode.util.create_mne_dummy_rawhelper (the util pointed to in the issue). The windowing calls and all test logic are left unchanged.Why this is safe
The synthetic data reproduces the structure the samplers rely on:
subject/session/run, soRecordingSamplergroups them into the expected number of recordings;tau_pos/tau_negrange used byRelativePositioningSampler;BalancedSequenceSamplerhas enough consecutive windows and at least two target classes (this covers then_windows=40parametrization).Result
mp.spawn/gloo distributed).moabb. For example,test_recording_samplerwent from ~11.5 s (real download) to ~3.0 s (synthetic; the remainder is just import overhead).Scope: only
test/unit_tests/samplers/test_samplers.py. The other files listed in #545 can follow in separate PRs.