Skip to content
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

add __array_function__ #152

Closed
wants to merge 145 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
ae95384
convert obj accessors
andrewgsavage Feb 14, 2021
25dfd19
tests
andrewgsavage Feb 14, 2021
9c72a05
tests ureg
andrewgsavage Feb 14, 2021
d75e4cb
tests ureg
andrewgsavage Feb 14, 2021
bb1b0c9
linting
andrewgsavage Feb 14, 2021
9e8d955
nd
andrewgsavage Feb 16, 2021
63ef7ca
add array_ufunc
andrewgsavage Mar 21, 2021
bdec8c1
add test
andrewgsavage Mar 21, 2021
206e181
.
andrewgsavage Mar 23, 2021
53f8d12
add tests
andrewgsavage Aug 8, 2021
7221cc5
Merge branch 'master' into array_ufunc
andrewgsavage Aug 8, 2021
0a9c251
tests
andrewgsavage Jan 9, 2022
e907bb2
Merge branch 'master' into array_ufunc
andrewgsavage Jan 17, 2022
edce0de
update and lint
andrewgsavage Sep 17, 2022
68cb2fb
impove test
andrewgsavage Sep 18, 2022
7cff3c5
get tests working
andrewgsavage Sep 18, 2022
23e1b61
fix test
andrewgsavage Sep 18, 2022
a781303
assert_pint_array_equal
andrewgsavage Sep 19, 2022
c8da3f5
lint
andrewgsavage Sep 19, 2022
beeb6eb
array_function
andrewgsavage Sep 24, 2022
c74ee50
tests
andrewgsavage Sep 25, 2022
940ceef
tests
andrewgsavage Sep 25, 2022
810ea76
Support object magnitudes
Oct 27, 2022
8994f91
Back using pd.array, not np.ndarray
Oct 31, 2022
8fc3c50
Bugfixes
Nov 1, 2022
a62828e
Bugfixes
Nov 1, 2022
7dd0ce4
Merge branch 'master' into objectmagnitude
andrewgsavage Nov 1, 2022
158bc64
Bugfix
Nov 1, 2022
d3b3484
Bugfix
Nov 1, 2022
c09c2a6
cleanup
Nov 2, 2022
bd99957
Coerce pd.IntXDType to np.intX if possible
Nov 2, 2022
a39817b
Merge branch 'objectmagnitude' of github.com:redhog/pint-pandas into …
Nov 2, 2022
a2ef5f4
Expected dtype changed in api
Nov 2, 2022
bab22e4
Disable now irrelevant/wrong test
Nov 2, 2022
3b70fe2
Added complex test data - some tests not passing yet
Nov 2, 2022
5f667a3
Got all tests to pass / be excluded where applicable with complex128
Nov 2, 2022
fa571ad
Made the linter happy...
Nov 2, 2022
d2f706a
Style change
Nov 4, 2022
7bf2bee
numeric_dtype as ficture so other fixtures can depend on it
Nov 4, 2022
a009d49
Bugfix
Nov 4, 2022
f72fa6c
More tests for new functionality
Nov 4, 2022
abb725d
More tests for new functionality
Nov 4, 2022
f7db632
More tests for new functionality
Nov 4, 2022
3fbd9eb
More tests for new functionality
Nov 4, 2022
a5da29f
Preparing release 0.3
hgrecco Nov 15, 2022
ccfd998
Back to development: 0.4
hgrecco Nov 15, 2022
d578ce1
Made pre-commit happy
Nov 23, 2022
52d8d76
Merge branch 'master' of github.com:hgrecco/pint-pandas into objectma…
Nov 23, 2022
64d3021
Added short line to CHANGES
Nov 23, 2022
e1fdbc2
new flake8 url
andrewgsavage Nov 23, 2022
4c536fc
Merge #158
bors[bot] Nov 23, 2022
b02d486
Merge #148
bors[bot] Nov 23, 2022
4548583
cleanup tests
andrewgsavage Nov 24, 2022
e3b638e
lint
andrewgsavage Nov 24, 2022
c58a7fc
Merge #159
bors[bot] Nov 24, 2022
dd3d0d0
Merge branch 'master' into convert_object_dtype
andrewgsavage Dec 12, 2022
2f39497
Merge branch 'convert_object_dtype' of https://github.com/andrewgsava…
andrewgsavage Dec 12, 2022
02f9bfc
update notebook
andrewgsavage Dec 12, 2022
1584059
lint
andrewgsavage Dec 12, 2022
e34a38c
changes
andrewgsavage Dec 12, 2022
8f40202
Fix import with latest Pint version
mikapfl May 5, 2023
885d6de
Add CHANGES docs
mikapfl May 5, 2023
4bcb8a9
blackend
mikapfl May 5, 2023
6252943
freeze pd 1.5.2
andrewgsavage May 8, 2023
37bcd66
freeze pd 1.5.2
andrewgsavage May 8, 2023
9967732
xfail everything which newly fails with Pint 0.21
mikapfl May 10, 2023
8585b4f
blacken
mikapfl May 10, 2023
cafb98d
Add ci pre and master
hgrecco May 12, 2023
506122f
Changed CI nameS
hgrecco May 12, 2023
d3b772e
Updated versions in CI
hgrecco May 12, 2023
67adc91
Delegate _reduce to underlying ExtensionArray
coroa May 13, 2023
cd0986b
Add upcast_types compatibility
coroa May 13, 2023
4bc344f
Update pint_pandas/pint_array.py
andrewgsavage May 13, 2023
b68f090
Merge pull request #173 from andrewgsavage/pd152
andrewgsavage May 13, 2023
21e046d
Merge pull request #171 from mikapfl/fix-new-pint
andrewgsavage May 13, 2023
67a3f1d
fix typo
andrewgsavage May 13, 2023
67d5d08
stop using my branches for CI
andrewgsavage May 13, 2023
016646c
Merge #177
bors[bot] May 13, 2023
1f4e51d
Merge branch 'master' into delegate-to-extension-arrays
andrewgsavage May 13, 2023
b210bc3
lint
andrewgsavage May 13, 2023
35588da
lint
andrewgsavage May 13, 2023
7fd83ef
numeric groupby test
andrewgsavage May 14, 2023
00c5dba
some passing tests
andrewgsavage May 14, 2023
3a6675b
Fix up pint 0.21 and re-enable tests
coroa May 14, 2023
4d8c7cc
Add to CHANGES
coroa May 14, 2023
e310b62
Merge #179
bors[bot] May 14, 2023
d8ba650
Merge branch 'master' into ags-delegate
andrewgsavage May 14, 2023
553a471
lint
andrewgsavage May 14, 2023
989c6fb
Merge #178
bors[bot] May 14, 2023
90472d1
nanops support
aboultahri May 5, 2023
7abcc77
changes
aboultahri May 15, 2023
a6277a7
Merge #172
bors[bot] May 15, 2023
65a1c39
Upgraded pint-pandas infrastructure
hgrecco May 25, 2023
e45ae93
run pre-commit run --all-files
hgrecco May 25, 2023
fc61b49
Add py.typed
hgrecco May 25, 2023
9d55e77
Fix ruff introduced bug
hgrecco May 25, 2023
992c3ee
pre-commit: autoupdate hook versions
github-actions[bot] May 28, 2023
f43da38
Merge pull request #182 from hgrecco/pre-commit/autoupdate-0
hgrecco May 28, 2023
e063d38
test pandas 2.0.2
andrewgsavage Jun 14, 2023
b93bf77
Merge #185
bors[bot] Jun 17, 2023
37ae978
accumulate
andrewgsavage Jun 18, 2023
6a63967
update versions, changes
andrewgsavage Jun 18, 2023
ddba017
fix tests
andrewgsavage Jun 18, 2023
5355bfd
fix tests
andrewgsavage Jun 18, 2023
d9a9129
unbreak reduce
andrewgsavage Jun 18, 2023
89df3c2
unbreak reduce
andrewgsavage Jun 18, 2023
07cbbbd
Added test exposing the issue
burnpanck Jun 21, 2023
55381eb
fix issue #165
burnpanck Jun 21, 2023
f93304e
update CHANGES
burnpanck Jun 21, 2023
dde3cd1
what happens if no dependencies are pre-installed?
burnpanck Jun 21, 2023
d6598d9
fixes #188
burnpanck Jun 21, 2023
fd1a1a1
better description of new CI workflow
burnpanck Jun 21, 2023
62971df
Merge #189
bors[bot] Jun 22, 2023
44f0f9b
Merge #187
bors[bot] Jun 22, 2023
8b17a57
reset notebook
andrewgsavage Jun 24, 2023
a6b4b84
Merge branch 'master' into pandas2
andrewgsavage Jun 24, 2023
958e36c
Merge #186
bors[bot] Jun 24, 2023
f717fc4
Merge branch 'master' into convert_object_dtype
andrewgsavage Jun 24, 2023
624fcae
typo
andrewgsavage Jun 24, 2023
a00b867
typo
andrewgsavage Jun 24, 2023
5b2b2d4
lint
andrewgsavage Jun 24, 2023
bf84e37
Merge #58
bors[bot] Jun 24, 2023
9876d88
fix pandas v2.1 NumpyEADtype issue
topper-123 Aug 1, 2023
5909b5d
fix pandas v2.1 issues, various
topper-123 Aug 1, 2023
9c7971b
Update to Pandas 2.1.0.dev0+1415.g9cfedf48fa
MichaelTiemannOSC Aug 7, 2023
53b74a4
Initial commit missing file and pre-commit changes
MichaelTiemannOSC Aug 7, 2023
366f5f3
Fixes to map and _get_expected_exception
MichaelTiemannOSC Aug 8, 2023
d883583
Update pint_array.py
MichaelTiemannOSC Aug 12, 2023
34554a6
Update test_pandas_extensiontests.py
MichaelTiemannOSC Aug 12, 2023
31a3055
Merge #195
bors[bot] Aug 12, 2023
57fc253
Merge branch 'master' into pandas21_compat
MichaelTiemannOSC Aug 12, 2023
4ff2ec4
Fix value_counts and other feedback
MichaelTiemannOSC Aug 13, 2023
053f903
Update test_pandas_extensiontests.py
MichaelTiemannOSC Aug 13, 2023
7a97fb7
Update pint_array.py
MichaelTiemannOSC Aug 13, 2023
630c2ae
Update pint_array.py
MichaelTiemannOSC Aug 13, 2023
e1e4585
Testsuite now passes with both Pandas 2.0.2 and 2.1.0rc0
MichaelTiemannOSC Aug 13, 2023
9ff7179
Simplify PintArray.map; CI and CHANGES updates
MichaelTiemannOSC Aug 13, 2023
2c6de3c
Implement `map` also for Pandas 2.0.2
MichaelTiemannOSC Aug 14, 2023
f5947ea
Constrain test_setitem_2d_values to _base_numeric_dtypes
MichaelTiemannOSC Aug 14, 2023
c43c18b
Merge #196
bors[bot] Aug 14, 2023
13b0092
add array_ufunc
andrewgsavage Mar 21, 2021
8755051
add test
andrewgsavage Mar 21, 2021
670c89b
.
andrewgsavage Mar 23, 2021
5342b36
add tests
andrewgsavage Aug 8, 2021
e890d78
merge
andrewgsavage Aug 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[run]
omit = pint_pandas/testsuite/*

50 changes: 50 additions & 0 deletions .github/workflows/ci-check-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Check dependency specification

on: [push, pull_request]

jobs:
test:
strategy:
matrix:
python-version: [3.9, "3.10", "3.11"]

runs-on: ubuntu-latest

env:
TEST_OPTS: "-rfsxEX -s"

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Setup caching
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ matrix.python-version }}
restore-keys: |
pip-${{ matrix.python-version }}

- name: Install pint_pandas (just the bare minimum, no extras, no pre-installed dependencies)
run: |
pip install .

- name: Install pytest
run: pip install pytest

- name: Run Tests
run: |
pytest $TEST_OPTS
99 changes: 99 additions & 0 deletions .github/workflows/ci-pint-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: CI-pint-master

on: [push, pull_request]

jobs:
test:
strategy:
matrix:
python-version: [3.9, "3.10", "3.11"]
numpy: ["numpy>=1.20.3,<2.0.0"]
pandas: ["pandas==2.0.2", ]
pint: ["pint>=0.21.1"]

runs-on: ubuntu-latest

env:
TEST_OPTS: "-rfsxEX -s --cov=pint_pandas --cov-config=.coveragerc"

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install pint
run: python -m pip install git+https://github.com/hgrecco/pint.git@master

- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Setup caching
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ matrix.python-version }}
restore-keys: |
pip-${{ matrix.python-version }}

- name: Install numpy
if: ${{ matrix.numpy != null }}
run: pip install "${{matrix.numpy}}"

- name: Install dependencies
run: |
pip install .[test]

- name: Install pandas
if: ${{ matrix.pandas != null }}
run: pip install "${{matrix.pandas}}"

- name: Run Tests
run: |
pytest $TEST_OPTS

- name: Coverage report
run: coverage report -m

- name: Coveralls Parallel
env:
COVERALLS_FLAG_NAME: ${{ matrix.test-number }}
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
pip install coveralls
coveralls

coveralls:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
pip install coveralls
coveralls --finish

# Dummy task to summarize all. See https://github.com/bors-ng/bors-ng/issues/1300
ci-success:
name: ci
if: ${{ success() }}
needs: test
runs-on: ubuntu-latest
steps:
- name: CI succeeded
run: exit 0
99 changes: 99 additions & 0 deletions .github/workflows/ci-pint-pre.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: CI-pint-pre

on: [push, pull_request]

jobs:
test:
strategy:
matrix:
python-version: [3.9, "3.10", "3.11"]
numpy: ["numpy>=1.20.3,<2.0.0"]
pandas: ["pandas==2.0.2", ]
pint: ["pint>=0.21.1"]

runs-on: ubuntu-latest

env:
TEST_OPTS: "-rfsxEX -s --cov=pint_pandas --cov-config=.coveragerc"

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install pint
run: python -m pip install --pre pint

- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Setup caching
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip-${{ matrix.python-version }}
restore-keys: |
pip-${{ matrix.python-version }}

- name: Install numpy
if: ${{ matrix.numpy != null }}
run: pip install "${{matrix.numpy}}"

- name: Install dependencies
run: |
pip install .[test]

- name: Install pandas
if: ${{ matrix.pandas != null }}
run: pip install "${{matrix.pandas}}"

- name: Run Tests
run: |
pytest $TEST_OPTS

- name: Coverage report
run: coverage report -m

- name: Coveralls Parallel
env:
COVERALLS_FLAG_NAME: ${{ matrix.test-number }}
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
pip install coveralls
coveralls

coveralls:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
pip install coveralls
coveralls --finish

# Dummy task to summarize all. See https://github.com/bors-ng/bors-ng/issues/1300
ci-success:
name: ci
if: ${{ success() }}
needs: test
runs-on: ubuntu-latest
steps:
- name: CI succeeded
run: exit 0
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ jobs:
test:
strategy:
matrix:
python-version: [3.8, 3.9, "3.10"]
python-version: [3.9, "3.10", "3.11"]
numpy: ["numpy>=1.20.3,<2.0.0"]
pandas: ["git+https://github.com/andrewgsavage/pandas.git@assert_1_5",
"git+https://github.com/andrewgsavage/pandas.git@assert_almost_equal", ]
pint: ["pint>=0.20.1"]
pandas: ["pandas==2.0.2", "pandas==2.1.0rc0" ]
pint: ["pint>=0.21.1", "pint==0.22"]

runs-on: ubuntu-latest

Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/lint-autoupdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: pre-commit

on:
schedule:
- cron: "0 0 * * 0" # every Sunday at 00:00 UTC
workflow_dispatch:


jobs:
autoupdate:
name: autoupdate
runs-on: ubuntu-latest
if: github.repository == 'hgrecco/pint-pandas'
steps:
- name: checkout
uses: actions/checkout@v2
- name: Cache pip and pre-commit
uses: actions/cache@v2
with:
path: |
~/.cache/pre-commit
~/.cache/pip
key: ${{ runner.os }}-pre-commit-autoupdate
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: upgrade pip
run: python -m pip install --upgrade pip
- name: install dependencies
run: python -m pip install --upgrade pre-commit
- name: version info
run: python -m pip list
- name: autoupdate
uses: technote-space/create-pr-action@bfd4392c80dbeb54e0bacbcf4750540aecae6ed4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EXECUTE_COMMANDS: |
python -m pre_commit autoupdate
python -m pre_commit run --all-files
COMMIT_MESSAGE: 'pre-commit: autoupdate hook versions'
COMMIT_NAME: 'github-actions[bot]'
COMMIT_EMAIL: 'github-actions[bot]@users.noreply.github.com'
PR_TITLE: 'pre-commit: autoupdate hook versions'
PR_BRANCH_PREFIX: 'pre-commit/'
PR_BRANCH_NAME: 'autoupdate-${PR_ID}'
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
- name: Lint
uses: pre-commit/[email protected]
with:
extra_args: --all-files --show-diff-on-failure
extra_args: --all-files --show-diff-on-failure
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and publish to PyPI

on:
push:
tags:
- '*'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: python -m pip install build

- name: Build package
run: python -m build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
33 changes: 31 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
exclude: '^pint/_vendor'
repos:
<<<<<<< HEAD
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- id: black-jupyter
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.270'
hooks:
- id: ruff
args: ["--fix"]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
=======
- repo: https://github.com/ambv/black
rev: 22.8.0
hooks:
Expand All @@ -9,6 +30,14 @@ repos:
- id: isort
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
>>>>>>> 940ceef2833b47a43feeeb577c2f2702ba39bc0d
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm # GitHub-flavored Markdown
- mdformat-black
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: flake8

- id: nbstripout
args: [--extra-keys=metadata.kernelspec metadata.language_info.version]
Loading