Skip to content

Suppress the DeprecationWarning caused by the trimesh package #1774

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

Merged
merged 2 commits into from
Dec 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions smarts/core/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@

VehicleWindow = TrafficHistory.TrafficHistoryVehicleWindow

# Suppress trimesh deprecation warning

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.


class Scenario:
"""The purpose of the Scenario is to provide an aggregate of all
Expand Down