Skip to content

Commit

Permalink
remove 'pylint: disable' comments for too-many-ancestors and too-few-…
Browse files Browse the repository at this point in the history
…public-methods
  • Loading branch information
jameslamb committed Nov 26, 2024
1 parent d845922 commit b7564a1
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion python-package/xgboost/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def c_array(
def from_array_interface(interface: dict) -> NumpyOrCupy:
"""Convert array interface to numpy or cupy array"""

class Array: # pylint: disable=too-few-public-methods
class Array:
"""Wrapper type for communicating with numpy and cupy."""

_interface: Optional[dict] = None
Expand Down
1 change: 0 additions & 1 deletion python-package/xgboost/dask/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# pylint: disable=too-many-arguments, too-many-locals
# pylint: disable=missing-class-docstring, invalid-name
# pylint: disable=too-many-lines
# pylint: disable=too-few-public-methods
"""
Dask extensions for distributed training
----------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions python-package/xgboost/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
from .training import train


class XGBRankerMixIn: # pylint: disable=too-few-public-methods
class XGBRankerMixIn:
"""MixIn for ranking, defines the _estimator_type usually defined in scikit-learn
base classes.
Expand All @@ -83,7 +83,7 @@ def _can_use_qdm(tree_method: Optional[str], device: Optional[str]) -> bool:
return tree_method in ("hist", "gpu_hist", None, "auto") and not_sycl


class _SklObjWProto(Protocol): # pylint: disable=too-few-public-methods
class _SklObjWProto(Protocol):
def __call__(
self,
y_true: ArrayLike,
Expand Down
4 changes: 2 additions & 2 deletions python-package/xgboost/spark/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import base64

# pylint: disable=fixme, too-many-ancestors, protected-access, no-member, invalid-name
# pylint: disable=too-few-public-methods, too-many-lines, too-many-branches
# pylint: disable=fixme, protected-access, no-member, invalid-name
# pylint: disable=too-many-lines, too-many-branches
import json
import logging
import os
Expand Down
3 changes: 1 addition & 2 deletions python-package/xgboost/spark/estimator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Xgboost pyspark integration submodule for estimator API."""

# pylint: disable=too-many-ancestors
# pylint: disable=fixme, too-many-ancestors, protected-access, no-member, invalid-name
# pylint: disable=fixme, protected-access, no-member, invalid-name
# pylint: disable=unused-argument, too-many-locals

import warnings
Expand Down
1 change: 0 additions & 1 deletion python-package/xgboost/spark/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from typing import Dict

# pylint: disable=too-few-public-methods
from pyspark.ml.param import TypeConverters
from pyspark.ml.param.shared import Param, Params

Expand Down
2 changes: 1 addition & 1 deletion python-package/xgboost/spark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _get_default_params_from_func(
return filtered_params_dict


class CommunicatorContext(CCtx): # pylint: disable=too-few-public-methods
class CommunicatorContext(CCtx):
"""Context with PySpark specific task ID."""

def __init__(self, context: BarrierTaskContext, **args: CollArgsVals) -> None:
Expand Down
2 changes: 1 addition & 1 deletion python-package/xgboost/testing/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def is_binary(self) -> bool:
return self.max_rel == 1


class PBM: # pylint: disable=too-few-public-methods
class PBM:
"""Simulate click data with position bias model. There are other models available in
`ULTRA <https://github.com/ULTR-Community/ULTRA.git>`_ like the cascading model.
Expand Down

0 comments on commit b7564a1

Please sign in to comment.