Skip to content

Arguments of the layout reader #11483

Closed

Description

@mscheltienne

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.

Activity

  1. drammock commented on Feb 16, 2023

    @drammock
    Member

    I think it's useful to be able to just say 'standard-1020' or whatever so that users don't have to know where the MNE built-in layouts are stored. Is there a way to keep that but otherwise do as you suggest?

  2. mscheltienne commented on Feb 16, 2023

    @mscheltienne
    MemberAuthor

    And make the list of built-in layouts include the suffix to reduce ambiguity.

    This point can be omitted, in which case fname is either the path to a layout or the name of a layout.

  3. drammock commented on Feb 16, 2023

    @drammock
    Member

    SGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions