Skip to content

Create diagnostic.py#249

Open
Deepa-Tilwani wants to merge 2 commits intomainfrom
230-add-diagnostic-functions-showing-the-psd-and-the-topomap-for-the-cleaned-recordings
Open

Create diagnostic.py#249
Deepa-Tilwani wants to merge 2 commits intomainfrom
230-add-diagnostic-functions-showing-the-psd-and-the-topomap-for-the-cleaned-recordings

Conversation

@Deepa-Tilwani
Copy link
Copy Markdown
Collaborator

Adding Functions to create diagnostic figures showing bandpower topomaps and PSD plots before and after cleaning, highlighting dropped and fixed channels

Adding  Functions to create diagnostic figures showing bandpower topomaps and PSD plots
before and after cleaning, highlighting dropped and fixed channels
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.50%. Comparing base (d835e40) to head (40d297e).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #249      +/-   ##
==========================================
+ Coverage   83.64%   84.50%   +0.86%     
==========================================
  Files          26       26              
  Lines        1700     1717      +17     
==========================================
+ Hits         1422     1451      +29     
+ Misses        278      266      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@christian-oreilly
Copy link
Copy Markdown
Member

Thanks, @Deepa-Tilwani

Can you push a commit that makes your patch "Black/Ruff-compliant"? You can always test your code locally using ruff check [path to the root of the repo] after installing ruff and before pushing the code.

Error log from Continuous Integration:

pylossless/diagnostic.py:2:1: D205 1 blank line required between summary line and description
pylossless/diagnostic.py:38:89: E501 Line too long (132 > 88 characters)
pylossless/diagnostic.py:115:89: E501 Line too long (99 > 88 characters)
pylossless/diagnostic.py:116:89: E501 Line too long (98 > 88 characters)
pylossless/diagnostic.py:126:89: E501 Line too long (112 > 88 characters)
pylossless/diagnostic.py:128:89: E501 Line too long (123 > 88 characters)
pylossless/diagnostic.py:129:89: E501 Line too long (122 > 88 characters)
pylossless/diagnostic.py:142:89: E501 Line too long (92 > 88 characters)
pylossless/diagnostic.py:148:89: E501 Line too long (90 > 88 characters)
pylossless/diagnostic.py:197:89: E501 Line too long (117 > 88 characters)
pylossless/diagnostic.py:198:89: E501 Line too long (107 > 88 characters)
pylossless/diagnostic.py:203:89: E501 Line too long (117 > 88 characters)
pylossless/diagnostic.py:204:89: E501 Line too long (131 > 88 characters)
pylossless/diagnostic.py:208:89: E501 Line too long (119 > 88 characters)
pylossless/diagnostic.py:212:89: E501 Line too long (90 > 88 characters)
pylossless/diagnostic.py:214:89: E501 Line too long (89 > 88 characters)
pylossless/diagnostic.py:215:89: E501 Line too long (99 > 88 characters)
pylossless/diagnostic.py:222:89: E501 Line too long (160 > 88 characters)
pylossless/diagnostic.py:229:89: E501 Line too long (133 > 88 characters)
pylossless/diagnostic.py:238:89: E501 Line too long (143 > 88 characters)
pylossless/diagnostic.py:243:89: E501 Line too long (174 > 88 characters)
pylossless/diagnostic.py:244:89: E501 Line too long (133 > 88 characters)
pylossless/diagnostic.py:258:89: E501 Line too long (94 > 88 characters)
pylossless/diagnostic.py:261:89: E501 Line too long (176 > 88 characters)
pylossless/diagnostic.py:263:89: E501 Line too long (126 > 88 characters)

Style: format diagnostic.py (fix docstrings, wrap long lines), resolving ruff errors
Comment on lines +352 to +359
def process_subject_from_paths(
vhdr_path: Path,
root_clean_dir: Path,
root_pylossless_dir: Path,
out_dir: Path,
montage_path: Optional[Path] = None,
overwrite: bool = False,
):
Copy link
Copy Markdown
Member

@scott-huberty scott-huberty Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: vhdr_path, In theory users can save pylossless output EEG data in EDF or FIF format, not just. Brainvision. can we support those too?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code should probably be refactored to be more object oriented. I wonder if there is a convenient way to have diagnostic functions being methods of the pipeline object. However, to avoid growing to much the pipeline class, maybe the pipeline class should have methods that call such external functions. Regardless, I suspect that any function here should be agnostic to the file format. I don't see any reason why it should be tied to specific file format... it should be abstracted.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, to avoid growing to much the pipeline class, maybe the pipeline class should have methods that call such external functions

Agreed, this is generally my preferred approach!

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.

Add diagnostic functions showing the PSD and the topomap for the cleaned recordings

4 participants