While working on #11473, it was not that straightforward to add support for Path in the I/O roundtrip for layouts because of the strange arguments from read_layout.
kind is supposed to be the name of the layout. According to the docstring, without the suffix.
path is supposed to be the folder in which the layout file is.
In reality, kind can be provided with or without suffix, and it can be the path to a layout file in which case the value provided in path is ignored.
|
layout_read = read_layout(op.join(tempdir, 'foobar.lout'), path='./', |
|
scale=False) |
I propose to add a new argument fname:
fname : path-like | str
Either the path to a .lout or .lay file or the name of a built-in layout.
c.f. Notes for a list of the available built-in layouts.
And make the list of built-in layouts include the suffix to reduce ambiguity.
And to deprecate both kind and path. It's definitely backward incompatible, but it would simplify this reader.
While working on #11473, it was not that straightforward to add support for
Pathin the I/O roundtrip for layouts because of the strange arguments fromread_layout.kindis supposed to be the name of the layout. According to the docstring, without the suffix.pathis supposed to be the folder in which the layout file is.In reality,
kindcan be provided with or without suffix, and it can be the path to a layout file in which case the value provided inpathis ignored.mne-python/mne/channels/tests/test_layout.py
Lines 60 to 61 in d740e47
I propose to add a new argument
fname:And make the list of built-in layouts include the suffix to reduce ambiguity.
And to deprecate both
kindandpath. It's definitely backward incompatible, but it would simplify this reader.