Skip to content

Commit

Permalink
Merge branch 'main' into emoji-alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
madhuramkumar committed Apr 18, 2024
2 parents 5b74382 + e60bb8e commit 4dc8208
Show file tree
Hide file tree
Showing 234 changed files with 3,320 additions and 2,462 deletions.
4 changes: 0 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ jobs:
no_output_timeout: 30m # Sometimes the tests won't generate any output, make sure the job doesn't get killed by that
command: |
pip3 install cibuildwheel==2.15.0
# When this is a nightly wheel build, allow picking up NumPy 2.0 dev wheels:
if [[ "$IS_SCHEDULE_DISPATCH" == "true" || "$IS_PUSH" != 'true' ]]; then
export CIBW_ENVIRONMENT="PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
fi
cibuildwheel --prerelease-pythons --output-dir wheelhouse
environment:
Expand Down
74 changes: 74 additions & 0 deletions .github/ISSUE_TEMPLATE/pdep_vote.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: PDEP Vote
description: Call for a vote on a PDEP
title: "VOTE: "
labels: [Vote]

body:
- type: markdown
attributes:
value: >
As per [PDEP-1](https://pandas.pydata.org/pdeps/0001-purpose-and-guidelines.html), the following issue template should be used when a
maintainer has opened a PDEP discussion and is ready to call for a vote.
- type: checkboxes
attributes:
label: Locked issue
options:
- label: >
I locked this voting issue so that only voting members are able to cast their votes or
comment on this issue.
required: true
- type: input
id: PDEP-name
attributes:
label: PDEP number and title
placeholder: >
PDEP-1: Purpose and guidelines
validations:
required: true
- type: input
id: PDEP-link
attributes:
label: Pull request with discussion
description: e.g. https://github.com/pandas-dev/pandas/pull/47444
validations:
required: true
- type: input
id: PDEP-rendered-link
attributes:
label: Rendered PDEP for easy reading
description: e.g. https://github.com/pandas-dev/pandas/pull/47444/files?short_path=7c449e6#diff-7c449e698132205b235c501f7e47ebba38da4d2b7f9492c98f16745dba787041
validations:
required: true
- type: input
id: PDEP-number-of-discussion-participants
attributes:
label: Discussion participants
description: >
You may find it useful to list or total the number of participating members in the
PDEP discussion PR. This would be the maximum possible disapprove votes.
placeholder: >
14 voting members participated in the PR discussion thus far.
- type: input
id: PDEP-vote-end
attributes:
label: Voting will close in 15 days.
description: The voting period end date. ('Voting will close in 15 days.' will be automatically written)
- type: markdown
attributes:
value: ---
- type: textarea
id: Vote
attributes:
label: Vote
value: |
Cast your vote in a comment below.
* +1: approve.
* 0: abstain.
* Reason: A one sentence reason is required.
* -1: disapprove
* Reason: A one sentence reason is required.
A disapprove vote requires prior participation in the linked discussion PR.
@pandas-dev/pandas-core
validations:
required: true
2 changes: 1 addition & 1 deletion .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
if: ${{ steps.build.outcome == 'success' && always() }}

- name: Typing + pylint
- name: Typing
uses: pre-commit/action@v3.0.1
with:
extra_args: --verbose --hook-stage manual --all-files
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,14 @@ jobs:
shell: bash -el {0}
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"

- name: Build normal wheels
if: ${{ (env.IS_SCHEDULE_DISPATCH != 'true' || env.IS_PUSH == 'true') }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0
with:
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}

- name: Build nightly wheels (with NumPy pre-release)
if: ${{ (env.IS_SCHEDULE_DISPATCH == 'true' && env.IS_PUSH != 'true') }}
uses: pypa/cibuildwheel@v2.17.0
with:
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
env:
# The nightly wheels should be build witht he NumPy 2.0 pre-releases
# which requires the additional URL.
CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}

