Skip to content

Commit cead228

Browse files
authored
Merge branch 'main' into cow_infer_objects
2 parents 8cb6355 + fdd7163 commit cead228

File tree

167 files changed

+3212
-2247
lines changed

Some content is hidden

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

167 files changed

+3212
-2247
lines changed

.github/workflows/python-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
run: |
7474
python --version
7575
python -m pip install --upgrade pip setuptools wheel
76-
python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
76+
python -m pip install --extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
7777
python -m pip install git+https://github.com/nedbat/coveragepy.git
7878
python -m pip install versioneer[toml]
7979
python -m pip install python-dateutil pytz cython hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-cov pytest-asyncio>=0.17

.pre-commit-config.yaml

+4-20
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ default_stages: [
1515
ci:
1616
autofix_prs: false
1717
repos:
18+
- repo: https://github.com/charliermarsh/ruff-pre-commit
19+
rev: v0.0.215
20+
hooks:
21+
- id: ruff
1822
- repo: https://github.com/MarcoGorelli/absolufy-imports
1923
rev: v0.3.1
2024
hooks:
@@ -66,13 +70,6 @@ repos:
6670
--linelength=88,
6771
'--filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size'
6872
]
69-
- repo: https://github.com/PyCQA/flake8
70-
rev: 6.0.0
71-
hooks:
72-
- id: flake8
73-
additional_dependencies: &flake8_dependencies
74-
- flake8==6.0.0
75-
- flake8-bugbear==22.7.1
7673
- repo: https://github.com/pycqa/pylint
7774
rev: v2.15.9
7875
hooks:
@@ -117,12 +114,6 @@ repos:
117114
rev: v0.6.7
118115
hooks:
119116
- id: sphinx-lint
120-
- repo: https://github.com/asottile/yesqa
121-
rev: v1.4.0
122-
hooks:
123-
- id: yesqa
124-
additional_dependencies: *flake8_dependencies
125-
stages: [manual]
126117
- repo: local
127118
hooks:
128119
# NOTE: we make `black` a local hook because if it's installed from
@@ -326,13 +317,6 @@ repos:
326317
files: ^(environment.yml|requirements-dev.txt)$
327318
pass_filenames: false
328319
additional_dependencies: [pyyaml, toml]
329-
- id: sync-flake8-versions
330-
name: Check flake8 version is synced across flake8, yesqa, and environment.yml
331-
language: python
332-
entry: python scripts/sync_flake8_versions.py
333-
files: ^(\.pre-commit-config\.yaml|environment\.yml)$
334-
pass_filenames: false
335-
additional_dependencies: [pyyaml, toml]
336320
- id: title-capitalization
337321
name: Validate correct capitalization among titles in documentation
338322
entry: python scripts/validate_rst_title_capitalization.py

asv_bench/benchmarks/array.py

+9
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

+13
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"]

ci/code_checks.sh

+25
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,31 @@ 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.MultiIndex.drop \
98+
pandas.DatetimeIndex.to_pydatetime \
99+
pandas.TimedeltaIndex.to_pytimedelta \
100+
pandas.core.groupby.SeriesGroupBy.apply \
101+
pandas.core.groupby.DataFrameGroupBy.apply \
102+
pandas.io.formats.style.Styler.export \
103+
pandas.api.extensions.ExtensionArray.astype \
104+
pandas.api.extensions.ExtensionArray.dropna \
105+
pandas.api.extensions.ExtensionArray.isna \
106+
pandas.api.extensions.ExtensionArray.repeat \
107+
pandas.api.extensions.ExtensionArray.unique \
108+
pandas.DataFrame.align
109+
RET=$(($RET + $?)) ; echo $MSG "DONE"
110+
86111
fi
87112

88113
### DOCUMENTATION NOTEBOOKS ###

doc/scripts/eval_performance.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from pandas import DataFrame
77

88
setup_common = """from pandas import DataFrame
9+
import numpy as np
910
df = DataFrame(np.random.randn(%d, 3), columns=list('abc'))
1011
%s"""
1112

doc/source/development/contributing_codebase.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Pre-commit
4343
----------
4444

4545
Additionally, :ref:`Continuous Integration <contributing.ci>` will run code formatting checks
46-
like ``black``, ``flake8``,
46+
like ``black``, ``ruff``,
4747
``isort``, and ``cpplint`` and more using `pre-commit hooks <https://pre-commit.com/>`_
4848
Any warnings from these checks will cause the :ref:`Continuous Integration <contributing.ci>` to fail; therefore,
4949
it is helpful to run the check yourself before submitting code. This
@@ -783,6 +783,7 @@ preferred if the inputs or logic are simple, with Hypothesis tests reserved
783783
for cases with complex logic or where there are too many combinations of
784784
options or subtle interactions to test (or think of!) all of them.
785785

786+
.. _contributing.running_tests:
786787

787788
Running the test suite
788789
----------------------

doc/source/development/contributing_documentation.rst

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ for some tips and tricks to get the doctests passing.
127127
When doing a PR with a docstring update, it is good to post the
128128
output of the validation script in a comment on github.
129129

130+
.. _contributing.howto-build-docs:
130131

131132
How to build the pandas documentation
132133
---------------------------------------

doc/source/development/contributing_environment.rst

+17-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ changes, you can skip to :ref:`contributing to the documentation <contributing_d
1212
creating the development environment you won't be able to build the documentation
1313
locally before pushing your changes. It's recommended to also install the :ref:`pre-commit hooks <contributing.pre-commit>`.
1414

15-
.. contents:: Table of contents:
16-
:local:
15+
.. toctree::
16+
:maxdepth: 2
17+
:hidden:
18+
19+
contributing_gitpod.rst
1720

1821
Step 1: install a C compiler
1922
----------------------------
@@ -76,7 +79,7 @@ Step 2: create an isolated environment
7679
Before we begin, please:
7780

7881
* Make sure that you have :any:`cloned the repository <contributing.forking>`
79-
* ``cd`` to the pandas source directory
82+
* ``cd`` to the pandas source directory you just created with the clone command
8083

8184
.. _contributing.mamba:
8285

@@ -188,6 +191,17 @@ Enable Docker support and use the Services tool window to build and manage image
188191
run and interact with containers.
189192
See https://www.jetbrains.com/help/pycharm/docker.html for details.
190193

194+
Option 4: using Gitpod
195+
~~~~~~~~~~~~~~~~~~~~~~
196+
197+
Gitpod is an open-source platform that automatically creates the correct development
198+
environment right in your browser, reducing the need to install local development
199+
environments and deal with incompatible dependencies.
200+
201+
If you are a Windows user, unfamiliar with using the command line or building pandas
202+
for the first time, it is often faster to build with Gitpod. Here are the in-depth instructions
203+
for :ref:`building pandas with GitPod <contributing-gitpod>`.
204+
191205
Step 3: build and install pandas
192206
--------------------------------
193207

0 commit comments

Comments
 (0)