Skip to content

Commit

Permalink
apply black formatting and set pip to use correct black version
Browse files Browse the repository at this point in the history
  • Loading branch information
adivardi committed Apr 25, 2024
1 parent 4441f8d commit 1008e2e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
1 change: 1 addition & 0 deletions labelCloud/control/alignmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
three points on the plane that serves as the ground. Then the old point cloud will be
saved up and the aligned current will overwrite the old.
"""

import logging
from typing import TYPE_CHECKING, Optional

Expand Down
1 change: 1 addition & 0 deletions labelCloud/control/bbox_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Bounding Box Management: adding, selecting updating, deleting bboxes;
Possible Active Bounding Box Manipulations: rotation, translation, scaling
"""

import logging
from functools import wraps
from typing import TYPE_CHECKING, List, Optional
Expand Down
1 change: 1 addition & 0 deletions labelCloud/control/config_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Load configuration from .ini file."""

import configparser
from pathlib import Path
from typing import List, Union
Expand Down
6 changes: 3 additions & 3 deletions labelCloud/control/pcd_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Module to manage the point clouds (loading, navigation, floor alignment).
Sets the point cloud and original point cloud path. Initiate the writing to the virtual object buffer.
"""

import logging
from pathlib import Path
from shutil import copyfile
Expand Down Expand Up @@ -41,9 +42,8 @@ def __init__(self) -> None:

# Point cloud control
self.pointcloud: Optional[PointCloud] = None
self.collected_object_classes: Set[
str
] = set() # TODO: this should integrate with the new label definition setup.
# TODO: this should integrate with the new label definition setup.
self.collected_object_classes: Set[str] = set()
self.saved_perspective: Optional[Perspective] = None

@property
Expand Down
22 changes: 14 additions & 8 deletions labelCloud/model/point_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,19 +378,25 @@ def print_details(self) -> None:
print_column(
[
"Number of Points:",
green(len(self.points))
if len(self.points) > 0
else red(len(self.points)),
(
green(len(self.points))
if len(self.points) > 0
else red(len(self.points))
),
]
)
print_column(
[
"Number of Colors:",
yellow("None")
if self.colorless
else green(len(self.colors)) # type: ignore
if len(self.colors) == len(self.points) # type: ignore
else red(len(self.colors)), # type: ignore
(
yellow("None")
if self.colorless
else (
green(len(self.colors)) # type: ignore
if len(self.colors) == len(self.points) # type: ignore
else red(len(self.colors))
)
), # type: ignore
]
)
print_column(["Point Cloud Center:", str(np.round(self.center, 2))])
Expand Down
12 changes: 6 additions & 6 deletions labelCloud/utils/oglhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from ..model import BBox, PointCloud


DEVICE_PIXEL_RATIO: Optional[
float
] = None # is set once and for every window resize (retina display fix)
DEVICE_PIXEL_RATIO: Optional[float] = (
None # is set once and for every window resize (retina display fix)
)


def draw_points(
Expand Down Expand Up @@ -178,9 +178,9 @@ def get_intersected_sides(
p0, p1 = get_pick_ray(x, y, modelview, projection) # Calculate picking ray
vertices = bbox.get_vertices()

intersections: List[
Tuple[list, str]
] = list() # (intersection_point, bounding box side)
intersections: List[Tuple[list, str]] = (
list()
) # (intersection_point, bounding box side)
for side, indices in BBOX_SIDES.items():
# Calculate plane equation
pl1 = vertices[indices[0]] # point in plane
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pytest~=7.3.1
pytest-qt~=4.2.0

# Development
black~=23.1.0
black>=23.1.0
mypy~=1.3.0
PyQt5-stubs~=5.15.6
types-setuptools~=67.8.0
types-pkg-resources~=0.1.3
types-pkg-resources~=0.1.3

0 comments on commit 1008e2e

Please sign in to comment.