- name: Set up Python
uses: mamba-org/setup-micromamba@v1
with:
Expand Down
37 changes: 6 additions & 31 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ ci:
autofix_prs: false
autoupdate_schedule: monthly
# manual stage hooks
skip: [pylint, pyright, mypy]
skip: [pyright, mypy]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.1
rev: v0.3.4
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand All @@ -30,16 +30,10 @@ repos:
files: ^pandas
exclude: ^pandas/tests
args: [--select, "ANN001,ANN2", --fix-only, --exit-non-zero-on-fix]
- id: ruff
name: ruff-use-pd_array-in-core
alias: ruff-use-pd_array-in-core
files: ^pandas/core/
exclude: ^pandas/core/api\.py$
args: [--select, "ICN001", --exit-non-zero-on-fix]
- id: ruff-format
exclude: ^scripts
- repo: https://github.com/jendrikseipp/vulture
rev: 'v2.10'
rev: 'v2.11'
hooks:
- id: vulture
entry: python scripts/run_vulture.py
Expand Down Expand Up @@ -73,31 +67,12 @@ repos:
- id: fix-encoding-pragma
args: [--remove]
- id: trailing-whitespace
- repo: https://github.com/pylint-dev/pylint
rev: v3.0.1
hooks:
- id: pylint
stages: [manual]
args: [--load-plugins=pylint.extensions.redefined_loop_name, --fail-on=I0021]
- id: pylint
alias: redefined-outer-name
name: Redefining name from outer scope
files: ^pandas/
exclude: |
(?x)
^pandas/tests # keep excluded
|/_testing/ # keep excluded
|^pandas/util/_test_decorators\.py # keep excluded
|^pandas/_version\.py # keep excluded
|^pandas/conftest\.py # keep excluded
args: [--disable=all, --enable=redefined-outer-name]
stages: [manual]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py39-plus]
Expand All @@ -116,7 +91,7 @@ repos:
hooks:
- id: sphinx-lint
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
rev: v18.1.2
hooks:
- id: clang-format
files: ^pandas/_libs/src|^pandas/_libs/include
Expand Down
1 change: 1 addition & 0 deletions asv_bench/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
// pip (with all the conda available packages installed first,
// followed by the pip installed packages).
"matrix": {
"pip+build": [],
"Cython": ["3.0"],
"matplotlib": [],
"sqlalchemy": [],
Expand Down
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/categoricals.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def setup(self):
self.codes = np.tile(range(len(self.categories)), N)

self.datetimes = pd.Series(
pd.date_range("1995-01-01 00:00:00", periods=N / 10, freq="s")
pd.date_range("1995-01-01 00:00:00", periods=N // 10, freq="s")
)
self.datetimes_with_nat = self.datetimes.copy()
self.datetimes_with_nat.iloc[-1] = pd.NaT
Expand Down
24 changes: 24 additions & 0 deletions asv_bench/benchmarks/frame_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,4 +862,28 @@ def time_last_valid_index(self, dtype):
self.df.last_valid_index()


class Update:
def setup(self):
rng = np.random.default_rng()
self.df = DataFrame(rng.uniform(size=(1_000_000, 10)))

idx = rng.choice(range(1_000_000), size=1_000_000, replace=False)
self.df_random = DataFrame(self.df, index=idx)

idx = rng.choice(range(1_000_000), size=100_000, replace=False)
cols = rng.choice(range(10), size=2, replace=False)
self.df_sample = DataFrame(
rng.uniform(size=(100_000, 2)), index=idx, columns=cols
)

def time_to_update_big_frame_small_arg(self):
self.df.update(self.df_sample)

def time_to_update_random_indices(self):
self.df_random.update(self.df_sample)

def time_to_update_small_frame_big_arg(self):
self.df_sample.update(self.df)


from .pandas_vb_common import setup # noqa: F401 isort:skip
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def setup(self, index_type):
"dst": date_range(
start="10/29/2000 1:00:00", end="10/29/2000 1:59:59", freq="s"
),
"repeated": date_range(start="2000", periods=N / 10, freq="s").repeat(10),
"repeated": date_range(start="2000", periods=N // 10, freq="s").repeat(10),
"tz_aware": date_range(start="2000", periods=N, freq="s", tz="US/Eastern"),
"tz_local": date_range(
start="2000", periods=N, freq="s", tz=dateutil.tz.tzlocal()
Expand Down

0 comments on commit 4dc8208

Please sign in to comment.