Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRG: Deprecate silently adding a leading period to an extension in BIDSPath #1061

Merged
merged 4 commits into from Aug 31, 2022

Conversation

hoechenberger
Copy link
Member

@hoechenberger hoechenberger commented Aug 31, 2022

This works in main:

# %%
from mne_bids import BIDSPath

bp_1 = BIDSPath(extension='vhdr')
bp_2 = BIDSPath(extension='.vhdr')

assert bp_1 == bp_2

With this PR, it warns:

FutureWarning: extension should start with a period ".", but got: "vhdr". Prepending "." to form: ".vhdr". This will raise an exception starting with MNE-BIDS 0.12.

This is part of my journey to try and make MNE-BIDS less clever.

Merge checklist

Maintainer, please confirm the following before merging.
If applicable:

  • All comments are resolved
  • This is not your own PR
  • All CIs are happy
  • PR title starts with [MRG]
  • whats_new.rst is updated
  • New contributors have been added to CITATION.cff
  • PR description includes phrase "closes <#issue-number>"

@hoechenberger hoechenberger changed the title Deprecate silently adding a period to an extension in BIDSPath Deprecate silently adding a leading period to an extension in BIDSPath Aug 31, 2022
doc/whats_new.rst Outdated Show resolved Hide resolved
@adam2392
Copy link
Member

Yay for less magic :)

@codecov
Copy link

codecov bot commented Aug 31, 2022

Codecov Report

Merging #1061 (4241aa4) into main (388616f) will increase coverage by 1.25%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1061      +/-   ##
==========================================
+ Coverage   93.95%   95.20%   +1.25%     
==========================================
  Files          25       25              
  Lines        3836     3840       +4     
==========================================
+ Hits         3604     3656      +52     
+ Misses        232      184      -48     
Impacted Files Coverage Δ
mne_bids/path.py 97.58% <100.00%> (+0.01%) ⬆️
mne_bids/stats.py 92.85% <100.00%> (ø)
mne_bids/utils.py 95.74% <0.00%> (+0.53%) ⬆️
mne_bids/write.py 97.17% <0.00%> (+1.91%) ⬆️
mne_bids/dig.py 98.27% <0.00%> (+9.65%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@hoechenberger hoechenberger changed the title Deprecate silently adding a leading period to an extension in BIDSPath MRG: Deprecate silently adding a leading period to an extension in BIDSPath Aug 31, 2022
@sappelhoff
Copy link
Member

failures are due to recent changes in the NIRS validator: bids-standard/bids-validator#952

I don't know if for better or worse -- @rob-luke could you have a look, please?

@sappelhoff
Copy link
Member

sappelhoff commented Aug 31, 2022

it's funny how the windows job with the NIRS validator passes 🤯 ... ubuntu and macos don't

now I am re-running after a potential fix has been pushed upstream

EDIT: okay, not such a mystery after all ... in the windows log it says:

SKIPPED [1] mne_bids\tests\test_write.py:1722: requires Rob's NIRS branch of bids-validator

so apparently it doesn't properly detect that it DOES have rob's validator and skips the test. no need to fix IMHO because nirs will soon be merged (within the next 3 weeks probably)

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

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

thanks! Makes sense to me. Also BIDS says:

Note that the left-most period is included in the file extension.

https://bids-specification.readthedocs.io/en/latest/02-common-principles.html

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.

None yet

4 participants