Skip to content

Improve error message for trajectory invalid attribute in map display

Benoit Seignovert requested to merge traj-invalid-attr-in-maps into main

Trajectory objects with an invalid property in map display reports a cryptic ValueError message:

>>> fig = plt.figure(figsize=(12, 6))
>>> ax = fig.add_subplot(projection=EUROPA)

>>> ax.plot(traj, 'foo')
ValueError: Unrecognized character f in format string

This MR should provide a better error message:

ValueError: The second argument `foo` must be a `Trajectory` property
            or a valid matplotlib format string (eg. `ro`).
Edited by Benoit Seignovert

Merge request reports