Fix with black 24.1.1. (#10014)

This commit is contained in:
Jiaming Yuan
2024-01-30 17:24:11 +08:00
committed by GitHub
parent 65d7bf2dfe
commit 54b71c8fba
46 changed files with 49 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
Custom hook to customize the behavior of Hatchling.
Here, we customize the tag of the generated wheels.
"""
import sysconfig
from typing import Any, Dict

View File

@@ -1,4 +1,5 @@
"""Build configuration"""
import dataclasses
from typing import Any, Dict, List, Optional

View File

@@ -1,6 +1,7 @@
"""
Functions for building libxgboost
"""
import logging
import os
import pathlib

View File

@@ -4,6 +4,7 @@ Builds source distribution and binary wheels, following PEP 517 / PEP 660.
Reuses components of Hatchling (https://github.com/pypa/hatch/tree/master/backend) for the sake
of brevity.
"""
import dataclasses
import logging
import os

View File

@@ -1,6 +1,7 @@
"""
Functions for building sdist
"""
import logging
import pathlib

View File

@@ -1,6 +1,7 @@
"""
Utility functions for implementing PEP 517 backend
"""
import logging
import pathlib
import shutil

View File

@@ -1,4 +1,5 @@
"""XGBoost collective communication related API."""
import ctypes
import json
import logging

View File

@@ -64,13 +64,11 @@ class XGBoostError(ValueError):
@overload
def from_pystr_to_cstr(data: str) -> bytes:
...
def from_pystr_to_cstr(data: str) -> bytes: ...
@overload
def from_pystr_to_cstr(data: List[str]) -> ctypes.Array:
...
def from_pystr_to_cstr(data: List[str]) -> ctypes.Array: ...
def from_pystr_to_cstr(data: Union[str, List[str]]) -> Union[bytes, ctypes.Array]:

View File

@@ -1146,9 +1146,9 @@ async def _direct_predict_impl( # pylint: disable=too-many-branches
if _can_output_df(isinstance(data, dd.DataFrame), output_shape):
if base_margin is not None and isinstance(base_margin, da.Array):
# Easier for map_partitions
base_margin_df: Optional[
Union[dd.DataFrame, dd.Series]
] = base_margin.to_dask_dataframe()
base_margin_df: Optional[Union[dd.DataFrame, dd.Series]] = (
base_margin.to_dask_dataframe()
)
else:
base_margin_df = base_margin
predictions = dd.map_partitions(

View File

@@ -1,4 +1,5 @@
"""Utilities for the XGBoost Dask interface."""
import logging
from typing import TYPE_CHECKING, Any, Dict

View File

@@ -1,4 +1,5 @@
"""XGBoost pyspark integration submodule for core code."""
import base64
# pylint: disable=fixme, too-many-ancestors, protected-access, no-member, invalid-name

View File

@@ -1,4 +1,5 @@
"""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=unused-argument, too-many-locals

View File

@@ -1,4 +1,5 @@
"""Xgboost pyspark integration submodule for params."""
from typing import Dict
# pylint: disable=too-few-public-methods
@@ -55,7 +56,6 @@ class HasFeaturesCols(Params):
class HasEnableSparseDataOptim(Params):
"""
This is a Params based class that is extended by _SparkXGBParams
and holds the variable to store the boolean config of enabling sparse data optimization.

View File

@@ -1,4 +1,5 @@
"""Xgboost pyspark integration submodule for helper functions."""
# pylint: disable=fixme
import inspect

View File

@@ -2,6 +2,7 @@
change without notice.
"""
# pylint: disable=invalid-name,missing-function-docstring,import-error
import gc
import importlib.util

View File

@@ -1,4 +1,5 @@
"""Tests for training continuation."""
import json
from typing import Any, Dict, TypeVar

View File

@@ -1,4 +1,5 @@
"""Tests for dask shared by different test modules."""
import numpy as np
import pandas as pd
from dask import array as da

View File

@@ -1,4 +1,5 @@
"""Tests related to the `DataIter` interface."""
import numpy as np
import xgboost

View File

@@ -1,4 +1,5 @@
"""Tests for evaluation metrics."""
from typing import Dict, List
import numpy as np

View File

@@ -1,4 +1,5 @@
"""Testing code shared by other tests."""
# pylint: disable=invalid-name
import collections
import importlib.util

View File

@@ -1,4 +1,5 @@
"""Tests for updaters."""
import json
from functools import partial, update_wrapper
from typing import Any, Dict, List