Skip to content

Parameter validation seems broken? #123

@richrobe

Description

@richrobe

The parameters of a class should have the same name as the arguments passed to the __init__. tpcp should show a descriptive error when this happens. However, this is not the case.

Example:

class Preprocessing(Algorithm):

    _action_methods = ["clean"]

    preprocessing_method: Parameter[str]

    icg_clean_: pd.DataFrame

    def __init__(self, method: str = "butterworth"):
        if method not in ["butterworth", "elliptic", "savgol"]:
            raise ValueError("Filter type can only be 'butterworth', 'elliptic', or 'savgol'")
        self.preprocessing_method = method

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions