Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] authored Nov 14, 2023
1 parent a7a6278 commit 6031f9a
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/psf/black
rev: 22.8.0
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -15,6 +15,6 @@ repos:
- id: no-commit-to-branch
args: [--branch, master, --branch, develop]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.1.0
hooks:
- id: flake8
1 change: 0 additions & 1 deletion src/ml_tooling/plots/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ def _plot_barh(

if add_label:
for i, (x, y) in enumerate(_generate_text_labels(ax, horizontal=True)):

ax.annotate(
f"{values.ravel()[i]:.1%}"
if is_percent
Expand Down
1 change: 0 additions & 1 deletion src/ml_tooling/storage/artifactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def __init__(
apikey: Optional[str] = None,
auth: Optional[Tuple[str, str]] = None,
):

if not _has_artifactory:
raise MLToolingError(
"Artifactory not installed - run pip install dohq-artifactory"
Expand Down
2 changes: 1 addition & 1 deletion src/ml_tooling/transformers/feature_union.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, transformer_list: list):
self.transformer_list = transformer_list

def fit(self, X: pd.DataFrame, y=None):
for (name, t) in self.transformer_list:
for name, t in self.transformer_list:
t.fit(X, y)
return self

Expand Down
2 changes: 0 additions & 2 deletions src/ml_tooling/transformers/fillna.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def __init__(
}

def _validate_parameters(self):

if self.value is None and self.strategy is None:
raise TransformerError(
"Both value and strategy are set to None."
Expand All @@ -68,7 +67,6 @@ def _col_is_categorical_and_is_missing_category(
return False

def fit(self, X: pd.DataFrame, y=None):

self._validate_parameters()

if self.strategy:
Expand Down
4 changes: 0 additions & 4 deletions tests/test_baseclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ def test_to_dict_serializes_correctly_with_feature_union(
def test_from_yaml_serializes_correctly_with_feature_union(
self, feature_union_classifier: DFFeatureUnion, tmp_path: pathlib.Path
):

model = Model(feature_union_classifier)
result = model.to_dict()

Expand Down Expand Up @@ -677,7 +676,6 @@ def test_gridsearch_model_returns_as_expected(
def test_gridsearch_best_model_is_not_fitted_if_refit_is_not_true(
self, pipeline_logistic: Pipeline, train_iris_dataset: Dataset
):

model = Model(pipeline_logistic)
model, results = model.gridsearch(
train_iris_dataset,
Expand Down Expand Up @@ -771,7 +769,6 @@ def test_randomsearch_model_returns_as_expected(
def test_randomsearch_best_model_is_not_fitted_if_refit_is_not_true(
self, pipeline_logistic: Pipeline, train_iris_dataset: Dataset
):

model = Model(pipeline_logistic)
model, results = model.randomsearch(
train_iris_dataset,
Expand Down Expand Up @@ -890,7 +887,6 @@ def test_bayessearc_model_returns_as_expected(
def test_bayessearch_best_model_is_not_fitted_if_refit_is_not_true(
self, pipeline_logistic: Pipeline, train_iris_dataset: Dataset
):

model = Model(pipeline_logistic)
model, results = model.bayesiansearch(
train_iris_dataset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def test_target_correlation_uses_pipeline_when_passed(
def test_target_feature_distribution_works_as_expected(
self, australian_dataset: Dataset
):

ax = australian_dataset.plot.target_feature_distribution(feature_name="A4")

assert [text.get_text() for text in ax.texts] == ["0.28", "0.50", "1.00"]
Expand Down

0 comments on commit 6031f9a

Please sign in to comment.