Skip to content

Commit

Permalink
fix: Fixed the lint warnings, failures and Updated black version (#28141
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Sai-Suraj-27 committed Jan 31, 2024
1 parent 33369c8 commit fbc7375
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: ruff
args: [ --fix ]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.1.0
rev: 24.1.1
hooks:
- id: black
language_version: python3
Expand Down
2 changes: 1 addition & 1 deletion ivy/functional/backends/paddle/data_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def as_ivy_dtype(dtype_in: Union[paddle.dtype, str, bool, int, float], /) -> ivy


def as_native_dtype(
dtype_in: Union[paddle.dtype, str, bool, int, float]
dtype_in: Union[paddle.dtype, str, bool, int, float],
) -> paddle.dtype:
if dtype_in is int:
return ivy.default_int_dtype(as_native=True)
Expand Down
2 changes: 1 addition & 1 deletion ivy/functional/backends/torch/data_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def as_ivy_dtype(

@with_unsupported_dtypes({"2.1.2 and below": ("uint16",)}, backend_version)
def as_native_dtype(
dtype_in: Union[torch.dtype, str, bool, int, float, np.dtype]
dtype_in: Union[torch.dtype, str, bool, int, float, np.dtype],
) -> torch.dtype:
if dtype_in is int:
return ivy.default_int_dtype(as_native=True)
Expand Down
2 changes: 1 addition & 1 deletion ivy/functional/ivy/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ def to_ivy_shape(shape: Union[ivy.Shape, ivy.NativeShape]) -> ivy.Shape:

@handle_exceptions
def to_native_shape(
shape: Union[ivy.Array, ivy.Shape, ivy.NativeShape, tuple, int, list]
shape: Union[ivy.Array, ivy.Shape, ivy.NativeShape, tuple, int, list],
) -> ivy.NativeShape:
"""Return the input shape in its native backend framework form.
Expand Down
2 changes: 1 addition & 1 deletion ivy/functional/ivy/gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def _is_variable(x, exclusive=False, to_ignore=None) -> bool:


def _variable_data(
x: Union[ivy.Array, ivy.NativeArray]
x: Union[ivy.Array, ivy.NativeArray],
) -> Union[ivy.Array, ivy.NativeArray]:
"""Get the contents of the input.
Expand Down
2 changes: 1 addition & 1 deletion ivy/utils/einsum_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def convert_subscripts(old_sub: List[Any], symbol_map: Dict[Any, Any]) -> str:


def convert_interleaved_input(
operands: Union[List[Any], Tuple[Any]]
operands: Union[List[Any], Tuple[Any]],
) -> Tuple[str, List[Any]]:
"""Convert 'interleaved' input to standard einsum input."""
tmp_operands = list(operands)
Expand Down
4 changes: 2 additions & 2 deletions ivy/utils/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def tensorflow_profile_start(
Returns
-------
None
"""
""" # noqa: E501
from tensorflow.profiler.experimental import ProfilerOptions, start

options = ProfilerOptions(
Expand Down Expand Up @@ -159,7 +159,7 @@ def torch_profiler_init(
Returns
-------
Torch profiler instance.
"""
""" # noqa: E501
from torch.profiler import profile, tensorboard_trace_handler

profiler = profile(
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ select = [
"I002", # Missing required import.
"UP008", # Checks for super calls that pass redundant arguments.
"PGH002", # deprecated-log-warn.
"PLR0203", # Static method defined without decorator.
"PLR0202", # Class method defined without decorator.
"PLW0245", # super call is missing parentheses.
"PLR1722", # Use sys.exit() instead of exit() and quit().
"TRY004", # Prefer TypeError exception for invalid type.
"PT014", # pytest-duplicate-parametrize-test-cases.
Expand Down

0 comments on commit fbc7375

Please sign in to comment.