Skip to content

Single component value can not be changed in VectorNumpy3D #158

@cansik

Description

@cansik

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:

v = vector.obj(x=1.1, y=2.2)
v.x = 25

print(v)
# vector.obj(x=25, y=2.2)

But this is not possible as soon as I work with VectorNumpy3D (and 2D, 4D):

v = vector.array({
    "x": [1.0, 2.0],
    "y": [1.1, 2.2],
    "z": [0.1, 0.2],
})

v[1].x = 25

print(v)
# [(1., 1.1, 0.1) (2., 2.2, 0.2)]

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions