Skip to content

Commit 4243ff6

Browse files
[CI]: Upgrade pre-commit-hook in the dev-1.x branch (#1893)
* update pre-commit-hook config * fix typos in new pre-commit-hook
1 parent d6ad6a7 commit 4243ff6

File tree

14 files changed

+51
-59
lines changed

14 files changed

+51
-59
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
repos:
22
- repo: https://github.com/PyCQA/flake8
3-
rev: 3.8.3
3+
rev: 5.0.4
44
hooks:
55
- id: flake8
66
- repo: https://github.com/PyCQA/isort
77
rev: 5.10.1
88
hooks:
99
- id: isort
1010
- repo: https://github.com/pre-commit/mirrors-yapf
11-
rev: v0.30.0
11+
rev: v0.32.0
1212
hooks:
1313
- id: yapf
1414
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v3.1.0
15+
rev: v4.3.0
1616
hooks:
1717
- id: trailing-whitespace
1818
- id: check-yaml
@@ -25,7 +25,7 @@ repos:
2525
- id: mixed-line-ending
2626
args: ["--fix=lf"]
2727
- repo: https://github.com/codespell-project/codespell
28-
rev: v2.1.0
28+
rev: v2.2.1
2929
hooks:
3030
- id: codespell
3131
- repo: https://github.com/executablebooks/mdformat

docs/en/advanced_guides/customize_runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Actually, both [`IterBasedTrainLoop`](https://github.com/open-mmlab/mmengine/blo
234234

235235
```python
236236
# Before 365001th iteration, we do evaluation every 5000 iterations.
237-
# After 365000th iteration, we do evaluation every 368750 iteraions,
237+
# After 365000th iteration, we do evaluation every 368750 iterations,
238238
# which means that we do evaluation at the end of training.
239239

240240
interval = 5000

docs/en/user_guides/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ param_scheduler = [
411411

412412
### Hook config
413413

414-
Users can attach hooks to training, validation, and testing loops to insert some oprations during running. There are two different hook fields, one is `default_hooks` and the other is `custom_hooks`.
414+
Users can attach hooks to training, validation, and testing loops to insert some operations during running. There are two different hook fields, one is `default_hooks` and the other is `custom_hooks`.
415415

416416
`default_hooks` is a dict of hook configs. `default_hooks` are the hooks must required at runtime. They have default priority which should not be modified. If not set, runner will use the default values. To disable a default hook, users can set its config to `None`.
417417

mmdet3d/datasets/transforms/dbsampler.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,21 @@ class DataBaseSampler(object):
9898
for more details. Defaults to dict(backend='disk').
9999
"""
100100

101-
def __init__(self,
102-
info_path: str,
103-
data_root: str,
104-
rate: float,
105-
prepare: dict,
106-
sample_groups: dict,
107-
classes: Optional[List[str]] = None,
108-
points_loader: dict = dict(
109-
type='LoadPointsFromFile',
110-
coord_type='LIDAR',
111-
load_dim=4,
112-
use_dim=[0, 1, 2, 3]),
113-
file_client_args: dict = dict(backend='disk')) -> None:
101+
def __init__(
102+
self,
103+
info_path: str,
104+
data_root: str,
105+
rate: float,
106+
prepare: dict,
107+
sample_groups: dict,
108+
classes: Optional[List[str]] = None,
109+
points_loader: dict = dict(
110+
type='LoadPointsFromFile',
111+
coord_type='LIDAR',
112+
load_dim=4,
113+
use_dim=[0, 1, 2, 3]),
114+
file_client_args: dict = dict(backend='disk')
115+
) -> None:
114116
super().__init__()
115117
self.data_root = data_root
116118
self.info_path = info_path
@@ -304,9 +306,7 @@ def sample_all(self,
304306

305307
return ret
306308

307-
def sample_class_v2(self,
308-
name: str,
309-
num: int,
309+
def sample_class_v2(self, name: str, num: int,
310310
gt_bboxes: np.ndarray) -> List[dict]:
311311
"""Sampling specific categories of bounding boxes.
312312

mmdet3d/datasets/transforms/formating.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def __init__(
7272
'sample_idx', 'pcd_scale_factor', 'pcd_rotation',
7373
'pcd_rotation_angle', 'lidar_path',
7474
'transformation_3d_flow', 'trans_mat',
75-
'affine_aug')) -> None:
75+
'affine_aug')
76+
) -> None:
7677
self.keys = keys
7778
self.meta_keys = meta_keys
7879

mmdet3d/datasets/transforms/loading.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ class LoadMultiViewImageFromFiles(BaseTransform):
2525
Defaults to 'unchanged'.
2626
"""
2727

28-
def __init__(
29-
self,
30-
to_float32: bool = False,
31-
color_type: str = 'unchanged'
32-
) -> None:
28+
def __init__(self,
29+
to_float32: bool = False,
30+
color_type: str = 'unchanged') -> None:
3331
self.to_float32 = to_float32
3432
self.color_type = color_type
3533

@@ -154,16 +152,14 @@ class LoadPointsFromMultiSweeps(BaseTransform):
154152
Defaults to False.
155153
"""
156154

157-
def __init__(
158-
self,
159-
sweeps_num: int = 10,
160-
load_dim: int = 5,
161-
use_dim: List[int] = [0, 1, 2, 4],
162-
file_client_args: dict = dict(backend='disk'),
163-
pad_empty_sweeps: bool = False,
164-
remove_close: bool = False,
165-
test_mode: bool = False
166-
) -> None:
155+
def __init__(self,
156+
sweeps_num: int = 10,
157+
load_dim: int = 5,
158+
use_dim: List[int] = [0, 1, 2, 4],
159+
file_client_args: dict = dict(backend='disk'),
160+
pad_empty_sweeps: bool = False,
161+
remove_close: bool = False,
162+
test_mode: bool = False) -> None:
167163
self.load_dim = load_dim
168164
self.sweeps_num = sweeps_num
169165
self.use_dim = use_dim
@@ -195,11 +191,9 @@ def _load_points(self, pts_filename: str) -> np.ndarray:
195191
points = np.fromfile(pts_filename, dtype=np.float32)
196192
return points
197193

198-
def _remove_close(
199-
self,
200-
points: Union[np.ndarray, BasePoints],
201-
radius: float = 1.0
202-
) -> Union[np.ndarray, BasePoints]:
194+
def _remove_close(self,
195+
points: Union[np.ndarray, BasePoints],
196+
radius: float = 1.0) -> Union[np.ndarray, BasePoints]:
203197
"""Removes point too close within a certain radius from origin.
204198
205199
Args:

mmdet3d/datasets/transforms/test_time_aug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self,
4646
self.img_scale = img_scale if isinstance(img_scale,
4747
list) else [img_scale]
4848
self.pts_scale_ratio = pts_scale_ratio \
49-
if isinstance(pts_scale_ratio, list) else[float(pts_scale_ratio)]
49+
if isinstance(pts_scale_ratio, list) else [float(pts_scale_ratio)]
5050

5151
assert mmengine.is_list_of(self.img_scale, tuple)
5252
assert mmengine.is_list_of(self.pts_scale_ratio, float)

mmdet3d/datasets/transforms/transforms_3d.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,10 +1221,8 @@ def _input_generation(self, coords: np.ndarray, patch_center: np.ndarray,
12211221
return points
12221222

12231223
def _patch_points_sampling(
1224-
self,
1225-
points: BasePoints,
1226-
sem_mask: np.ndarray
1227-
) -> Tuple[BasePoints, np.ndarray]:
1224+
self, points: BasePoints,
1225+
sem_mask: np.ndarray) -> Tuple[BasePoints, np.ndarray]:
12281226
"""Patch points sampling.
12291227
12301228
First sample a valid patch.
@@ -1470,9 +1468,7 @@ def __init__(self,
14701468
self.prev_voxel_generator = None
14711469
self.prev_voxel_num = 0
14721470

1473-
def _sample_points(self,
1474-
points: np.ndarray,
1475-
sampler: VoxelGenerator,
1471+
def _sample_points(self, points: np.ndarray, sampler: VoxelGenerator,
14761472
point_dim: int) -> np.ndarray:
14771473
"""Sample points for each points subset.
14781474

mmdet3d/models/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def build_segmentor(cfg, train_cfg=None, test_cfg=None):
9292

9393

9494
def build_model(cfg, train_cfg=None, test_cfg=None):
95-
"""A function warpper for building 3D detector or segmentor according to
95+
"""A function wrapper for building 3D detector or segmentor according to
9696
cfg.
9797
9898
Should be deprecated in the future.

mmdet3d/models/detectors/dynamic_voxelnet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
@MODELS.register_module()
1212
class DynamicVoxelNet(VoxelNet):
13-
r"""VoxelNet using `dynamic voxelization <https://arxiv.org/abs/1910.06528>`_.
13+
r"""VoxelNet using `dynamic voxelization
14+
<https://arxiv.org/abs/1910.06528>`_.
1415
"""
1516

1617
def __init__(self,

0 commit comments

Comments
 (0)