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

Suppress the DeprecationWarning caused by the trimesh package #1774

Merged
merged 2 commits into from
Dec 16, 2022

Conversation

qianyi-sun
Copy link
Contributor

Suppress the /root/SMARTS/.venv/lib/python3.8/site-packages/trimesh/curvature.py:12: DeprecationWarning: Please use `coo_matrix` from the `scipy.sparse` namespace, the `scipy.sparse.coo` namespace is deprecated. warning.

Comment on lines 71 to 73
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
import trimesh # only suppress the warnings caused by trimesh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Does the catch warning also cater to import trimesh in other files, such as opendrive_road_network.py, sumo_road_network.py, waymo_map.py, and geometry.py?
  • Can catch warning be implemented inside map_glb_meta_for_file() method below in this file where trimesh is being imported?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qianyi-sun Could you make the warning more specific? It is possible to pattern match warnings to ignore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Adaickalavan I checked running waymo/opendrive/sumo scenarios, seems like the warning is gone in all three type of scenarios.
@Gamenot If I understood "specfic" correctly, I just added a message= option in the warnings.filterwarning to only suppress this specific message.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is what I meant.

@qianyi-sun qianyi-sun merged commit 67d58a7 into develop Dec 16, 2022
@qianyi-sun qianyi-sun deleted the pat/ignore_trimesh_warning branch December 16, 2022 03:33
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

Successfully merging this pull request may close these issues.

4 participants