Skip to content

Arguments of the layout reader #11483

@mscheltienne

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.

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