Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNT] Code quality updates #5786

Merged
merged 3 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ repos:
name: isort

- repo: https://github.com/psf/black
rev: 23.12.0
rev: 23.12.1
hooks:
- id: black
language_version: python3

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
exclude: docs/conf.py
Expand Down
2 changes: 2 additions & 0 deletions examples/interpolation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
],
"source": [
"# randomly cut the data series in-place\n",
"\n",
"\n",
"def random_cut(df):\n",
" for row_i in range(df.shape[0]):\n",
" for dim_i in range(df.shape[1]):\n",
Expand Down
2 changes: 1 addition & 1 deletion sktime/classification/distance_based/_shape_dtw.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def _check_metric_params(self, parameters):
names = list(parameters.keys())

for x in names:
if not (x in valid_metric_params):
if x not in valid_metric_params:
raise ValueError(
x
+ " is not a valid metric parameter."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
ProximityForest,
ShapeDTW,
)
from sktime.classification.early_classification import (
TEASER,
ProbabilityThresholdEarlyClassifier,
)
from sktime.classification.early_classification import TEASER
from sktime.classification.feature_based import (
Catch22Classifier,
MatrixProfileClassifier,
Expand Down
2 changes: 1 addition & 1 deletion sktime/forecasting/base/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ def predict_residuals(self, y=None, X=None):

y_pred = self.predict(fh=fh, X=X)

if not type(y_pred) is type(y):
if type(y_pred) is not type(y):
y = convert_to(y, self._y_metadata["mtype"])

y_res = y - y_pred
Expand Down
1 change: 0 additions & 1 deletion sktime/forecasting/base/adapters/_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class BaseDeepNetworkPyTorch(BaseForecaster, ABC):
"y_inner_mtype": "pd.DataFrame",
"capability:insample": False,
"capability:pred_int:insample": False,
"python_dependencies": "torch",
"scitype:y": "both",
"ignores-exogeneous-X": True,
}
Expand Down
1 change: 0 additions & 1 deletion sktime/networks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class BaseDeepNetworkPyTorch(BaseForecaster, ABC):
"y_inner_mtype": "pd.DataFrame",
"capability:insample": False,
"capability:pred_int:insample": False,
"python_dependencies": "torch",
"scitype:y": "both",
"ignores-exogeneous-X": True,
}
Expand Down
2 changes: 1 addition & 1 deletion sktime/pipeline/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def _fetch_input_data(self, fit, required_method, mro, kwargs):
self.mode = result.mode
if result.result is not None:
all_none = False
if len(results) != 0 and not results[0] is None:
if len(results) != 0 and results[0] is not None:
if len(results) > 1:
input_data[step_name] = pd.concat(
results, axis=1, keys=transformer_names
Expand Down
2 changes: 1 addition & 1 deletion sktime/utils/_testing/scenarios_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def get_tag(obj, tag_name):
# applicable only if obj inherits from BaseClassifier, BaseEarlyClassifier or
# BaseRegressor. currently we test both classifiers and regressors using these
# scenarios
if not scitype(obj) in (
if scitype(obj) not in (
"classifier",
"early_classifier",
"regressor",
Expand Down
Loading