You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FLOAT_CMP isn't powerful enough to handle whitespace that is added in fixed-width printing of floats #92
This failure isn't because of exceeding the tolerance, but rather because of the space between "7" and "]". (I'm hitting this issue with a SkyCoord transformation, where the 32-bit calculation ends in a zero and the 64-bit calculation does not.)
The "obvious" workaround is to turn off FLOAT_CMP and rely on ELLIPSIS to handle the slight discrepancy. But, that could mean adding a lot of ellipsis markers. Is there a better solution?
I guess it's technically out of the scope of NORMALIZE_WHITESPACE because that treats all non-zero whitespace the same (and different from zero whitespace), but what I want is for zero whitespace to be treated the same as non-zero whitespace when a comma is involved.
Anyway, I decided that being able to do proper float comparisons is more desirable than using ellipsis markers, so I added (hidden) testsetup/testcleanup blocks as in my earlier comment.
I guess it's technically out of the scope of NORMALIZE_WHITESPACE because that treats all non-zero whitespace the same (and different from zero whitespace), but what I want is for zero whitespace to be treated the same as non-zero whitespace when a comma is involved.
yes, thus I think ideally NORMALIZE_WHITESPACE should deal with this, or should at least work with other directives better.
I just hit this very same problem over at astropy/astropy#10511 . Glad I am not going crazy. I also resorted to manually setting numpy print options, which isn't pretty in the user example.
Activity
ayshih commentedon Dec 20, 2019
I could change the NumPy printing. First setup with:
and then teardown with:
I'll have to mull over whether that's a better workaround.
bsipocz commentedon Dec 20, 2019
ideally
NORMALIZE_WHITESPACEshould take care of this, I think. So likely this may be a bug?ayshih commentedon Dec 20, 2019
I guess it's technically out of the scope of
NORMALIZE_WHITESPACEbecause that treats all non-zero whitespace the same (and different from zero whitespace), but what I want is for zero whitespace to be treated the same as non-zero whitespace when a comma is involved.Anyway, I decided that being able to do proper float comparisons is more desirable than using ellipsis markers, so I added (hidden)
testsetup/testcleanupblocks as in my earlier comment.bsipocz commentedon Dec 20, 2019
yes, thus I think ideally
NORMALIZE_WHITESPACEshould deal with this, or should at least work with other directives better.pllim commentedon Jun 23, 2020
I just hit this very same problem over at astropy/astropy#10511 . Glad I am not going crazy. I also resorted to manually setting numpy print options, which isn't pretty in the user example.