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 all commits
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
11 changes: 10 additions & 1 deletion smarts/core/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@

VehicleWindow = TrafficHistory.TrafficHistoryVehicleWindow

# Suppress trimesh deprecation warning

with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
message="Please use `coo_matrix` from the `scipy.sparse` namespace, the `scipy.sparse.coo` namespace is deprecated.",
category=DeprecationWarning,
)
import trimesh # only suppress the warnings caused by trimesh


class Scenario:
"""The purpose of the Scenario is to provide an aggregate of all
Expand Down Expand Up @@ -949,7 +959,6 @@ def map_glb_metadata(self):
@lru_cache(1)
def map_glb_meta_for_file(filepath):
"""The map metadata given a file."""
import trimesh

scene = trimesh.load(filepath)
return scene.metadata
Expand Down