Commit fe46cd6
committed
BUG assert_almost_equal fails on subclasses that cannot handle bool
numpygh-8410 breaks a large number of astropy tests, because it sets up
a boolean array for values that should actually be compared (i.e.,
are not `nan` or `inf`) using `zeros_like`. The latter means that
for subclasses, the boolean test array is not a plain `ndarray` but
the subclass. But for astropy's `Quantity`, the `all` method is
undefined.
This commit ensures the test arrays from `isinf` and `isnan` are
used directly.1 parent 83fe06d commit fe46cd6
2 files changed
Lines changed: 40 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | | - | |
304 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
305 | 320 | | |
306 | 321 | | |
307 | 322 | | |
| |||
387 | 402 | | |
388 | 403 | | |
389 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
390 | 420 | | |
391 | 421 | | |
392 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
672 | | - | |
673 | | - | |
| 672 | + | |
674 | 673 | | |
675 | 674 | | |
676 | 675 | | |
| |||
726 | 725 | | |
727 | 726 | | |
728 | 727 | | |
729 | | - | |
730 | 728 | | |
731 | 729 | | |
732 | 730 | | |
733 | 731 | | |
734 | 732 | | |
735 | | - | |
736 | | - | |
| 733 | + | |
| 734 | + | |
737 | 735 | | |
738 | 736 | | |
739 | 737 | | |
| |||
742 | 740 | | |
743 | 741 | | |
744 | 742 | | |
745 | | - | |
746 | | - | |
| 743 | + | |
| 744 | + | |
747 | 745 | | |
748 | 746 | | |
749 | | - | |
| 747 | + | |
750 | 748 | | |
751 | 749 | | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
| 750 | + | |
758 | 751 | | |
759 | 752 | | |
760 | 753 | | |
| |||
0 commit comments