Skip to content

Commit

Permalink
fix np.sctypes error
Browse files Browse the repository at this point in the history
  • Loading branch information
marslicy committed Jul 9, 2024
1 parent 926a3cf commit a189ed8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions imgaug/imgaug.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
)


# to check if a dtype instance is among these dtypes, use e.g.
# `dtype.type in NP_FLOAT_TYPES` do not just use `dtype in NP_FLOAT_TYPES` as
# that would fail
NP_FLOAT_TYPES = set(np.sctypes["float"])
NP_INT_TYPES = set(np.sctypes["int"])
NP_UINT_TYPES = set(np.sctypes["uint"])

IMSHOW_BACKEND_DEFAULT = "matplotlib"

Expand Down
4 changes: 2 additions & 2 deletions imgaug/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ def force_np_float_dtype(val):

def both_np_float_if_one_is_float(a, b):
# pylint: disable=invalid-name
a_f = a.dtype.type in ia.NP_FLOAT_TYPES
b_f = b.dtype.type in ia.NP_FLOAT_TYPES
a_f = np.issubdtype(a.dtype.type, np.floating)
b_f = np.issubdtype(b.dtype.type, np.floating)
if a_f and b_f:
return a, b
if a_f:
Expand Down

0 comments on commit a189ed8

Please sign in to comment.