Skip to content
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

KeyError: 'point' in __repr__ of Pvector #15

Closed
f380cedric opened this issue Jun 21, 2021 · 2 comments
Closed

KeyError: 'point' in __repr__ of Pvector #15

f380cedric opened this issue Jun 21, 2021 · 2 comments

Comments

@f380cedric
Copy link

Python 3.9.2
nvector 0.7.7

Following Example 1:

import numpy as np
import nvector as nv
wgs84 = nv.FrameE(name='WGS84')
pointA = wgs84.GeoPoint(latitude=1, longitude=2, z=3, degrees=True)
pointB = wgs84.GeoPoint(latitude=4, longitude=5, z=6, degrees=True)
p_AB_N = pointA.delta_to(pointB)
print(p_AB_N)

gives

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/f380cedric/.local/lib/python3.9/site-packages/nvector/objects.py", line 138, in __repr__
    params = fmt.join(['{}={!r}'.format(name, dict_params[name])
  File "/home/f380cedric/.local/lib/python3.9/site-packages/nvector/objects.py", line 138, in <listcomp>
    params = fmt.join(['{}={!r}'.format(name, dict_params[name])
  File "/home/f380cedric/.local/lib/python3.9/site-packages/nvector/objects.py", line 138, in __repr__
    params = fmt.join(['{}={!r}'.format(name, dict_params[name])
  File "/home/f380cedric/.local/lib/python3.9/site-packages/nvector/objects.py", line 138, in <listcomp>
    params = fmt.join(['{}={!r}'.format(name, dict_params[name])
KeyError: 'point'

It goes like this: Pvector.__dict__["frame"] → FrameN.__dict__["point"]. FrameN._NAMES gives "point" while dict_params only contains key nvector.

@pbrod
Copy link
Owner

pbrod commented Jun 22, 2021

Thanks for the notification. This is clearly a bug!

@pbrod
Copy link
Owner

pbrod commented Jun 22, 2021

Closing since it is fixed in commit 096e0b8

@pbrod pbrod closed this as completed Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants