Skip to content

Commit

Permalink
ci: move "pyupgrade" before "isort" in ".pre-commit-config.yaml"
Browse files Browse the repository at this point in the history
  • Loading branch information
linjiX committed Dec 18, 2022
1 parent ee63cf4 commit f581dc0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ repos:
- id: check-case-conflict
- id: detect-private-key

- repo: https://github.com/asottile/pyupgrade
rev: v2.29.1
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.9.3
hooks:
Expand All @@ -27,12 +33,6 @@ repos:
files: "^examples"
args: ["--profile=black", "-w 100", "--thirdparty=tensorbay"]

- repo: https://github.com/asottile/pyupgrade
rev: v2.29.1
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
Expand Down
19 changes: 14 additions & 5 deletions tensorbay/opendataset/nuScenes/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,20 @@ def _load_frame_and_sensor(

data = Data(
os.path.join(subset_path, sensor_frame["filename"]),
timestamp=sensor_frame["timestamp"] / 10**6,
timestamp=sensor_frame["timestamp"],
)

ego_pose_info = annotation_info["ego_poses"][sensor_frame["ego_pose_token"]]
ego_pose = Transform3D(
translation=ego_pose_info["translation"],
rotation=ego_pose_info["rotation"],
)
data.pose = ego_pose

if not is_test and sensor_type == "lidar":
data.label.box3d = _get_labels(
current_frame_token,
annotation_info["ego_poses"][sensor_frame["ego_pose_token"]],
ego_pose_info,
segment.sensors[sensor_name].extrinsics,
annotation_info,
)
Expand Down Expand Up @@ -218,11 +225,13 @@ def _get_labeled_box(
category = annotation_info["category"][annotation_info["instance"][instance]["category_token"]][
"name"
]
attributes = {}
attributes = {"attributes": []}
for attribute_token in instance_annotation["attribute_tokens"]:
attribute_full_name = annotation_info["attribute"][attribute_token]["name"]
key, value = attribute_full_name.rsplit(".", 1)
attributes[_ATTRIBUTE_KEYS[key]] = value
# key, value = attribute_full_name.rsplit(".", 1)
# attributes[_ATTRIBUTE_KEYS[key]] = value
attributes["attributes"].append(attribute_full_name)

attributes["visibility"] = annotation_info["visibility"][
instance_annotation["visibility_token"]
]["level"]
Expand Down

0 comments on commit f581dc0

Please sign in to comment.