We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
After creating a Trajectory object, traj, it is possible to successfully overwrite traj.r by using +=. For instance:
traj
traj.r
+=
import yupi x = [2, 5, 3] traj = yupi.Trajectory(x) traj.r += 1 traj.r # Vector([[3.], [6.], [4.])
However, one gets an Attribute Error when trying to do the analogous change with time or component attributes, as indicted bellow:
Attribute Error
traj.t += 1 # Attribute Error: can't set attribute 't'
traj.r.x += 1 # Attribute Error: can't set attribute 'x'
It would be great if one could overwrite other Trajectory's attributes as well.
The text was updated successfully, but these errors were encountered:
I also suggest that when overwriting traj.r with a np.ndarray, yupi automatically converts it to a Vector object in order to prevent attribute errors:
np.ndarray
yupi
Vector
traj = yupi.Trajectory([2, 5, 3]) traj.r = np.array([5,3,4])[:,None] print(traj.r.x) # AttributeError: 'numpy.ndarray' object has no attribute 'x'
traj.r = yupi.Vector([5,3,4])[:,None] print(traj.r.x) # Vector([5, 3, 4])
Sorry, something went wrong.
gvieralopez
jmorgadov
No branches or pull requests
After creating a Trajectory object,
traj
, it is possible to successfully overwritetraj.r
by using+=
. For instance:However, one gets an
Attribute Error
when trying to do the analogous change with time or component attributes, as indicted bellow:It would be great if one could overwrite other Trajectory's attributes as well.
The text was updated successfully, but these errors were encountered: