@@ -440,7 +440,7 @@ def equivalent(x, y, /, loose=False):
440440
441441 if loose :
442442 if np .issubdtype (dt , np .complexfloating ):
443- return equivalent (x .real , y .real ) & equivalent (x .imag , y .imag )
443+ return equivalent (x .real , y .real , loose = True ) & equivalent (x .imag , y .imag , loose = True )
444444
445445 # TODO: Rec array handling
446446 return (x == y ) | ((x != x ) & (y != y ))
@@ -559,7 +559,7 @@ def check_fill_value(x, /, *, accept_fv=None) -> None:
559559 raise ValueError (f"{ x .fill_value = } but should be in { accept_fv } ." )
560560
561561
562- def check_zero_fill_value (* args ):
562+ def check_zero_fill_value (* args , loose = True ):
563563 """
564564 Checks if all the arguments have zero fill-values.
565565
@@ -588,7 +588,7 @@ def check_zero_fill_value(*args):
588588 ValueError: This operation requires zero fill values, but argument 1 had a fill value of 0.5.
589589 """
590590 for i , arg in enumerate (args ):
591- if hasattr (arg , "fill_value" ) and not equivalent (arg .fill_value , _zero_of_dtype (arg .dtype )):
591+ if hasattr (arg , "fill_value" ) and not equivalent (arg .fill_value , _zero_of_dtype (arg .dtype ), loose = loose ):
592592 raise ValueError (
593593 f"This operation requires zero fill values, but argument { i :d} had a fill value of { arg .fill_value !s} ."
594594 )
0 commit comments