Commit d91d216
committed
BUG: ensure that errorbar does not error on masked negative errors.
errorbar checks that errors are not negative, but a bit convolutedly,
in order to avoid triggering on nan. Unfortunately, the work-around
for nan means that possible masks get discarded, and hence passing in
a masked error array that has a negative but masked value leads to
an exception. This PR solves that by simply combining the test for
negative values with the indirect isnan test (err == err), so that
if a masked array is passed, the test values are masked and ignored
in the check.
As a bonus, this also means that astropy's ``Masked`` arrays can now
be used -- those refuse to write output of tests to unmasked values
since that would discard the mask (which is indeed the underlying
problem here).1 parent d55bdde commit d91d216
2 files changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3756 | 3756 | | |
3757 | 3757 | | |
3758 | 3758 | | |
3759 | | - | |
3760 | | - | |
| 3759 | + | |
3761 | 3760 | | |
3762 | 3761 | | |
3763 | 3762 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4538 | 4538 | | |
4539 | 4539 | | |
4540 | 4540 | | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
| 4544 | + | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
| 4548 | + | |
| 4549 | + | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
4541 | 4554 | | |
4542 | 4555 | | |
4543 | 4556 | | |
| |||
0 commit comments