Skip to content

Commit

Permalink
Use isinstance instead of obj.__bases__
Browse files Browse the repository at this point in the history
This is a small change but will enable much easier extending of
auto-sklearn algorithms, since without this change, all classes
are expected to directly inherit from AutoSklearn base calsses,
and do not allow additional layers of inheritance.
  • Loading branch information
AmirAlavi committed Aug 29, 2023
1 parent 6732112 commit c97ead6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autosklearn/pipeline/components/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, base_class):
self.components = OrderedDict()

def add_component(self, obj):
if inspect.isclass(obj) and self.base_class in obj.__bases__:
if inspect.isclass(obj) and isinstance(obj, self.base_class):
name = obj.__name__
classifier = obj
else:
Expand Down

0 comments on commit c97ead6

Please sign in to comment.