Skip to content

[BUG] GreedyEncoder.get_test_params should be a classmethod (skbase contract) #568

@siddharth7113

Description

@siddharth7113

Describe the bug
GreedyEncoder.get_test_params is defined as a regular instance method, but its parent class (BaseTransform, which inherits from skbase.base.BaseEstimator ) defines it as a classmethod. This means class-level calls ,which the test framework relies on, raise a TypeError for GreedyEncoder.

To Reproduce

from pyaptamer.trafos.base import BaseTransform
from pyaptamer.trafos.encode import GreedyEncoder

BaseTransform.get_test_params() # works, returns {}
GreedyEncoder.get_test_params() # TypeError: missing 1 required positional argument: 'self'

The class-level call works for every other transformer that inherits the parent's classmethod, but breaks specifically for GreedyEncoder because it overrides the method without @classmethod.

Expected behavior
GreedyEncoder.get_test_params() should be callable on the class itself (without instantiating first) and return the list of parameter dicts. This matches skbase convention.

Both parameter sets returned should also be valid for instantiation:

params = GreedyEncoder.get_test_params()
for p in params:
    GreedyEncoder(**p)              # should not raise

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeasyeasy issues are which doesn't require multiple file changes and with smaller diff.good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions