Skip to content
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

Nacho/add isort #137

Merged
merged 2 commits into from
Apr 9, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ repos:
rev: 8e52fb6506f169dddfaa87f88600d765fca48386
hooks:
- id: cmake-format
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--settings-path=python/pyproject.toml"]
10 changes: 5 additions & 5 deletions eval/kiss_icp_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from dataclasses import dataclass
from typing import Callable, Dict
from typing import List
from typing import Callable, Dict, List

from IPython.display import display_markdown
import matplotlib.pyplot as plt
import numpy as np
from evo.core.trajectory import PosePath3D
from evo.tools import plot
from evo.tools.settings import SETTINGS
from IPython.display import display_markdown

from kiss_icp.pipeline import OdometryPipeline
import matplotlib.pyplot as plt
import numpy as np


@dataclass
Expand Down
3 changes: 2 additions & 1 deletion python/kiss_icp/config/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
# SOFTWARE.
# NOTE: This module was contributed by Markus Pielmeier on PR #63
from __future__ import annotations

import importlib
from pathlib import Path
import sys
from pathlib import Path
from typing import Any, Dict, Optional

from pydantic import BaseSettings, PrivateAttr
Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/datasets/apollo.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import glob
import importlib
import os
from pathlib import Path
import sys
from pathlib import Path

import natsort
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/datasets/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import os
from pathlib import Path
import sys
from pathlib import Path

import natsort
import numpy as np
Expand Down
3 changes: 1 addition & 2 deletions python/kiss_icp/datasets/kitti_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from collections import namedtuple
import glob
import os
from collections import namedtuple
from pathlib import Path

import numpy as np


__raw_to_odometry_mapping__ = {
0: "2011_10_03/2011_10_03_drive_0027_sync/",
1: "2011_10_03/2011_10_03_drive_0042_sync/",
Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/datasets/mcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def __init__(self, data_dir: str, topic: str, *_, **__):
"""Standalone .mcap dataloader withouth any ROS distribution."""
# Conditional imports to avoid injecting dependencies for non mcap users
try:
from mcap_ros2.reader import read_ros2_messages
from mcap.reader import make_reader
from mcap_ros2.reader import read_ros2_messages
except ImportError as e:
print("mcap plugins not installed: 'pip install mcap-ros2-support'")
exit(1)
Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/datasets/ncd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
# SOFTWARE.
import importlib
import os
from pathlib import Path
import re
from pathlib import Path

import numpy as np
from pyquaternion import Quaternion
Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/datasets/nclt.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import os
from pathlib import Path
import sys
from pathlib import Path

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/datasets/nuscenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
# SOFTWARE.
import importlib
import os
from pathlib import Path
import sys
from pathlib import Path
from typing import List

import numpy as np
Expand Down
4 changes: 2 additions & 2 deletions python/kiss_icp/datasets/ouster.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import glob
import os
from typing import Optional

import numpy as np
import glob


def find_metadata_json(pcap_file: str) -> str:
Expand Down Expand Up @@ -83,8 +83,8 @@ def __init__(
"""

try:
from ouster import client
import ouster.pcap as pcap
from ouster import client
except ImportError:
print(f'ouster-sdk is not installed on your system, run "pip install ouster-sdk"')
exit(1)
Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/datasets/rosbag.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import os
from pathlib import Path
import sys
from pathlib import Path
from typing import Sequence

import natsort
Expand Down
3 changes: 2 additions & 1 deletion python/kiss_icp/datasets/tum.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
import importlib
import os
from pathlib import Path
from pyquaternion import Quaternion

import numpy as np
from pyquaternion import Quaternion


class TUMDataset:
Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/kiss_icp.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
from kiss_icp.config import KISSConfig
from kiss_icp.deskew import get_motion_compensator
from kiss_icp.mapping import get_voxel_hash_map
from kiss_icp.registration import register_frame
from kiss_icp.preprocess import get_preprocessor
from kiss_icp.registration import register_frame
from kiss_icp.threshold import get_threshold_estimator
from kiss_icp.voxelization import voxel_down_sample

Expand Down
3 changes: 2 additions & 1 deletion python/kiss_icp/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import numpy as np
from typing import Tuple

import numpy as np

from kiss_icp.config import KISSConfig
from kiss_icp.pybind import kiss_icp_pybind

Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import contextlib
import datetime
import os
from pathlib import Path
import time
from pathlib import Path
from typing import List, Optional

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
# SOFTWARE.
import numpy as np

from kiss_icp.pybind import kiss_icp_pybind
from kiss_icp.mapping import VoxelHashMap
from kiss_icp.pybind import kiss_icp_pybind


def register_frame(
Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/tools/point_cloud2.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
import numpy as np

try:
from rosbags.typesys.types import sensor_msgs__msg__PointField as PointField
from rosbags.typesys.types import sensor_msgs__msg__PointCloud2 as PointCloud2
from rosbags.typesys.types import sensor_msgs__msg__PointField as PointField
except ImportError as e:
raise ImportError('rosbags library not installed, run "pip install -U rosbags"') from e

Expand Down
4 changes: 2 additions & 2 deletions python/kiss_icp/tools/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from abc import ABC
import copy
from functools import partial
import importlib
import os
from abc import ABC
from functools import partial
from typing import Callable, List

import numpy as np
Expand Down