Repository navigation
Numpy dev array printing - update all tests to new numpy style - #5423
Conversation
|
@taldcroft, @astrofrog, @adrn: this PR makes tests pass on numpy-dev, but at the price of changing how coordinate output looks, to match what the new numpy Just to be a bit clearer about the situation: With current master, you'll get different-looking output depending on whether you use a numpy release or the development version; with this PR, the output is always like that with the development version. To get a sense of how things change: You see that three things happened: trailing What do you think? Is the change for the better? If you look at Now there is an alternative that is worth considering: should we really care how output looks at all, as long as numbers are actually present (and correct, of course)? If so, we should remove or rewrite the tests that fail with current master and numpy-dev, and also find a way for doctests to work irrespective of formatting. Overall, I felt changing the tests made more sense, since I do not think this is going to change again soon... |
|
@mhvk - I prefer the new-style formatting overall and definitely vote for consistency across numpy versions. So 👍 from me. |
|
@mhvk I think the new formatting looks much cleaner. I also agree that we should just check for correctness and not formatting in the tests! |
7660ce5 to
a89fd77
Compare
|
(Rebased following merger of #5254) |
For representations, this changes the expected output; for the one failing fits table test, it simply allows for different style output.
b278bea to
efa01b6
Compare
efa01b6 to
f1dd34d
Compare
|
The one remaining failure with numpy-dev is unrelated to this PR (and on its way to being fixed; numpy/numpy#8218). Since there was general agreement on this change in printing, I'll merge this now. |
|
This is exceedingly difficult to backport do to conflicts almost everywhere, so re-classifying to 1.3.x . We can re-visit this if we feel we need 1.0.x tests with numpy-dev, but my sense is that this is not critical...? |
|
Re: Backport and numpy-dev. IMHO, whoever still using 1.0.x is unlikely to be using numpy-dev, so my vote is "not critical." |
|
I agree with @pllim here. Whomever is flexible enough to upgrade to numpy 1.12, should be flexible enough to upgrade to astropy 1.3. |
|
Yes, agreed, especially as it only affects running the tests, not using actual code. |
This PR changes how representations are represented on the screen, by backporting the new
array2stringstyle for structured arrays. This should solve the remaining bugs with numpy-dev reported in #5419. The first commit changes all tests that failed with the new numpy 1.12 development candidate to match the new style, and the second contains the backport.Obviously, there is a bit of a question what to do anytime a code change leads to a different "visual appearance". Ideally, we wouldn't test for it at all: the only thing that matters should be whether numbers are correct. But there were so many doctests that failed that I felt it was better to bite the bullet...