ENH: Add support for file like objects to np.core.records.fromfile#16675
Merged
mattip merged 5 commits intonumpy:masterfrom Aug 13, 2020
Merged
ENH: Add support for file like objects to np.core.records.fromfile#16675mattip merged 5 commits intonumpy:masterfrom
mattip merged 5 commits intonumpy:masterfrom
Conversation
rossbar
reviewed
Jun 26, 2020
Contributor
There was a problem hiding this comment.
Is the addition of the isfilelikeobj necessary? The comment from 2504 indicates that the current implementation of isfileobj can be replaced with the hasattr check. Did you try this approach?
eric-wieser
reviewed
Jun 26, 2020
eric-wieser
reviewed
Jun 26, 2020
eric-wieser
reviewed
Jun 26, 2020
anirudh2290
reviewed
Jun 26, 2020
cf1f5bc to
ccb84ff
Compare
rossbar
reviewed
Jul 2, 2020
rossbar
approved these changes
Jul 14, 2020
Contributor
There was a problem hiding this comment.
Thanks for sticking with this through that conversation about compat/isfileobj, and thanks @anirudh2290 for helping to scope this out!
This LGTM. My only remaining comments would be
- Consider adding a comment similar to that added on L914-915 to the corresponding place in the
arrayfunction (~L1003) - I also like @eric-wieser 's suggestion of using
isinstance(f, (io.RawIOBase, io.BufferedIOBase)), which I think could be used in place of thehasattrcheck and is a little easier to understand.
Member
|
@sidhant007 besides the two small fixes, this needs a release note since we are enhancing behaviour. |
32f71e8 to
c2727d0
Compare
Member
|
ppc64le CI build failure unrelated. I added a release note. Could one of the reviewers take a look? |
Member
|
Thanks @sidhant007 |
20 tasks
This file contains hidden or 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
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.
This PR closes #2504
Now
np.core.records.fromfilewill support file like objects following the implementation advice mentioned hereExample: