Repository navigation
Description
I often have people come to me locally with bugs, only to find that they are on some old version of MNE-Python. I think it's not generally known to neuroscience people that upgrading is important for bug fixes etc., so it would be good to make it clear what the software support policy is and that upgrading is important.
We should document this clearly as much as possible, but I have two other ideas that will actively "pop up" / ping users more actively:
-
Add a date-based warning on import. For example, if we release 1.6 on Nov 1 2023, add to
mne/__init__.pycode to emit a warning on Nov 1 2024 that a new version of MNE is available and that they should update to avoid bugs (or some similar explicit message). We don't absolutely know or guarantee our release cadence, but the longest we have gone between releases in the last few years is probably like ~8 mo, and I think we now shoot for ~4 mo -- so to be safe if can make it year from when we cut a release. This could be controllable with aMNE_CHECK_VERSION_DATEenv var or something in case people have wacky datetime settings. -
Query the current release version over the internet when
mne.sys_infois called with a new kwargcheck_version=True. We don't want our software to start trying to "phone home" without a user asking in some way (i.e., definitely not at import time). Then the question becomes what should the default value ofcheck_versioninmne.sys_info(..., check_version=...)be:False: least invasive but also least informative for users. In our bug report forms and forum stuff we ask people to callmne sys_info --check-versionormne.sys_info(check_version=True)or so. But the probability of users seeing an informative warning goes down.True: most invasive but also most informative for users.None: in between if we make it mean "try to check and if it takes more than 2 sec don't bother" or something. (FWIW,mne sys_infoon my machine currently takes ~3.7s.)
Whichever way we go, the default behavior for
Nonecould be controllable withMNE_SYS_INFO_CHECK_VERSIONvar in case people want the defaultNonebehavior to meanFalseorTrue.
Happy to hear thoughts on these and other ideas for suggesting people update to supported versions.
Activity
mscheltienne commentedon Oct 24, 2023
+1, I often have people come to me with bugs already fixed.
drammock commentedon Oct 24, 2023
I'd guess that the calendar-based approach would probably do a better job of preventing the situation you describe @larsoner, as it seems more likely to get people to proactively stay up to date. But it's also more invasive so I'm a bit wary of annoying people --- one of my pet peeves with R is the ~7 lines of output it spits on your console every time you fire it up; to do this well we'd probably need at least 3 lines: the warning, guidance on how to update (even if just a URL), and guidance on how to silence the version check.
if we take the sys_info approach, I'm also happy because it's more accurate, and easy to do:
larsoner commentedon Oct 24, 2023
I think both of these are pretty easily doable. For the first we should point to our updating page URL, and for the second we can add a config/env var.
cbrnr commentedon Oct 25, 2023
I'm 👎 on the import warning, because this impacts reproducibility if a perfectly fine script suddenly starts to emit warnings in the future. The chance of annoying people is also pretty high IMO, so controlling that with an env var is not a good solution either.
I like the
mne.sys_info()approach though, but if we go forcheck_version=Trueby default, we should really introduce something like a deprecation cycle, otherwise people might run into the same reproducibility issues when they usemne.sys_info()in their scripts.britta-wstnr commentedon Oct 25, 2023
I agree with @cbrnr that this impacts reproducibility. Especially for users who do not want to update MNE within a project (e.g. because they cannot easily re-run all analyses with the new version due to their computational resources).
It seems to me as this is mostly useful if a user runs into a bug - so maybe it's really about education i.e. documentation? It seems like an easy first step could be to update our BUG template on GitHub to prominently tell the user to check behavior with the latest version.
drammock commentedon Oct 25, 2023
sure, easily doable. I was just making the point that for folks (like me) who are annoyed by a bunch of extra terminal output, it will be for us at least 3 lines.
I'm not sure this point about the deprecation cycle makes sense; if we start with
check_version=Nonethen all users will see a warning when they runsys_infounless/until they update their script to saycheck_version=False. On the other hand, if we start out withcheck_version=Truethen only users on old versions will see a warning, and even then only once 1.6 (current dev) becomes "old".larsoner commentedon Oct 25, 2023
That's part of it. But also our code will always have some fraction of hidden silent bugs, so people hit these unknowingly. So the warning will also help people who hit those and don't know it. Someone can think their script is perfectly fine, and while their code could be, our software could have some bug that they never know is fixed, so they don't bother to update and live with some errant behavior unknowingly.
But it sounds like others think the cost (e.g., having to set an env var to avoid a warning) isn't worth the potential benefits here so I'll drop (1).
Sounds like people are generally in favor of some form of (2) so I'll probably give that one a shot for 1.6.
drammock commentedon Oct 25, 2023
API idea:
maybe with
Truebeing an alias for "info"? Add'l output might be something likehoechenberger commentedon Oct 25, 2023
Yes but let's be honest, we're constantly breaking user code and the short deprecation cycles we currently have are more an alibi to soothe ourselves (the devs) than really helping users actively using our software. The cycles are waaaay too short, for example in a "production" environment it's not unusual to skip one or maybe even two or three versions before updating again, and then your scripts are already non-functional because you missed the deprecation warnings.
hoechenberger commentedon Oct 25, 2023
We could fully embrace SemVer and bump the major version every time the API has breaking changes.
scott-huberty commentedon Oct 25, 2023
Just wanted to chime in that as a user I've experienced this. For example in plot_topomap the
show_namesparameter was deprecated in1.2and switched toin favour ofnames, and dropped in1.3. IIRC the deprecation cycle was like 2 months so I think I just missed it entirely and only noticed when my code for a project broke after updating. It was a super easy fix (for me) but I remember having to check the doc across versions to figure out what happened.But maybe that's a digression from this ticket. Anyways I think that as a user, some mechanism in
sys_infothat communicates that my version is outdated would probably come in handy.cbrnr commentedon Oct 25, 2023
I like the idea to include a message in the output of
mne.sys_info(), no warnings or depreciations necessary.hoechenberger commentedon Oct 25, 2023
I also like the idea of adding that information to sys_info(). But simply as an info and not immediately as a nudge to upgrade 😃
larsoner commentedon Oct 26, 2023
PR opened in #12146, feedback welcome
cbrnr commentedon Nov 2, 2023
@drammock there are two ways you can suppress this message:
Start R with the
-qflag.Unfortunately, RStudio ignores all startup flags. Therefore, the first option doesn't work, but you can work around this problem by creating
~/.Rprofilewith the following content: