-
Notifications
You must be signed in to change notification settings - Fork 27
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
Single component value can not be changed in VectorNumpy3D #158
Comments
Hmm. It's hard to see how there can be a way to do what you want (either an error message or a change in the original array). When you say If, instead of v[1].x = 25 you had said v.x[1] = 25 it would have assigned to the original array: Mutability and views vs copies have always been murky, which is why there's such a strong movement behind functional programming. Anyway, to actually implement this, we would need a new parameter to At the end of that brainstorming, the "do not write" flag sounds like it would cause the least problems, and it would present an error message explaining all of these issues with a way to override the flag. I suppose that would be a (I'm going to label this as a feature request.) |
@jpivarski Thank you very much for the comprehensive explanation. |
I am using the vector library in a computer-vision software to store the prediction results. There I have a two-step workflow where I first have to calculate some values, then refine a part of them (for example the depth component
z
). After implementing everything I never got the right results and wondered why.I noticed that it is possible to set a single component in a vector-object:
But this is not possible as soon as I work with
VectorNumpy3D
(and2D
,4D
):Either there should be an error message, that it is not possible to set single component values in
VectorNumpy3D
arrays or the value should be set. Atm the line of code seems just like being ignored.Is there a way to change a single value inside of this array structure?
The text was updated successfully, but these errors were encountered: