mne-tools / mne-bids

MNE-BIDS is a Python package that allows you to read and write BIDS-compatible datasets with the help of MNE-Python.
https://mne.tools/mne-bids/
BSD 3-Clause "New" or "Revised" License
131 stars 85 forks source link

How to silence warnings in mne_bids.write_raw_bids() #1208

Open DominiqueMakowski opened 9 months ago

DominiqueMakowski commented 9 months ago

Describe the problem

mne_bids.write_raw_bids() throws several warnings at each iterations that doesn't seem to be silencable using verbose=0 or verbose=False

image

Some of them also seem unnecessary (?), like RuntimeWarning: Converting data files to BrainVision format

Describe your solution

Either throw warnings once a session (pandas style)?

Describe possible alternatives

Perhaps convert some warnings into messages (e.g., the one about events id, about floats etc)

Additional context

No response

welcome[bot] commented 9 months ago

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

sappelhoff commented 9 months ago

Thanks for the report!

I think we should allow controlling these messages via the verbose parameter:

image

... see: mne.verbose()

And we need to add a verbose parameter to write_raw_brainvision in pybv: https://pybv.readthedocs.io/en/stable/generated/pybv.write_brainvision.html#pybv.write_brainvision

sappelhoff commented 9 months ago