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
Could you provide some more details? What test is broken?
I don't see why one of our tests failing is necessarily a blocker for Numpy. astropy.io.fits does some funky stuff anyways that may be stretching the intended use (or at the very least has workarounds).
Oh, scratch that. I was on another branch of Astropy that didn't have my more recent fixes for Numpy. On Python 2 all the tests pass locally with Numpy-dev. However, I can confirm that there are test failures on Python 3 (which would explain why they didn't show up in Travis since we only have it testing against numpy-dev on Python 2).
I don't think it's anything too severe though. It appears to be an issue with string handling.
But a very odd one: lots of strings just "disappear"! The least convoluted test that shows the problem is test_table.TestTableFunctions.test_string_column_padding. Minimal test case
I quickly checked whether it mattered whether I passed unicode=False to the chararray definition, but while this changes acol.array it does not affect the result.
The problem seems to be that in FITS_rec.from_columns, outarr = field[:n] leads to an object which is not a view of field (np.may_share_memory(field[:], field) returns False). Not quite sure why that is, though.
But, darn, that seems to be true for numpy 1.8 already. So, perhaps the problem is that field is not quite the right type of object? Well, too sleepy now to investigate further; hopefully, I at least managed to narrow it down a bit...
p.s. Obviously, it may well be better to handle this further up, in ensuring a single item from the field names is always returned as a string. But hopefully the above localization helps.
Obviously, it may well be better to handle this further up, in ensuring a single item from the field names is always returned as a string. But hopefully the above localization helps.
Indeed, I think this is actually indicating something I need to fix further up. To demonstrate, if I do the following I can create an ASCII table from a binary table like so:
However, if you compare the resulting data in the ASCII table with the original binary table, you see that in the ASCII table the string field is returned as bytes instead of strings:
No, I still get those failures with Numpy 1.10 final. But it occurs to me now that I'm working on a branch where I've made other changes, so this failure might actually be related to other changes I've made in the effort to improve unicode handling in tables. I'll figure it out...
It seems likely that is indeed related to the other changes, since I got zero failures with the two changes mentioned above (where I agree the second is probably treating the symptom rather than the cause).
@mhvk@embray - just to be clear, do we think it's ok to go ahead with v1.1 without #4266 fixed? (Or does anyone know how to fix #4266 now?) I see that the skip mentioned in #4266 was already backported to v1.1, so it should work, but the real question is if there's a genuine issue that needs to be addressed... If we're ok with delaying that to 1.1.1, I'd say we can close this, right?
Activity
mhvk commentedon Jun 14, 2015
But it may be good to check whether numpy/numpy#5943 resolves it.
astrofrog commentedon Jun 15, 2015
Maybe Numpy should include
astropy.test()into their test suite ;)mhvk commentedon Jun 17, 2015
For the record, numpy/numpy#5943 does not resolve the issues.
mhvk commentedon Jun 17, 2015
@charris commented (numpy/numpy#5962 (comment)) that
I'll try, but I fear I may need help! @embray?
embray commentedon Jun 17, 2015
Could you provide some more details? What test is broken?
I don't see why one of our tests failing is necessarily a blocker for Numpy.
astropy.io.fitsdoes some funky stuff anyways that may be stretching the intended use (or at the very least has workarounds).charris commentedon Jun 17, 2015
@embray I'll let you folks decide on the severity. My thought was that
io.fitsis probably one of the more used packages in astropy at this time.embray commentedon Jun 17, 2015
I just looked at the latest test build on Travis against numpy-dev (https://travis-ci.org/astropy/astropy/jobs/67227038) and didn't see any io.fits failures, so I'm not sure what this is referring to.
embray commentedon Jun 17, 2015
Oh, I get some failures locally though. I guess maybe whatever was in that Travis build wasn't bleeding edge.
embray commentedon Jun 17, 2015
Oh, scratch that. I was on another branch of Astropy that didn't have my more recent fixes for Numpy. On Python 2 all the tests pass locally with Numpy-dev. However, I can confirm that there are test failures on Python 3 (which would explain why they didn't show up in Travis since we only have it testing against numpy-dev on Python 2).
I don't think it's anything too severe though. It appears to be an issue with string handling.
mhvk commentedon Jun 17, 2015
@embray - thanks for checking. It does seem to be just a python3 issue.
mhvk commentedon Jun 18, 2015
But a very odd one: lots of strings just "disappear"! The least convoluted test that shows the problem is
test_table.TestTableFunctions.test_string_column_padding. Minimal test caseI quickly checked whether it mattered whether I passed
unicode=Falseto the chararray definition, but while this changesacol.arrayit does not affect the result.mhvk commentedon Jun 18, 2015
The problem seems to be that in
FITS_rec.from_columns,outarr = field[:n]leads to an object which is not a view offield(np.may_share_memory(field[:], field)returnsFalse). Not quite sure why that is, though.mhvk commentedon Jun 18, 2015
The lack of memory sharing happens in
recarray.__getitem__--https://github.com/numpy/numpy/blob/master/numpy/core/defchararray.py#L1850
Specifically,in the
temp = val.rstrip()stanza...But, darn, that seems to be true for numpy 1.8 already. So, perhaps the problem is that
fieldis not quite the right type of object? Well, too sleepy now to investigate further; hopefully, I at least managed to narrow it down a bit...39 remaining items
mhvk commentedon Oct 6, 2015
p.s. Obviously, it may well be better to handle this further up, in ensuring a single item from the field names is always returned as a string. But hopefully the above localization helps.
embray commentedon Oct 6, 2015
I figured that was the "one" that still failed :)
embray commentedon Oct 6, 2015
@mhvk
Indeed, I think this is actually indicating something I need to fix further up. To demonstrate, if I do the following I can create an ASCII table from a binary table like so:
However, if you compare the resulting data in the ASCII table with the original binary table, you see that in the ASCII table the string field is returned as bytes instead of strings:
A further oddity is that if I open the original binary table, print the data first, and then create the ASCII table it outright crashes:
I don't understand why it does this in this case, and not in the previous case. But I suspect the bugs are related.
embray commentedon Oct 6, 2015
@mhvk
Meanwhile, even with your patch to the .view() method, I'm getting a bunch of this exception when I run the tests:
granted, I'm still actually on an older dev version. So let me update to Numpy 1.10 final and see what I get...
embray commentedon Oct 6, 2015
No, I still get those failures with Numpy 1.10 final. But it occurs to me now that I'm working on a branch where I've made other changes, so this failure might actually be related to other changes I've made in the effort to improve unicode handling in tables. I'll figure it out...
mhvk commentedon Oct 6, 2015
It seems likely that is indeed related to the other changes, since I got zero failures with the two changes mentioned above (where I agree the second is probably treating the symptom rather than the cause).
embray commentedon Oct 7, 2015
I figured it out. It was an issue related to byte swapping
embray commentedon Oct 7, 2015
Should be fixed by #4228
[-]Numpy-dev issues for io.fits[/-][+]Numpy 1.10 issues for io.fits[/+]mhvk commentedon Oct 19, 2015
Changed title so that people will find there is an existing issue with numpy 1.10.
mhvk commentedon Oct 23, 2015
See #4266 for one outstanding issue still.
eteq commentedon Nov 9, 2015
@mhvk @embray - just to be clear, do we think it's ok to go ahead with v1.1 without #4266 fixed? (Or does anyone know how to fix #4266 now?) I see that the skip mentioned in #4266 was already backported to v1.1, so it should work, but the real question is if there's a genuine issue that needs to be addressed... If we're ok with delaying that to 1.1.1, I'd say we can close this, right?
mhvk commentedon Nov 9, 2015
Not sure - I'll leave this for @embray ...
embray commentedon Nov 12, 2015
I'll try to fix it ASAP, but it's not a blocker. It's fine to have the test marked xfail for now.