Skip to content

Commit 71c073a

Browse files
authored
chore: remove deprecated code and usage (#689)
* chore: remove deprecated code and usage * wip * usort * fix tests * always check file extensions * fix ruff format * check file extension for xml files
1 parent 8053f0a commit 71c073a

22 files changed

+101
-584
lines changed

mapillary_tools/commands/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
process_and_upload,
66
sample_video,
77
upload,
8-
upload_camm,
98
video_process,
109
video_process_and_upload,
1110
)

mapillary_tools/commands/__main__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
process_and_upload,
1313
sample_video,
1414
upload,
15-
upload_blackvue,
16-
upload_camm,
17-
upload_zip,
1815
video_process,
1916
video_process_and_upload,
2017
zip,
@@ -23,9 +20,6 @@
2320
mapillary_tools_commands = [
2421
process,
2522
upload,
26-
upload_camm,
27-
upload_blackvue,
28-
upload_zip,
2923
sample_video,
3024
video_process,
3125
authenticate,

mapillary_tools/commands/process.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,6 @@ def add_basic_arguments(self, parser: argparse.ArgumentParser):
107107
default=None,
108108
required=False,
109109
)
110-
group_metadata.add_argument(
111-
"--add_file_name",
112-
help="[DEPRECATED since v0.9.4] Add original file name to EXIF.",
113-
action="store_true",
114-
required=False,
115-
)
116-
group_metadata.add_argument(
117-
"--add_import_date",
118-
help="[DEPRECATED since v0.10.0] Add import date.",
119-
action="store_true",
120-
required=False,
121-
)
122110
group_metadata.add_argument(
123111
"--orientation",
124112
help="Specify the image orientation in degrees. Note this might result in image rotation. Note this input has precedence over the input read from the import source file.",
@@ -139,12 +127,6 @@ def add_basic_arguments(self, parser: argparse.ArgumentParser):
139127
default=None,
140128
required=False,
141129
)
142-
group_metadata.add_argument(
143-
"--custom_meta_data",
144-
help='[DEPRECATED since v0.10.0] Add custom meta data to all images. Required format of input is a string, consisting of the meta data name, type and value, separated by a comma for each entry, where entries are separated by semicolon. Supported types are long, double, string, boolean, date. Example for two meta data entries "random_name1,double,12.34;random_name2,long,1234".',
145-
default=None,
146-
required=False,
147-
)
148130

149131
group_geotagging = parser.add_argument_group(
150132
f"{constants.ANSI_BOLD}PROCESS GEOTAGGING OPTIONS{constants.ANSI_RESET_ALL}"

mapillary_tools/commands/upload.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import inspect
2-
import typing as T
32

43
from .. import constants
5-
from ..upload import DirectUploadFileType, FileType, upload
4+
from ..upload import upload
65

76

87
class Command:
@@ -34,30 +33,6 @@ def add_basic_arguments(self, parser):
3433
group = parser.add_argument_group(
3534
f"{constants.ANSI_BOLD}UPLOAD OPTIONS{constants.ANSI_RESET_ALL}"
3635
)
37-
default_filetypes = ",".join(sorted(t.value for t in FileType))
38-
supported_filetypes = ",".join(
39-
sorted(
40-
[t.value for t in DirectUploadFileType] + [t.value for t in FileType]
41-
)
42-
)
43-
44-
def _type(option: str) -> T.List[T.Union[FileType, DirectUploadFileType]]:
45-
r: T.List[T.Union[FileType, DirectUploadFileType]] = []
46-
for t in option.split(","):
47-
if t in [x.value for x in FileType]:
48-
r.append(FileType(t))
49-
else:
50-
r.append(DirectUploadFileType(t))
51-
return r
52-
53-
group.add_argument(
54-
"--filetypes",
55-
"--file_types",
56-
help=f"Upload files of the specified types only. Supported file types: {supported_filetypes} [default: %(default)s]",
57-
type=_type,
58-
default=default_filetypes,
59-
required=False,
60-
)
6136
group.add_argument(
6237
"--desc_path",
6338
help=f'Path to the description file generated by the process command. The hyphen "-" indicates STDIN. [default: {{IMPORT_PATH}}/{constants.IMAGE_DESCRIPTION_FILENAME}]',

mapillary_tools/commands/upload_blackvue.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

mapillary_tools/commands/upload_camm.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

mapillary_tools/commands/upload_zip.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

mapillary_tools/geotag/geotag_images_from_exiftool_both_image_and_video.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def to_description(self) -> T.List[types.ImageMetadataOrError]:
4848
video_paths = utils.find_videos(
4949
[Path(pathstr) for pathstr in rdf_description_by_path.keys()],
5050
skip_subfolders=True,
51-
check_file_suffix=True,
5251
)
5352

5453
# will try to geotag these error metadatas from video later

mapillary_tools/process_geotag_properties.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,8 @@ def process_geotag_properties(
206206

207207
metadatas: T.List[types.MetadataOrError] = []
208208

209-
# if more than one filetypes speficied, check filename suffixes,
210-
# i.e. files not ended with .jpg or .mp4 will be ignored
211-
check_file_suffix = len(filetypes) > 1
212-
213209
if FileType.IMAGE in filetypes:
214-
image_paths = utils.find_images(
215-
import_paths,
216-
skip_subfolders=skip_subfolders,
217-
check_file_suffix=check_file_suffix,
218-
)
210+
image_paths = utils.find_images(import_paths, skip_subfolders=skip_subfolders)
219211
if image_paths:
220212
image_metadatas = _process_images(
221213
image_paths,
@@ -240,9 +232,7 @@ def process_geotag_properties(
240232
or FileType.VIDEO in filetypes
241233
):
242234
video_paths = utils.find_videos(
243-
import_paths,
244-
skip_subfolders=skip_subfolders,
245-
check_file_suffix=check_file_suffix,
235+
import_paths, skip_subfolders=skip_subfolders
246236
)
247237
if video_paths:
248238
video_metadata = _process_videos(
@@ -289,7 +279,6 @@ def _process_videos_beta(vars_args: T.Dict):
289279
"num_processes": vars_args["num_processes"],
290280
"device_make": vars_args["device_make"],
291281
"device_model": vars_args["device_model"],
292-
"check_file_suffix": len(vars_args["filetypes"]) > 1,
293282
}
294283
extractor = VideoDataExtractor(options)
295284
return extractor.process()

mapillary_tools/process_import_meta_properties.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,8 @@ def process_import_meta_properties(
3131
device_make=None,
3232
device_model=None,
3333
GPS_accuracy=None,
34-
add_file_name=False,
35-
add_import_date=False,
36-
custom_meta_data=None,
3734
camera_uuid=None,
3835
) -> T.List[types.MetadataOrError]:
39-
if add_file_name:
40-
LOG.warning("The option --add_file_name is not needed any more since v0.10.0")
41-
42-
if add_import_date:
43-
LOG.warning("The option --add_import_date is not needed any more since v0.10.0")
44-
45-
if custom_meta_data:
46-
LOG.warning(
47-
"The option --custom_meta_data is not needed any more since v0.10.0"
48-
)
49-
5036
for metadata in metadatas:
5137
if isinstance(metadata, types.ErrorMetadata):
5238
continue

0 commit comments

Comments
 (0)