You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Arbitrary default value of origin in mne.make_field_map #13390
When creating a field map via mne.make_field_map (e.g. for evoked.plot_field() plots), it feels arbitrary that the default value of the "origin" parameter is (0.0, 0.0, 0.04), and it can result in inaccurate field maps.
Is there a reason why it is not set to "auto" or at least made a necessary input? The internal method _make_surface_mapping() in mne/forward/_field_interpolation.py has the same default value, but its documentation states that "auto" is the default value. So maybe it was supposed to be "auto" all along?
I think it's just for historical reasons. I agree "auto" is a better default here. +1 for changing it via deprecation. @Mettphysik are you up for a PR to fix it? The process would be:
Change the default to None
In code if it's None, emit a warning that it will be (0, 0, 0.04) in 1.11 but change to "auto" in 1.12 so set it explicitly to avoid the warning
And then once we're in the 1.12 development cycle we actually change the default to "auto"
Yes in theory! But in practice we take care of all deprecations in one big PR post-release, so doing the PR now to make the change for 1.11 will be good enough
@larsoner Going over the whole file I just realized there is a remark here which complicates things. I guess if I want to address this it would mean to add origin to "_as_meg_type_inst" as a new parameter and then to go over all usages of it to add origin as input, ultimately resulting in adding origin to the as_type methods of Epochs and Evoked and changing the documentation. Otherwise we would end up with"auto" as default in one place and (0, 0, 0.04) in another.
Again, I can try it, but since its the first time I contribute I will probably have some questions in the process.
I guess if I want to address this it would mean to add origin to "_as_meg_type_inst" as a new parameter and then to go over all usages of it to add origin as input, ultimately resulting in adding origin to the as_type methods of Epochs and Evoked and changing the documentation. Otherwise we would end up with"auto" as default in one place and (0, 0, 0.04) in another.
Well we are sort of in that situation already. Let's start small and incremental with a PR that just changes make_field_map properly. Once that's ready to merge, if you are motivated to keep going, you can figure out what other public functions would need the change and we can decide if it makes sense (it probably does!). That can be part of the same PR or a new one. But starting with changing just the one function we'll see what tests, examples, tutorials, etc. will need to be adjusted which will give a useful perspective.
Activity
welcome commentedon Aug 21, 2025
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴
larsoner commentedon Aug 21, 2025
I think it's just for historical reasons. I agree
"auto"is a better default here. +1 for changing it via deprecation. @Mettphysik are you up for a PR to fix it? The process would be:NoneNone, emit a warning that it will be(0, 0, 0.04)in 1.11 but change to"auto"in 1.12 so set it explicitly to avoid the warningAnd then once we're in the 1.12 development cycle we actually change the default to
"auto"Mettphysik commentedon Aug 21, 2025
Yes I can give it a try. Just for my understanding, after changing it to None for 1.11, should I then make another PR for 1.12?
larsoner commentedon Aug 21, 2025
Yes in theory! But in practice we take care of all deprecations in one big PR post-release, so doing the PR now to make the change for 1.11 will be good enough
Mettphysik commentedon Aug 23, 2025
@larsoner Going over the whole file I just realized there is a remark here which complicates things. I guess if I want to address this it would mean to add origin to "_as_meg_type_inst" as a new parameter and then to go over all usages of it to add origin as input, ultimately resulting in adding origin to the as_type methods of Epochs and Evoked and changing the documentation. Otherwise we would end up with"auto" as default in one place and (0, 0, 0.04) in another.
Again, I can try it, but since its the first time I contribute I will probably have some questions in the process.
larsoner commentedon Aug 23, 2025
Well we are sort of in that situation already. Let's start small and incremental with a PR that just changes
make_field_mapproperly. Once that's ready to merge, if you are motivated to keep going, you can figure out what other public functions would need the change and we can decide if it makes sense (it probably does!). That can be part of the same PR or a new one. But starting with changing just the one function we'll see what tests, examples, tutorials, etc. will need to be adjusted which will give a useful perspective.