implemented async EEG pipeline manager#93
Open
AgastyaRai wants to merge 2 commits intomainfrom
Open
Conversation
|
❌ PR approval conditions NOT satisfied. At least 1 team lead OR 2 team members must approve before merging. |
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.
Async Pipeline Manager Pull Request
What?
Added an async pipeline manager in
moss/manager.py, so pipeline execution is now driven by function pointers instead of a bunch of conditionals.The manager now takes pipeline configs in the form:
and runs the nodes in sequence.
It currently supports:
bandpass filtermlIt also returns both required outputs:
Also fixed an important issue where
FUNCTION_MAPhad originally been defined before the functions it referenced.How?
Added a central
FUNCTION_MAPso node names map directly to wrapper functions, instead of being handled through inline conditional execution logic.Made the full pipeline async by turning the wrappers and
run_pipeline(...)into async functions, and wrapping the underlying blocking preprocessing / encoding / classifier calls withawait asyncio.to_thread(...).The
bandpass filternode now actually uses the config to control preprocessing, dispatching to the existing FIR or IIR bandpass helpers before running the existingfrom_array(...)resampling / segmentation path.The
mlnode now uses the real downstream ML path throughNeuroLMEncoder.encode(...),load_classifier(...),predict(...), andpredict_majority(...).run_pipeline(...)now tracks and returns both outputs explicitly:processed_eegclassifier_outputAlso added validation / error messages for invalid pipeline structure, unknown node types, invalid config types, invalid EEG input shape/type, and ML nodes receiving non-segment input.
Testing
Ran an end-to-end pipeline using real CSV-derived EEG input with:
Verified:
processed_eegandclassifier_outputokclassifier_output = None"bandpass_filter"routes correctlyAlso ran a short repeated timing pass after the final wiring update.