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

chore: fix black formatting #667

Merged
merged 2 commits into from
Jan 30, 2024
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
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
Loading