Skip to content

Commit

Permalink
fix numpy2
Browse files Browse the repository at this point in the history
  • Loading branch information
hucorz committed Oct 13, 2024
1 parent b3317ae commit aa62f9f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["windows-latest"]
python-version: ["3.9"]
module: ["xorbits"]
# os: ["ubuntu-latest", "macos-13", "windows-latest"]
# python-version: ["3.9", "3.10", "3.11"]
# module: ["xorbits", "xorbits/numpy", "xorbits/pandas"]
os: ["windows-latest"]
python-version: ["3.9"]
module: ["xorbits"]
exclude:
- { os: macos-13, python-version: 3.10}
- { os: macos-13, python-version: 3.9}
Expand All @@ -95,13 +95,13 @@ jobs:
# - { os: ubuntu-20.04, module: hadoop, python-version: 3.9 }
# - { os: ubuntu-latest, module: vineyard, python-version: 3.11 }
# - { os: ubuntu-latest, module: external-storage, python-version: 3.11 }
# always test compatibility with the latest version
# - { os: ubuntu-latest, module: compatibility, python-version: 3.9 }
# # always test compatibility with the latest version
# # - { os: ubuntu-latest, module: compatibility, python-version: 3.9 }
# - { os: ubuntu-latest, module: doc-build, python-version: 3.9 }
# - { os: self-hosted, module: gpu, python-version: 3.11}
# - { os: ubuntu-latest, module: jax, python-version: 3.9 }
# a self-hosted runner which needs computing resources, activate when necessary
# - { os: juicefs-ci, module: kubernetes-juicefs, python-version: 3.9 }
# # a self-hosted runner which needs computing resources, activate when necessary
# # - { os: juicefs-ci, module: kubernetes-juicefs, python-version: 3.9 }
# - { os: ubuntu-latest, module: slurm, python-version: 3.9 }
# - { os: ubuntu-latest, module: datasets, python-version: 3.9 }
# - { os: ubuntu-latest, module: kubernetes, python-version: 3.11 }
Expand Down
7 changes: 6 additions & 1 deletion python/xorbits/_mars/core/operand/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@
import numpy as np
from xoscar.metrics import Metrics

from ....utils import is_numpy_2

try:
from numpy.core._exceptions import UFuncTypeError
if is_numpy_2:
from numpy._core._exceptions import UFuncTypeError
else:
from numpy.core._exceptions import UFuncTypeError
except ImportError: # pragma: no cover
UFuncTypeError = None

Expand Down

0 comments on commit aa62f9f

Please sign in to comment.