Skip to content

Commit

Permalink
Merge pull request #62 from RNKuhns/increase_base_test_cov
Browse files Browse the repository at this point in the history
  • Loading branch information
RNKuhns committed Nov 29, 2022
2 parents c3f5443 + 263f53e commit d61ae40
Show file tree
Hide file tree
Showing 4 changed files with 943 additions and 104 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ test = [
"coverage",
"pytest-cov",
"safety",
"numpy",
"scipy",
]

[project.urls]
Expand Down
15 changes: 5 additions & 10 deletions skbase/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def get_test_params(cls, parameter_set="default"):
"""
# if non-default parameters are required, but none have been found, raise error
if hasattr(cls, "_required_parameters"):
required_parameters = getattr(cls, "required_parameters", [])
required_parameters = getattr(cls, "_required_parameters", [])
if len(required_parameters) > 0:
raise ValueError(
f"Estimator: {cls} requires "
Expand Down Expand Up @@ -466,13 +466,8 @@ def create_test_instance(cls, parameter_set="default"):
else:
params = cls.get_test_params()

if isinstance(params, list):
if isinstance(params[0], dict):
params = params[0]
else:
raise TypeError(
"get_test_params should either return a dict or list of dict."
)
if isinstance(params, list) and isinstance(params[0], dict):
params = params[0]
elif isinstance(params, dict):
pass
else:
Expand Down Expand Up @@ -853,6 +848,6 @@ def check_is_fitted(self):
"""
if not self.is_fitted:
raise NotFittedError(
f"This instance of {self.__class__.__name__} has not "
f"been fitted yet; please call `fit` first."
f"This instance of {self.__class__.__name__} has not been fitted yet. "
f"Please call `fit` first."
)

0 comments on commit d61ae40

Please sign in to comment.