-
Notifications
You must be signed in to change notification settings - Fork 76
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
fix: missing attribute in __array__ method of STLVector #1323
Conversation
Commit [#cdaf9a7](cdaf9a7) adds an __array__ method to STLVector in containers.py [L1544](https://github.com/scikit-hep/uproot5/blob/afca74c2af16641299abfbf91935e8010d601111/src/uproot/containers.py#L1544) and [L1659](https://github.com/scikit-hep/uproot5/blob/afca74c2af16641299abfbf91935e8010d601111/src/uproot/containers.py#L1659). However, the method tries to return an attribute that does not exist. I think it should return `self._values` and not `self._vector` ```python def __array__(self, *args, **kwargs): return numpy.asarray(self._vector, *args, **kwargs) ``` should be: ```python def __array__(self, *args, **kwargs): return numpy.asarray(self._values, *args, **kwargs) ```
I reported the corresponding issue in #1324 |
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.
You're absolutely right! I'll merge this as soon as the tests pass. Thank you!!!
@all-contributors please add @rossodisera for code The failure in pyodide-build is unrelated to this; I'm checking up on it. |
I've put up a pull request to add @rossodisera! 🎉 |
Thank you, @jpivarski! I feel a bit guilty about being added to the contributors for such a small change (it was only two lines of code!) :) |
No problem—I think it's appropriate! My ideal is for Uproot to "belong" to the community, with frequent user-driven updates. We still need a core team to review PRs and make sure that everything fits together, and to respond to bugs that are too "deep" (in the sense of background knowledge needed). But I want to include everyone who makes a code update, even when it's just a small one, in the all-contributors matrix, to emphasize that you're all contributors. About the test failure, it looks like an upstream library needs to be fixed: #1326 (comment). Can this PR wait until that fix is in? I don't like to merge things into |
This merge with |
Commit #cdaf9a7 adds an
__array__
method to STLVector in containers.py L1544 and L1659.However, the method tries to return an attribute that does not exist. I think it should return
self._values
and notself._vector
should be: