Skip to content

Commit

Permalink
Fix NumPy 2.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
wesselb committed Jun 23, 2024
1 parent fe845c3 commit fb4d47f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lab/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import numpy as np
from plum import (
ModuleType,
activate_union_aliases,
add_conversion_method,
add_promotion_rule,
convert,
Expand Down Expand Up @@ -96,11 +95,11 @@ def _module_attr(module, attr):
_jax_device = ModuleType("jaxlib.xla_extension", "Device")

# Numeric types:
Int = Union[tuple([int, Dimension] + np.sctypes["int"] + np.sctypes["uint"])]
Int = Union[tuple([int, Dimension] + np.core.sctypes["int"] + np.core.sctypes["uint"])]
Int = set_union_alias(Int, "B.Int")
Float = Union[tuple([float] + np.sctypes["float"])]
Float = Union[tuple([float] + np.core.sctypes["float"])]
Float = set_union_alias(Float, "B.Float")
Complex = Union[tuple([complex] + np.sctypes["complex"])]
Complex = Union[tuple([complex] + np.core.sctypes["complex"])]
Complex = set_union_alias(Complex, "B.Complex")
Bool = Union[bool, np.bool_]
Bool = set_union_alias(Bool, "B.Bool")
Expand Down

0 comments on commit fb4d47f

Please sign in to comment.