Skip to content

Commit

Permalink
[MNT] Fixes linting issues in base, networks, registry modules (#…
Browse files Browse the repository at this point in the history
…4310)

Towards #4182 

Fixes linting issues in `base`, `networks`, and `registry` modules:

- Fix `B028 No explicit stacklevel keyword argument found`
  • Loading branch information
SamiAlavi committed Mar 12, 2023
1 parent 1f544b0 commit 66c437a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sktime/base/_base.py
Expand Up @@ -840,7 +840,7 @@ def _deprecate_tag_warn(cls, tags):
)
else:
msg += ', please remove code that access or sets "{tag_name}"'
warnings.warn(msg, category=DeprecationWarning)
warnings.warn(msg, category=DeprecationWarning, stacklevel=2)


class BaseEstimator(BaseObject):
Expand Down
6 changes: 4 additions & 2 deletions sktime/networks/lstmfcn_layers.py
Expand Up @@ -642,7 +642,8 @@ def __init__(
warnings.warn(
"`implementation=0` has been deprecated, "
"and now defaults to `implementation=1`."
"Please update your layer call."
"Please update your layer call.",
stacklevel=2,
)
implementation = 1

Expand All @@ -653,7 +654,8 @@ def __init__(
"when using dynamic RNNs (i.e. non-unrolled). "
"You can either set `unroll=True`, "
"set `dropout` and `recurrent_dropout` to 0, "
"or use a different backend."
"or use a different backend.",
stacklevel=2,
)
dropout = 0.0
recurrent_dropout = 0.0
Expand Down
2 changes: 1 addition & 1 deletion sktime/registry/_lookup.py
Expand Up @@ -245,7 +245,7 @@ def _is_ignored_module(module):
# Skip missing soft dependencies
if "soft dependency" not in str(e):
raise e
warnings.warn(str(e), ImportWarning)
warnings.warn(str(e), ImportWarning, stacklevel=2)

# Drop duplicates
all_estimators = set(all_estimators)
Expand Down

0 comments on commit 66c437a

Please sign in to comment.