Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter validation seems broken? #123

Open
richrobe opened this issue Jan 8, 2025 · 0 comments
Open

Parameter validation seems broken? #123

richrobe opened this issue Jan 8, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@richrobe
Copy link
Member

richrobe commented Jan 8, 2025

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
@richrobe richrobe added the bug Something isn't working label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant