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
TST: test_nodata respect endianness #15933
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rgommers
reviewed
Apr 24, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks right to me, thanks for the detailed description @tylerjereddy
* the `nodata.arff` file read by this test contains no data whatsoever that could possibly indicate the desired endianness of the empty data fields, so adjust the test to expect the native endianness and pass on the big endian gcc compile farm machine `gcc203` * even if there were actual floating point values in the fields, I still don't see how we'd retrive the desired endianness from those--it seems like we'd still end up with the native endianness of the machine reading the file, and this is indeed what happens for me when I test on `gcc203` with our `loadarff` docstring example: ```python Python 3.9.12 (main, Mar 24 2022, 13:02:21) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from scipy.io import arff >>> from io import StringIO >>> content = """ ... @relation foo ... @Attribute width numeric ... @Attribute height numeric ... @Attribute color {red,green,blue,yellow,black} ... @DaTa ... 5.0,3.25,blue ... 4.5,3.75,green ... 3.0,4.00,red ... """ >>> f = StringIO(content) >>> data, meta = arff.loadarff(f) >>> data array([(5. , 3.25, b'blue'), (4.5, 3.75, b'green'), (3. , 4. , b'red')], dtype=[('width', '>f8'), ('height', '>f8'), ('color', 'S6')]) >>> ```
* account for all cases in the conditional used in `test_nodata()`, based on reviewer feedback
tylerjereddy
force-pushed
the
treddy_issue_15931
branch
from
April 26, 2022 20:49
e816030
to
a92e0a0
Compare
rgommers
approved these changes
Apr 26, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, thanks @tylerjereddy
swallan
pushed a commit
to swallan/scipy
that referenced
this pull request
Apr 28, 2022
* the `nodata.arff` file read by this test contains no data whatsoever that could possibly indicate the desired endianness of the empty data fields, so adjust the test to expect the native endianness and pass on the big endian gcc compile farm machine `gcc203` * even if there were actual floating point values in the fields, I still don't see how we'd retrive the desired endianness from those--it seems like we'd still end up with the native endianness of the machine reading the file, and this is indeed what happens for me when I test on `gcc203` with our `loadarff` docstring example: ```python Python 3.9.12 (main, Mar 24 2022, 13:02:21) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from scipy.io import arff >>> from io import StringIO >>> content = """ ... @relation foo ... @Attribute width numeric ... @Attribute height numeric ... @Attribute color {red,green,blue,yellow,black} ... @DaTa ... 5.0,3.25,blue ... 4.5,3.75,green ... 3.0,4.00,red ... """ >>> f = StringIO(content) >>> data, meta = arff.loadarff(f) >>> data array([(5. , 3.25, b'blue'), (4.5, 3.75, b'green'), (3. , 4. , b'red')], dtype=[('width', '>f8'), ('height', '>f8'), ('color', 'S6')]) >>> ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #15931
the
nodata.arff
file read by this test containsno data whatsoever that could possibly indicate
the desired endianness of the empty data fields,
so adjust the test to expect the native endianness,
and pass on the big endian gcc compile farm machine
gcc203
even if there were actual floating point values
in the fields, I still don't see how we'd retrive
the desired endianness from those--it seems like
we'd still end up with the native endianness of
the machine reading the file, and this is indeed
what happens for me when I test on
gcc203
withour
loadarff
docstring example:format specification stipulated that retrieved data were
to be encoded as little endian--I didn't find evidence of
that based on the descriptions I could find online for
this ASCII file format