Skip to content

Inconsistent sym type for PowerSeriesProfile #2071

@sebakahn

Description

@sebakahn

minor issue: Out of date docstring.

Description

The sym instantiation parameter of the PowerSeriesProfile is declared to be bool in the class docstring and while it is set to a str in the default values.

What should be the type for this is input?

Proposition

  1. Non API breaking: Add some type hint to the __init__ function to clarify the expected usage:
def __init__(self, params=None, modes=None, sym="auto", name=""):

can become

def __init__(self, params: Sequence | None, modes: Sequence | None, sym: bool | Literal["auto", "even"] = "auto", name: str)

And make type checking happy.

  1. API simplification (can break dependent use-cases): make the sym input a string input and type hint it as a literal: Literal["odd", "even", "auto"] = "auto"

and update the docstring accordingly 😃.

Happy to open a PR for if you are interested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions