Skip to content

Commit b312448

Browse files
authored
Fix pylint errors. (#11748)
1 parent b12f637 commit b312448

File tree

22 files changed

+22
-28
lines changed

22 files changed

+22
-28
lines changed

python-package/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ ignore = ["tests"]
6262
extension-pkg-whitelist = ["numpy", "cuda"]
6363
disable = [
6464
"import-error",
65+
"invalid-name",
6566
"attribute-defined-outside-init",
6667
"import-outside-toplevel",
6768
"too-few-public-methods",

python-package/pyproject.toml.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ ignore = ["tests"]
6161
extension-pkg-whitelist = ["numpy", "cuda"]
6262
disable = [
6363
"import-error",
64+
"invalid-name",
6465
"attribute-defined-outside-init",
6566
"import-outside-toplevel",
6667
"too-few-public-methods",

python-package/xgboost/_typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
CupyT = ArrayLike # maybe need a stub for cupy arrays
4242
NumpyOrCupy = Any
43-
NumpyDType = Union[str, Type[np.number]] # pylint: disable=invalid-name
43+
NumpyDType = Union[str, Type[np.number]]
4444
PandasDType = Any # real type is pandas.core.dtypes.base.ExtensionDtype
4545

4646
FloatCompatible = Union[float, np.float32, np.float64]

python-package/xgboost/callback.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class TrainingCallback(ABC):
5555
5656
"""
5757

58-
# pylint: disable=invalid-name
5958
EvalsLog: TypeAlias = EvalsLog
6059

6160
def __init__(self) -> None:

python-package/xgboost/collective.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class Op(IntEnum):
256256
BITWISE_XOR = 5
257257

258258

259-
def allreduce(data: np.ndarray, op: Op) -> np.ndarray: # pylint:disable=invalid-name
259+
def allreduce(data: np.ndarray, op: Op) -> np.ndarray:
260260
"""Perform allreduce, return the result.
261261
262262
Parameters

python-package/xgboost/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pylint: disable=invalid-name,unused-import
1+
# pylint: disable=unused-import
22
"""For compatibility and optional dependencies."""
33
import functools
44
import importlib.util

python-package/xgboost/core.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pylint: disable=too-many-arguments, too-many-branches, invalid-name
1+
# pylint: disable=too-many-arguments, too-many-branches
22
# pylint: disable=too-many-lines, too-many-locals
33
"""Core XGBoost Library."""
44

@@ -1977,7 +1977,6 @@ def __init__(
19771977
cache: Optional[Sequence[DMatrix]] = None,
19781978
model_file: Optional[Union["Booster", bytearray, os.PathLike, str]] = None,
19791979
) -> None:
1980-
# pylint: disable=invalid-name
19811980
"""
19821981
Parameters
19831982
----------
@@ -2509,7 +2508,6 @@ def eval_set(
25092508
feval: Optional[Metric] = None,
25102509
output_margin: bool = True,
25112510
) -> str:
2512-
# pylint: disable=invalid-name
25132511
"""Evaluate a set of data.
25142512
25152513
Parameters

python-package/xgboost/dask/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pylint: disable=too-many-arguments, too-many-locals
2-
# pylint: disable=missing-class-docstring, invalid-name
2+
# pylint: disable=missing-class-docstring
33
# pylint: disable=too-many-lines
44
"""
55
Dask extensions for distributed training

python-package/xgboost/dask/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# pylint: disable=invalid-name
21
"""Utilities for the XGBoost Dask interface."""
32

43
import logging

python-package/xgboost/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ class SingleBatchInternalIter(DataIter): # pylint: disable=R0902
16191619

16201620
def __init__(self, **kwargs: Any) -> None:
16211621
self.kwargs = kwargs
1622-
self.it = 0 # pylint: disable=invalid-name
1622+
self.it = 0
16231623

16241624
# This does not necessarily increase memory usage as the data transformation
16251625
# might use memory.

0 commit comments

Comments
 (0)