Skip to content

Commit dfa0093

Browse files
pre-commit-ci[bot]Motsu-san
authored andcommitted
style(pre-commit): autofix
1 parent 0f8a2e8 commit dfa0093

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

localization/autoware_localization_evaluation_scripts/scripts/plot_diagnostics.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ def parse_diagnostics_msgs(rosbag_dir: str, target_list: list) -> dict:
3434
storage_id = "sqlite3"
3535
elif len(list(Path(rosbag_dir).rglob("*.mcap"))) > 0:
3636
storage_id = "mcap"
37-
assert (
38-
storage_id is not None
39-
), f"Error: {rosbag_dir} is not a valid rosbag directory."
37+
assert storage_id is not None, f"Error: {rosbag_dir} is not a valid rosbag directory."
4038
storage_options = rosbag2_py.StorageOptions(
4139
uri=str(rosbag_dir),
4240
storage_id=storage_id,
@@ -50,9 +48,7 @@ def parse_diagnostics_msgs(rosbag_dir: str, target_list: list) -> dict:
5048
reader.open(storage_options, converter_options)
5149

5250
topic_types = reader.get_all_topics_and_types()
53-
type_map = {
54-
topic_types[i].name: topic_types[i].type for i in range(len(topic_types))
55-
}
51+
type_map = {topic_types[i].name: topic_types[i].type for i in range(len(topic_types))}
5652

5753
storage_filter = rosbag2_py.StorageFilter(topics=["/diagnostics"])
5854
reader.set_filter(storage_filter)
@@ -221,9 +217,7 @@ def main(rosbag_path: Path, save_dir: Path = None) -> None:
221217
target_data = data_dict[diag_name]
222218
closest_entry = min(
223219
target_data,
224-
key=lambda x: abs(
225-
float(x["timestamp_header"]) - float(timestamp)
226-
),
220+
key=lambda x: abs(float(x["timestamp_header"]) - float(timestamp)),
227221
default=None,
228222
)
229223
if closest_entry:

0 commit comments

Comments
 (0)