Skip to content

Commit d077ec8

Browse files
author
MarcoGorelli
committed
Merge remote-tracking branch 'upstream/main' into pr/jorisvandenbossche/ruff
2 parents 1774eb5 + 5b1f72a commit d077ec8

File tree

110 files changed

+1433
-687
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+1433
-687
lines changed

asv_bench/benchmarks/array.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ def time_from_integer_array(self):
4444
pd.array(self.values_integer, dtype="Int64")
4545

4646

47+
class IntervalArray:
48+
def setup(self):
49+
N = 10_000
50+
self.tuples = [(i, i + 1) for i in range(N)]
51+
52+
def time_from_tuples(self):
53+
pd.arrays.IntervalArray.from_tuples(self.tuples)
54+
55+
4756
class StringArray:
4857
def setup(self):
4958
N = 100_000

asv_bench/benchmarks/indexing.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,19 @@ def time_assign_list_of_columns_concat(self):
476476
concat([self.df, df], axis=1)
477477

478478

479+
class Setitem:
480+
def setup(self):
481+
N = 500_000
482+
cols = 500
483+
self.df = DataFrame(np.random.rand(N, cols))
484+
485+
def time_setitem(self):
486+
self.df[100] = 100
487+
488+
def time_setitem_list(self):
489+
self.df[[100, 200, 300]] = 100
490+
491+
479492
class ChainIndexing:
480493

481494
params = [None, "warn"]

asv_bench/benchmarks/rolling.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ class Groupby:
292292
["sum", "median", "mean", "max", "min", "kurt", "sum"],
293293
[
294294
("rolling", {"window": 2}),
295-
("rolling", {"window": "30s", "on": "C"}),
295+
("rolling", {"window": "30s"}),
296296
("expanding", {}),
297297
],
298298
)
@@ -304,9 +304,10 @@ def setup(self, method, window_kwargs):
304304
{
305305
"A": [str(i) for i in range(N)] * 10,
306306
"B": list(range(N)) * 10,
307-
"C": pd.date_range(start="1900-01-01", freq="1min", periods=N * 10),
308307
}
309308
)
309+
if isinstance(kwargs.get("window", None), str):
310+
df.index = pd.date_range(start="1900-01-01", freq="1min", periods=N * 10)
310311
self.groupby_window = getattr(df.groupby("A"), window)(**kwargs)
311312

312313
def time_method(self, method, window_kwargs):

asv_bench/benchmarks/series_methods.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,4 +382,23 @@ def time_iter(self, dtype):
382382
pass
383383

384384

385+
class ToNumpy:
386+
def setup(self):
387+
N = 1_000_000
388+
self.ser = Series(
389+
np.random.randn(
390+
N,
391+
)
392+
)
393+
394+
def time_to_numpy(self):
395+
self.ser.to_numpy()
396+
397+
def time_to_numpy_double_copy(self):
398+
self.ser.to_numpy(dtype="float64", copy=True)
399+
400+
def time_to_numpy_copy(self):
401+
self.ser.to_numpy(copy=True)
402+
403+
385404
from .pandas_vb_common import setup # noqa: F401 isort:skip

ci/code_checks.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,36 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8383
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT04,RT05,SA02,SA03,SA04,SS01,SS02,SS03,SS04,SS05,SS06
8484
RET=$(($RET + $?)) ; echo $MSG "DONE"
8585

86+
MSG='Partially validate docstrings (RT02)' ; echo $MSG
87+
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=RT02 --ignore_functions \
88+
pandas.Series.align \
89+
pandas.Series.dt.total_seconds \
90+
pandas.Series.cat.rename_categories \
91+
pandas.Series.cat.reorder_categories \
92+
pandas.Series.cat.add_categories \
93+
pandas.Series.cat.remove_categories \
94+
pandas.Series.cat.remove_unused_categories \
95+
pandas.Index.all \
96+
pandas.Index.any \
97+
pandas.CategoricalIndex.rename_categories \
98+
pandas.CategoricalIndex.reorder_categories \
99+
pandas.CategoricalIndex.add_categories \
100+
pandas.CategoricalIndex.remove_categories \
101+
pandas.CategoricalIndex.remove_unused_categories \
102+
pandas.MultiIndex.drop \
103+
pandas.DatetimeIndex.to_pydatetime \
104+
pandas.TimedeltaIndex.to_pytimedelta \
105+
pandas.core.groupby.SeriesGroupBy.apply \
106+
pandas.core.groupby.DataFrameGroupBy.apply \
107+
pandas.io.formats.style.Styler.export \
108+
pandas.api.extensions.ExtensionArray.astype \
109+
pandas.api.extensions.ExtensionArray.dropna \
110+
pandas.api.extensions.ExtensionArray.isna \
111+
pandas.api.extensions.ExtensionArray.repeat \
112+
pandas.api.extensions.ExtensionArray.unique \
113+
pandas.DataFrame.align
114+
RET=$(($RET + $?)) ; echo $MSG "DONE"
115+
86116
fi
87117

88118
### DOCUMENTATION NOTEBOOKS ###

ci/deps/actions-310.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dependencies:
4848
- pyxlsb
4949
- s3fs>=2021.08.0
5050
- scipy
51-
- sqlalchemy
51+
- sqlalchemy<1.4.46
5252
- tabulate
5353
- tzdata>=2022a
5454
- xarray

ci/deps/actions-38-downstream_compat.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dependencies:
4848
- pyxlsb
4949
- s3fs>=2021.08.0
5050
- scipy
51-
- sqlalchemy
51+
- sqlalchemy<1.4.46
5252
- tabulate
5353
- xarray
5454
- xlrd

ci/deps/actions-38.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dependencies:
4848
- pyxlsb
4949
- s3fs>=2021.08.0
5050
- scipy
51-
- sqlalchemy
51+
- sqlalchemy<1.4.46
5252
- tabulate
5353
- xarray
5454
- xlrd

ci/deps/actions-39.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dependencies:
4848
- pyxlsb
4949
- s3fs>=2021.08.0
5050
- scipy
51-
- sqlalchemy
51+
- sqlalchemy<1.4.46
5252
- tabulate
5353
- tzdata>=2022a
5454
- xarray

ci/deps/circle-38-arm64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ dependencies:
4949
- pyxlsb
5050
- s3fs>=2021.08.0
5151
- scipy
52-
- sqlalchemy
52+
- sqlalchemy<1.4.46
5353
- tabulate
5454
- xarray
5555
- xlrd

0 commit comments

Comments
 (0)