Skip to content

Commit

Permalink
Fix docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
fraimondo committed Apr 29, 2024
1 parent 57b4d1e commit 2a6cb43
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions julearn/pipeline/tests/test_pipeline_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,6 @@ def test_hyperparameter_tuning(
search_params : dict of str and list
The parameters for the search.
Raises
------
ValueError
If the kind is not supported.
"""

Expand Down Expand Up @@ -249,7 +245,7 @@ def test_hyperparameter_tuning_bayes(
The parameters for the search.
"""
BayesSearchCV = pytest.importorskip('skopt.BayesSearchCV')
BayesSearchCV = pytest.importorskip("skopt.BayesSearchCV")

pipeline, param_grid = _hyperparam_tuning_base_test(
X_types_iris,
Expand Down Expand Up @@ -336,8 +332,10 @@ def test_hyperparameter_tuning_distributions(
)

assert isinstance(pipeline, RandomizedSearchCV)
_compare_param_grids(pipeline.param_distributions, # type: ignore
param_grid)
_compare_param_grids(
pipeline.param_distributions, # type: ignore
param_grid,
)


def test_hyperparameter_tuning_distributions_bayes(
Expand Down Expand Up @@ -366,7 +364,7 @@ def test_hyperparameter_tuning_distributions_bayes(
The parameters for the search.
"""
BayesSearchCV = pytest.importorskip('skopt.BayesSearchCV')
BayesSearchCV = pytest.importorskip("skopt.BayesSearchCV")

pipeline, param_grid = _hyperparam_tuning_base_test(
X_types_iris,
Expand Down Expand Up @@ -512,7 +510,8 @@ def test_added_model_target_transform() -> None:


def test_stacking(
X_iris: pd.DataFrame, y_iris: pd.Series # noqa: N803
X_iris: pd.DataFrame,

Check failure on line 513 in julearn/pipeline/tests/test_pipeline_creator.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (N803)

julearn/pipeline/tests/test_pipeline_creator.py:513:5: N803 Argument name `X_iris` should be lowercase

Check failure on line 513 in julearn/pipeline/tests/test_pipeline_creator.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (N803)

julearn/pipeline/tests/test_pipeline_creator.py:513:5: N803 Argument name `X_iris` should be lowercase
y_iris: pd.Series, # noqa: N803

Check failure on line 514 in julearn/pipeline/tests/test_pipeline_creator.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (RUF100)

julearn/pipeline/tests/test_pipeline_creator.py:514:25: RUF100 Unused `noqa` directive (unused: `N803`)

Check failure on line 514 in julearn/pipeline/tests/test_pipeline_creator.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (RUF100)

julearn/pipeline/tests/test_pipeline_creator.py:514:25: RUF100 Unused `noqa` directive (unused: `N803`)
) -> None:
"""Test that the stacking model works correctly."""
# Define our feature types
Expand Down Expand Up @@ -793,16 +792,21 @@ def test_PipelineCreator_set_hyperparameter() -> None:
assert model1.steps[-1][1].get_params()["strategy"] == "uniform"

creator2 = PipelineCreator(problem_type="classification", apply_to="*")
creator2.add(DummyClassifier(strategy="uniform"), # type: ignore
name="dummy")
creator2.add(
DummyClassifier(strategy="uniform"), # type: ignore
name="dummy",
)

model2 = creator2.to_pipeline()

assert model2.steps[-1][1].get_params()["strategy"] == "uniform"

creator3 = PipelineCreator(problem_type="classification", apply_to="*")
creator3.add(DummyClassifier(), # type: ignore
strategy="uniform", name="dummy")
creator3.add(
DummyClassifier(), # type: ignore
strategy="uniform",
name="dummy",
)

model3 = creator3.to_pipeline()

Expand Down

0 comments on commit 2a6cb43

Please sign in to comment.