Skip to content

STYLE Reduce merge conflicts with force_grid_wrap=1 #51693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ repos:
- flake8-pyi==22.8.1
- id: future-annotations
name: import annotations from __future__
entry: 'from __future__ import annotations'
entry: 'from __future__ import \(\n annotations'
language: pygrep
args: [--negate]
args: [--negate, --multiline]
files: ^pandas/
types: [python]
exclude: |
Expand Down
8 changes: 6 additions & 2 deletions asv_bench/benchmarks/algorithms.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from importlib import import_module
from importlib import (
import_module,
)

import numpy as np

import pandas as pd

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)

for imp in ["pandas.util", "pandas.tools.hashing"]:
try:
Expand Down
4 changes: 3 additions & 1 deletion asv_bench/benchmarks/algos/isin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
date_range,
)

from ..pandas_vb_common import tm
from ..pandas_vb_common import (
tm,
)


class IsIn:
Expand Down
8 changes: 6 additions & 2 deletions asv_bench/benchmarks/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
to_timedelta,
)
import pandas._testing as tm
from pandas.core.algorithms import checked_add_with_arr
from pandas.core.algorithms import (
checked_add_with_arr,
)

from .pandas_vb_common import numeric_dtypes
from .pandas_vb_common import (
numeric_dtypes,
)

try:
import pandas.core.computation.expressions as expr
Expand Down
4 changes: 3 additions & 1 deletion asv_bench/benchmarks/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import pandas as pd

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)


class BooleanArray:
Expand Down
8 changes: 6 additions & 2 deletions asv_bench/benchmarks/attrs_caching.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import numpy as np

import pandas as pd
from pandas import DataFrame
from pandas import (
DataFrame,
)

try:
from pandas.core.construction import extract_array
from pandas.core.construction import (
extract_array,
)
except ImportError:
extract_array = None

Expand Down
12 changes: 9 additions & 3 deletions asv_bench/benchmarks/categoricals.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@

import pandas as pd

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)

try:
from pandas.api.types import union_categoricals
from pandas.api.types import (
union_categoricals,
)
except ImportError:
try:
from pandas.types.concat import union_categoricals
from pandas.types.concat import (
union_categoricals,
)
except ImportError:
pass

Expand Down
4 changes: 3 additions & 1 deletion asv_bench/benchmarks/ctors.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
date_range,
)

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)


def no_change(arr):
Expand Down
4 changes: 3 additions & 1 deletion asv_bench/benchmarks/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import numpy as np

import pandas as pd
from pandas import DataFrame
from pandas import (
DataFrame,
)
import pandas._testing as tm
from pandas.api.types import (
is_extension_array_dtype,
Expand Down
4 changes: 3 additions & 1 deletion asv_bench/benchmarks/frame_ctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
date_range,
)

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)

try:
from pandas.tseries.offsets import (
Expand Down
4 changes: 3 additions & 1 deletion asv_bench/benchmarks/frame_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
timedelta_range,
)

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)


class Clip:
Expand Down
17 changes: 12 additions & 5 deletions asv_bench/benchmarks/gil.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from functools import wraps
from functools import (
wraps,
)
import threading

import numpy as np
Expand All @@ -10,9 +12,13 @@
factorize,
read_csv,
)
from pandas.core.algorithms import take_nd
from pandas.core.algorithms import (
take_nd,
)

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)

try:
from pandas import (
Expand All @@ -30,11 +36,12 @@
except ImportError:
have_rolling_methods = False
try:
from pandas._libs import algos
from pandas._libs import (
algos,
)
except ImportError:
from pandas import algos


from .pandas_vb_common import BaseIO # isort:skip


Expand Down
16 changes: 12 additions & 4 deletions asv_bench/benchmarks/groupby.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
from functools import partial
from itertools import product
from string import ascii_letters
from functools import (
partial,
)
from itertools import (
product,
)
from string import (
ascii_letters,
)

import numpy as np

Expand All @@ -17,7 +23,9 @@
to_timedelta,
)

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)

method_blocklist = {
"object": {
Expand Down
4 changes: 3 additions & 1 deletion asv_bench/benchmarks/index_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
date_range,
)

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)


class SetOperations:
Expand Down
4 changes: 3 additions & 1 deletion asv_bench/benchmarks/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
period_range,
)

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)


class NumericSeriesIndexing:
Expand Down
8 changes: 6 additions & 2 deletions asv_bench/benchmarks/indexing_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@

import numpy as np

from pandas._libs import index as libindex
from pandas._libs import (
index as libindex,
)

from pandas.core.arrays import BaseMaskedArray
from pandas.core.arrays import (
BaseMaskedArray,
)


def _get_numeric_engines():
Expand Down
16 changes: 12 additions & 4 deletions asv_bench/benchmarks/io/excel.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
from io import BytesIO
from io import (
BytesIO,
)

import numpy as np
from odf.opendocument import OpenDocumentSpreadsheet
from odf.opendocument import (
OpenDocumentSpreadsheet,
)
from odf.table import (
Table,
TableCell,
TableRow,
)
from odf.text import P
from odf.text import (
P,
)

from pandas import (
DataFrame,
Expand All @@ -16,7 +22,9 @@
read_excel,
)

from ..pandas_vb_common import tm
from ..pandas_vb_common import (
tm,
)


def _generate_dataframe():
Expand Down
8 changes: 6 additions & 2 deletions asv_bench/benchmarks/io/sas.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from pathlib import Path
from pathlib import (
Path,
)

from pandas import read_sas
from pandas import (
read_sas,
)

ROOT = Path(__file__).parents[3] / "pandas" / "tests" / "io" / "sas" / "data"

Expand Down
8 changes: 6 additions & 2 deletions asv_bench/benchmarks/io/sql.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import sqlite3

import numpy as np
from sqlalchemy import create_engine
from sqlalchemy import (
create_engine,
)

from pandas import (
DataFrame,
Expand All @@ -10,7 +12,9 @@
read_sql_table,
)

from ..pandas_vb_common import tm
from ..pandas_vb_common import (
tm,
)


class SQL:
Expand Down
12 changes: 9 additions & 3 deletions asv_bench/benchmarks/join_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@
merge_asof,
)

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)

try:
from pandas import merge_ordered
from pandas import (
merge_ordered,
)
except ImportError:
from pandas import ordered_merge as merge_ordered
from pandas import (
ordered_merge as merge_ordered,
)


class Concat:
Expand Down
8 changes: 6 additions & 2 deletions asv_bench/benchmarks/libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@
)

try:
from pandas.util import cache_readonly
from pandas.util import (
cache_readonly,
)
except ImportError:
from pandas.util.decorators import cache_readonly
from pandas.util.decorators import (
cache_readonly,
)


# TODO: share with something in pd._testing?
Expand Down
4 changes: 3 additions & 1 deletion asv_bench/benchmarks/multiindex_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
date_range,
)

from .pandas_vb_common import tm
from .pandas_vb_common import (
tm,
)


class GetLoc:
Expand Down
4 changes: 3 additions & 1 deletion asv_bench/benchmarks/pandas_vb_common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from importlib import import_module
from importlib import (
import_module,
)
import os

import numpy as np
Expand Down
4 changes: 3 additions & 1 deletion asv_bench/benchmarks/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
period_range,
)

from pandas.tseries.frequencies import to_offset
from pandas.tseries.frequencies import (
to_offset,
)


class PeriodIndexConstructor:
Expand Down
Loading