Skip to content

Commit

Permalink
chore: fix black formatting (#667)
Browse files Browse the repository at this point in the history
* chore: fix black formatting

* fix again
  • Loading branch information
ptpt authored Jan 30, 2024
1 parent b562167 commit 6cc9bf5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
8 changes: 5 additions & 3 deletions mapillary_tools/process_sequence_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,11 @@ def _interpolate_subsecs_for_sorting(sequence: PointSequence) -> None:

t = sequence[gidx].time
nt = min(
sequence[gidx + len(group)].time
if gidx + len(group) < len(sequence)
else math.floor(t + 1.0),
(
sequence[gidx + len(group)].time
if gidx + len(group) < len(sequence)
else math.floor(t + 1.0)
),
math.floor(t + 1.0),
)
assert t <= nt, f"expect sorted but got {t} > {nt}"
Expand Down
15 changes: 5 additions & 10 deletions mapillary_tools/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,18 +456,15 @@ def map_capture_time_to_datetime(time: str) -> datetime.datetime:


@T.overload
def as_desc(metadata: ImageMetadata) -> ImageDescription:
...
def as_desc(metadata: ImageMetadata) -> ImageDescription: ...


@T.overload
def as_desc(metadata: ErrorMetadata) -> ImageDescriptionError:
...
def as_desc(metadata: ErrorMetadata) -> ImageDescriptionError: ...


@T.overload
def as_desc(metadata: VideoMetadata) -> VideoDescription:
...
def as_desc(metadata: VideoMetadata) -> VideoDescription: ...


def as_desc(metadata):
Expand Down Expand Up @@ -524,13 +521,11 @@ def _as_image_desc(metadata: ImageMetadata) -> ImageDescription:


@T.overload
def from_desc(metadata: ImageDescription) -> ImageMetadata:
...
def from_desc(metadata: ImageDescription) -> ImageMetadata: ...


@T.overload
def from_desc(metadata: VideoDescription) -> VideoMetadata:
...
def from_desc(metadata: VideoDescription) -> VideoMetadata: ...


def from_desc(desc):
Expand Down
10 changes: 6 additions & 4 deletions mapillary_tools/video_data_extraction/extract_video_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ def process_file(self, file: Path) -> VideoMetadataOrError:
else:
return ErrorMetadata(
filename=file,
error=ex
if ex
else exceptions.MapillaryVideoGPSNotFoundError(
"No GPS data found from the video"
error=(
ex
if ex
else exceptions.MapillaryVideoGPSNotFoundError(
"No GPS data found from the video"
)
),
filetype=FileType.VIDEO,
)
Expand Down
8 changes: 5 additions & 3 deletions tests/cli/gps_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ def _gpx_track_segment_to_points(
lon=p.longitude,
alt=p.elevation,
angle=None,
gps_fix=gps_fix_map[p.type_of_gpx_fix]
if p.type_of_gpx_fix is not None
else None,
gps_fix=(
gps_fix_map[p.type_of_gpx_fix]
if p.type_of_gpx_fix is not None
else None
),
gps_precision=p.position_dilution,
gps_ground_speed=ground_speed,
)
Expand Down
8 changes: 5 additions & 3 deletions tests/cli/upload_api_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ def main():
user_access_token,
session_key,
entity_size,
chunk_size=int(parsed.chunk_size * 1024 * 1024)
if parsed.chunk_size is not None
else DEFAULT_CHUNK_SIZE,
chunk_size=(
int(parsed.chunk_size * 1024 * 1024)
if parsed.chunk_size is not None
else DEFAULT_CHUNK_SIZE
),
)
initial_offset = service.fetch_offset()

Expand Down

0 comments on commit 6cc9bf5

Please sign in to comment.