Skip to content

Commit bf49017

Browse files
authored
compatibility with numpy>=2.0 (#257)
* attempt to fix the upstream-dev CI * replace `np.unicode_` with `np.str_` * remove `PROMOTE_TO_OBJECT` entirely
1 parent 3fb613c commit bf49017

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

.github/workflows/upstream-dev-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
upstream-dev:
2020
name: upstream-dev
2121
runs-on: ubuntu-latest
22-
if: ${{ contains( github.event.pull_request.labels.*.name, 'test-upstream') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
22+
if: ${{ (contains(github.event.pull_request.labels.*.name, 'test-upstream') && github.event_name == 'pull_request') || github.event_name == 'workflow_dispatch' }}
2323
defaults:
2424
run:
2525
shell: bash -l {0}

flox/xrdtypes.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@ def __eq__(self, other):
3131
NINF = AlwaysLessThan()
3232

3333

34-
# Pairs of types that, if both found, should be promoted to object dtype
35-
# instead of following NumPy's own type-promotion rules. These type promotion
36-
# rules match pandas instead. For reference, see the NumPy type hierarchy:
37-
# https://docs.scipy.org/doc/numpy-1.13.0/reference/arrays.scalars.html
38-
PROMOTE_TO_OBJECT = [
39-
{np.number, np.character}, # numpy promotes to character
40-
{np.bool_, np.character}, # numpy promotes to character
41-
{np.bytes_, np.unicode_}, # numpy promotes to unicode
42-
]
43-
44-
4534
def maybe_promote(dtype):
4635
"""Simpler equivalent of pandas.core.common._maybe_promote
4736

0 commit comments

Comments
 (0)