-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add config option to disable HTML repr #11159
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we test this so the new lines are covered? 🙏 @cbrnr
Sure, I'll add a test. Does anyone have an answer to my second question? Basically, I'm looking for something like |
@@ -44,6 +44,7 @@ Enhancements | |||
- Add example of how to obtain time-frequency decomposition using narrow bandpass Hilbert transforms to :ref:`ex-tfr-comparison` (:gh:`11116` by `Alex Rockhill`_) | |||
- Add ``==`` and ``!=`` comparison between `mne.Projection` objects (:gh:`11147` by `Mathieu Scheltienne`_) | |||
- Add ``encoding`` parameter to :func:`mne.io.read_raw_edf` and :func:`mne.io.read_raw_bdf` to support custom (non-UTF8) annotation channel encodings (:gh:`11154` by `Clemens Brunner`_) | |||
- Add config option ``MNE_REPR_HTML`` to disable HTML repr in notebook environments (:gh:`11159` by `Clemens Brunner`_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the doc and thinking where this information could be added I found
https://mne.tools/stable/auto_tutorials/intro/50_configure_mne.html
and this tells me that maybe using mne config mechanism would be the expect thing to do...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand. Do you want to describe the new config option in the docs? We haven't done this for the other existing options though.
what other options do you have in mind?
… Message ID: ***@***.***>
|
If we haven't described our config options so far, I think we should describe all of them. But maybe @drammock knows if there's already some documentation. |
The current way to get this behavior is just to set |
... and I don't think there is a single place where we describe all options. Instead we try to describe each option around where it's used, e.g., the 3D options should be described in |
OK, that's what I did in the test. Re describing config options, I'm fine with descriptions in different places, but maybe an overview of all possible values would be nice. Maybe even built into |
|
That's probably good enough for now. WDYT @agramfort? |
If we wanted a more thorough documentation of what they all do, a nice way to do it would be for |
I could do that? In this PR? |
go for it. $ git grep "get_config('')"
mne/utils/tests/test_config.py:24: assert (len(get_config('')) > 10) # tuple of valid keys
tutorials/intro/50_configure_mne.py:84:assert 'MNEE_USE_CUUDAA' not in mne.get_config('') |
oh, rereading, maybe you weren't volunteering :) and even if you were, it should probably be a separate PR. |
That's OK, I'll do it in a separate PR. So I guess this one is ready? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one tiny suggestion. Thanks @cbrnr
a6f24cb
to
4810ac5
Compare
All green – @agramfort please feel free to merge if all of your comments have been addressed! |
thanks @cbrnr can you open issues for the next PRs to complete to follow up? 🙏 |
Fixes #9830.
Open questions:
I added four lines of code at the beginning ofI refactored this into a decorator, I think this is cleaner even for the few classes we have._repr_html_()
of each class that defines this method. We could outsource this (in a decorator?), but it's probably overkill right now.set_config()
doesn't seem to support it, but maybe I missed a context manager or something similar?