-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check_endian code in _get_filled_data is buggy #66
Conversation
cc @keflavich |
Right, @astrofrog and I were digging into this at one point and tried using |
OK... I see |
I might have clobbered this during a careless rebase -- my bad. In any event, can you add a test that would catch that? |
FYI, there is still a possible bug here: numpy doesn't seem to respect |
Hrmm I'm getting confused here What are the situations in which the check_endian kwarg in get_filled_data becomes important? Can we get this issue more directly with two temporary files with the same contents but different endianness, and assert that get_filled_data does the right thing in both cases? I have to admit I don't fully understand what the warning in the test means, practically speaking |
Your confusion is justified. If you create (I think even by reading from disk? Not sure here!) a little-endian array on a little endian system, e.g. a mac, numpy interprets it as 'native':
whereas a big endian array will keep its type
Really, what we want to do is check that the type changes when appropriate and check is turned on. To make that test work right, and importantly check that the change is not made when the check is turned off, we need to force numpy to not use |
In what situations does the endianness matter? You mention non-numpy functions... should we just directly test that those functions operate properly regardless of the underlying endianness? |
This was specifically for the bottleneck package; it requires native-endian arrays. |
Ok, how about a test of bottleneck on a non-native endian array? The intent of such a test is more obvious, and should exercise the same functionality, right? |
Note that bottleneck is not currently installed on Travis, so this functionality is not getting tested properly on Travis. However, you can add it to the pip install line. |
Either way, we should probably make such a test optional, and skipped if bottleneck isn't present |
@keflavich - can you add bottleneck to Travis and also make sure the test gets skipped if bottleneck is not installed? (also we should make sure the test is set up so as to fail if bottleneck is not installed and not skipped). |
@keflavich - do you think you can realistically do this in the next couple of days? If not, maybe we should re-schedule to 0.2? |
let's skip it for now; it is non-urgent |
@astrofrog I've now added the bottleneck install on travis |
check_endian code in _get_filled_data is buggy
the
check_endian
branch creates adata
variable that is never used. It also usesastype
which copies the array.I'm not sure what the intended behavior is here