Skip to content

Commit be1f02b

Browse files
Merge branch 'main' into test_numpy_complex2
2 parents 9f4bea5 + 213e38e commit be1f02b

File tree

159 files changed

+1426
-818
lines changed

Some content is hidden

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

159 files changed

+1426
-818
lines changed

.github/workflows/unit-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ jobs:
9292
- name: "Numpy Dev"
9393
env_file: actions-311-numpydev.yaml
9494
pattern: "not slow and not network and not single_cpu"
95-
test_args: "-W error::DeprecationWarning -W error::FutureWarning"
95+
# Currently restricted the warnings that error to Deprecation Warnings from numpy
96+
# done since pyarrow isn't compatible with numpydev always
97+
# TODO: work with pyarrow to revert this?
98+
test_args: "-W error::DeprecationWarning:numpy -W error::FutureWarning:numpy"
9699
- name: "Pyarrow Nightly"
97100
env_file: actions-311-pyarrownightly.yaml
98101
pattern: "not slow and not network and not single_cpu"

.pre-commit-config.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ repos:
132132
types: [python]
133133
stages: [manual]
134134
additional_dependencies: &pyright_dependencies
135-
135+
136136
- id: pyright
137137
# note: assumes python env is setup and activated
138138
name: pyright reportGeneralTypeIssues
@@ -190,9 +190,6 @@ repos:
190190
# Check for deprecated messages without sphinx directive
191191
|(DEPRECATED|DEPRECATE|Deprecated)(:|,|\.)
192192
193-
# {foo!r} instead of {repr(foo)}
194-
|!r}
195-
196193
# builtin filter function
197194
|(?<!def)[\(\s]filter\(
198195
types_or: [python, cython, rst]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ BSD 3-Clause License
33
Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
44
All rights reserved.
55

6-
Copyright (c) 2011-2023, Open source contributors.
6+
Copyright (c) 2011-2024, Open source contributors.
77

88
Redistribution and use in source and binary forms, with or without
99
modification, are permitted provided that the following conditions are met:

asv_bench/benchmarks/algos/isin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def setup(self, dtype):
6161
self.series = Series(
6262
Index([f"i-{i}" for i in range(N)], dtype=object), dtype=dtype
6363
)
64-
except ImportError:
65-
raise NotImplementedError
64+
except ImportError as err:
65+
raise NotImplementedError from err
6666
self.values = list(self.series[:2])
6767

6868
else:

asv_bench/benchmarks/array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ class ArrowStringArray:
7676
def setup(self, multiple_chunks):
7777
try:
7878
import pyarrow as pa
79-
except ImportError:
80-
raise NotImplementedError
79+
except ImportError as err:
80+
raise NotImplementedError from err
8181
strings = np.array([str(i) for i in range(10_000)], dtype=object)
8282
if multiple_chunks:
8383
chunks = [strings[i : i + 100] for i in range(0, len(strings), 100)]

asv_bench/benchmarks/multiindex_object.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,20 @@ def time_categorical_level(self):
223223

224224
class Equals:
225225
def setup(self):
226-
idx_large_fast = RangeIndex(100000)
227-
idx_small_slow = date_range(start="1/1/2012", periods=1)
228-
self.mi_large_slow = MultiIndex.from_product([idx_large_fast, idx_small_slow])
229-
226+
self.mi = MultiIndex.from_product(
227+
[
228+
date_range("2000-01-01", periods=1000),
229+
RangeIndex(1000),
230+
]
231+
)
232+
self.mi_deepcopy = self.mi.copy(deep=True)
230233
self.idx_non_object = RangeIndex(1)
231234

235+
def time_equals_deepcopy(self):
236+
self.mi.equals(self.mi_deepcopy)
237+
232238
def time_equals_non_object_index(self):
233-
self.mi_large_slow.equals(self.idx_non_object)
239+
self.mi.equals(self.idx_non_object)
234240

235241

236242
class SetOperations:

asv_bench/benchmarks/strings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def setup(self, dtype):
2121
self.s = Series(
2222
Index([f"i-{i}" for i in range(10000)], dtype=object), dtype=dtype
2323
)
24-
except ImportError:
25-
raise NotImplementedError
24+
except ImportError as err:
25+
raise NotImplementedError from err
2626

2727

2828
class Construction:

ci/code_checks.sh

Lines changed: 124 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,132 @@ fi
6565
### DOCSTRINGS ###
6666
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
6767

68-
MSG='Validate docstrings (EX01, EX04, GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, PR03, PR04, PR05, PR06, PR08, PR09, PR10, RT01, RT02, RT04, RT05, SA02, SA03, SA04, SS01, SS02, SS03, SS04, SS05, SS06)' ; echo $MSG
69-
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX01,EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT02,RT04,RT05,SA02,SA03,SA04,SS01,SS02,SS03,SS04,SS05,SS06
68+
MSG='Validate docstrings (EX01, EX03, EX04, GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, PR03, PR04, PR05, PR06, PR08, PR09, PR10, RT01, RT02, RT04, RT05, SA02, SA03, SA04, SS01, SS02, SS03, SS04, SS05, SS06)' ; echo $MSG
69+
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX01,EX03,EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT02,RT04,RT05,SA02,SA03,SA04,SS01,SS02,SS03,SS04,SS05,SS06
7070
RET=$(($RET + $?)) ; echo $MSG "DONE"
7171

72-
MSG='Partially validate docstrings (EX03)' ; echo $MSG
73-
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX03 --ignore_functions \
74-
pandas.Series.plot.line \
75-
pandas.Series.to_sql \
76-
pandas.errors.SettingWithCopyWarning \
77-
pandas.errors.SpecificationError \
78-
pandas.errors.UndefinedVariableError \
79-
pandas.read_json \
80-
pandas.io.formats.style.Styler.to_latex \
81-
pandas.read_parquet \
82-
pandas.DataFrame.to_sql \
83-
pandas.io.formats.style.Styler.map \
84-
pandas.io.formats.style.Styler.apply_index \
85-
pandas.io.formats.style.Styler.map_index \
86-
pandas.io.formats.style.Styler.format \
87-
pandas.io.formats.style.Styler.highlight_quantile \
88-
pandas.io.formats.style.Styler.background_gradient \
89-
pandas.io.formats.style.Styler.text_gradient
72+
MSG='Partially validate docstrings (PR02)' ; echo $MSG
73+
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=PR02 --ignore_functions \
74+
pandas.io.formats.style.Styler.to_excel\
75+
pandas.CategoricalIndex.rename_categories\
76+
pandas.CategoricalIndex.reorder_categories\
77+
pandas.CategoricalIndex.add_categories\
78+
pandas.CategoricalIndex.remove_categories\
79+
pandas.CategoricalIndex.set_categories\
80+
pandas.IntervalIndex.set_closed\
81+
pandas.IntervalIndex.contains\
82+
pandas.IntervalIndex.overlaps\
83+
pandas.IntervalIndex.to_tuples\
84+
pandas.DatetimeIndex.round\
85+
pandas.DatetimeIndex.floor\
86+
pandas.DatetimeIndex.ceil\
87+
pandas.DatetimeIndex.month_name\
88+
pandas.DatetimeIndex.day_name\
89+
pandas.DatetimeIndex.to_period\
90+
pandas.DatetimeIndex.std\
91+
pandas.TimedeltaIndex.round\
92+
pandas.TimedeltaIndex.floor\
93+
pandas.TimedeltaIndex.ceil\
94+
pandas.PeriodIndex\
95+
pandas.PeriodIndex.strftime\
96+
pandas.Series.clip\
97+
pandas.Series.rename_axis\
98+
pandas.Series.interpolate\
99+
pandas.Series.dt.to_period\
100+
pandas.Series.dt.tz_localize\
101+
pandas.Series.dt.tz_convert\
102+
pandas.Series.dt.strftime\
103+
pandas.Series.dt.round\
104+
pandas.Series.dt.floor\
105+
pandas.Series.dt.ceil\
106+
pandas.Series.dt.month_name\
107+
pandas.Series.dt.day_name\
108+
pandas.Series.str.wrap\
109+
pandas.Series.cat.rename_categories\
110+
pandas.Series.cat.reorder_categories\
111+
pandas.Series.cat.add_categories\
112+
pandas.Series.cat.remove_categories\
113+
pandas.Series.cat.set_categories\
114+
pandas.Series.plot\
115+
pandas.Series.plot.bar\
116+
pandas.Series.plot.barh\
117+
pandas.Series.plot.line\
118+
pandas.Series.plot.pie\
119+
pandas.DataFrame.clip\
120+
pandas.DataFrame.plot\
121+
pandas.DataFrame.plot.bar\
122+
pandas.DataFrame.plot.barh\
123+
pandas.DataFrame.plot.line\
124+
pandas.DataFrame.plot.pie\
125+
pandas.tseries.offsets.DateOffset\
126+
pandas.tseries.offsets.BusinessDay\
127+
pandas.tseries.offsets.BDay\
128+
pandas.tseries.offsets.BusinessHour\
129+
pandas.tseries.offsets.CustomBusinessDay\
130+
pandas.tseries.offsets.CDay\
131+
pandas.tseries.offsets.CustomBusinessHour\
132+
pandas.tseries.offsets.MonthEnd\
133+
pandas.tseries.offsets.MonthBegin\
134+
pandas.tseries.offsets.BusinessMonthEnd\
135+
pandas.tseries.offsets.BMonthEnd\
136+
pandas.tseries.offsets.BusinessMonthBegin\
137+
pandas.tseries.offsets.BMonthBegin\
138+
pandas.tseries.offsets.CustomBusinessMonthEnd\
139+
pandas.tseries.offsets.CBMonthEnd\
140+
pandas.tseries.offsets.CustomBusinessMonthBegin\
141+
pandas.tseries.offsets.CBMonthBegin\
142+
pandas.tseries.offsets.SemiMonthEnd\
143+
pandas.tseries.offsets.SemiMonthBegin\
144+
pandas.tseries.offsets.Week\
145+
pandas.tseries.offsets.WeekOfMonth\
146+
pandas.tseries.offsets.LastWeekOfMonth\
147+
pandas.tseries.offsets.BQuarterEnd\
148+
pandas.tseries.offsets.BQuarterBegin\
149+
pandas.tseries.offsets.QuarterEnd\
150+
pandas.tseries.offsets.QuarterBegin\
151+
pandas.tseries.offsets.BYearEnd\
152+
pandas.tseries.offsets.BYearBegin\
153+
pandas.tseries.offsets.YearEnd\
154+
pandas.tseries.offsets.YearBegin\
155+
pandas.tseries.offsets.FY5253\
156+
pandas.tseries.offsets.FY5253Quarter\
157+
pandas.tseries.offsets.Easter\
158+
pandas.tseries.offsets.Day\
159+
pandas.tseries.offsets.Hour\
160+
pandas.tseries.offsets.Minute\
161+
pandas.tseries.offsets.Second\
162+
pandas.tseries.offsets.Milli\
163+
pandas.tseries.offsets.Micro\
164+
pandas.tseries.offsets.Nano\
165+
pandas.describe_option\
166+
pandas.reset_option\
167+
pandas.get_option\
168+
pandas.set_option\
169+
pandas.Timestamp.max\
170+
pandas.Timestamp.min\
171+
pandas.Timestamp.resolution\
172+
pandas.Timedelta.max\
173+
pandas.Timedelta.min\
174+
pandas.Timedelta.resolution\
175+
pandas.Interval\
176+
pandas.Grouper\
177+
pandas.core.groupby.SeriesGroupBy.apply\
178+
pandas.core.groupby.SeriesGroupBy.transform\
179+
pandas.core.groupby.DataFrameGroupBy.transform\
180+
pandas.core.groupby.DataFrameGroupBy.nth\
181+
pandas.core.groupby.DataFrameGroupBy.rolling\
182+
pandas.core.groupby.SeriesGroupBy.idxmax\
183+
pandas.core.groupby.SeriesGroupBy.idxmin\
184+
pandas.core.groupby.SeriesGroupBy.nth\
185+
pandas.core.groupby.SeriesGroupBy.rolling\
186+
pandas.core.groupby.DataFrameGroupBy.hist\
187+
pandas.core.groupby.DataFrameGroupBy.plot\
188+
pandas.core.groupby.SeriesGroupBy.plot\
189+
pandas.read_hdf\
190+
pandas.HDFStore.append\
191+
pandas.core.window.rolling.Rolling.quantile\
192+
pandas.core.window.expanding.Expanding.quantile\
193+
pandas.api.extensions.ExtensionArray.argsort # There should be no backslash in the final line, please keep this comment in the last ignored function
90194
RET=$(($RET + $?)) ; echo $MSG "DONE"
91195

92196
fi

ci/deps/actions-39-minimum_versions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222

2323
# required dependencies
2424
- python-dateutil=2.8.2
25-
- numpy=1.22.4
25+
- numpy=1.23.5
2626
- pytz=2020.1
2727

2828
# optional dependencies

ci/run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ echo PYTHONHASHSEED=$PYTHONHASHSEED
1010

1111
COVERAGE="-s --cov=pandas --cov-report=xml --cov-append --cov-config=pyproject.toml"
1212

13-
PYTEST_CMD="MESONPY_EDITABLE_VERBOSE=1 PYTHONDEVMODE=1 PYTHONWARNDEFAULTENCODING=1 pytest -r fEs -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET"
13+
PYTEST_CMD="MESONPY_EDITABLE_VERBOSE=1 PYTHONDEVMODE=1 PYTHONWARNDEFAULTENCODING=1 pytest -r fE -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET"
1414

1515
if [[ "$PATTERN" ]]; then
1616
PYTEST_CMD="$PYTEST_CMD -m \"$PATTERN\""

0 commit comments

Comments
 (0)