Skip to content

Commit b21099f

Browse files
committed
chore: remove deprecated code and usage
1 parent 28b9403 commit b21099f

File tree

12 files changed

+3
-284
lines changed

12 files changed

+3
-284
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/sample_video.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ def add_basic_arguments(self, parser: argparse.ArgumentParser):
2828
type=float,
2929
required=False,
3030
)
31-
group.add_argument(
32-
"--video_duration_ratio",
33-
help="[DEPRECATED since v0.10.0] Real time video duration ratio of the under or oversampled video duration. [default: %(default)s]",
34-
type=float,
35-
default=constants.VIDEO_DURATION_RATIO,
36-
required=False,
37-
)
3831
group.add_argument(
3932
"--video_start_time",
4033
help="Video start time specified in YYYY_MM_DD_HH_MM_SS_sss in UTC. For example 2020_12_28_12_36_36_508 represents 2020-12-28T12:36:36.508Z.",

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/geo.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,6 @@ class PointWithFix(Point):
4646
gps_ground_speed: T.Optional[float]
4747

4848

49-
def _ecef_from_lla_DEPRECATED(
50-
lat: float, lon: float, alt: float
51-
) -> T.Tuple[float, float, float]:
52-
"""
53-
Deprecated because it is slow. Keep here for reference and comparison.
54-
Use _ecef_from_lla2 instead.
55-
56-
Compute ECEF XYZ from latitude, longitude and altitude.
57-
58-
All using the WGS94 model.
59-
Altitude is the distance to the WGS94 ellipsoid.
60-
Check results here http://www.oc.nps.edu/oc2902w/coord/llhxyz.htm
61-
62-
"""
63-
a2 = WGS84_a**2
64-
b2 = WGS84_b**2
65-
lat = math.radians(lat)
66-
lon = math.radians(lon)
67-
L = 1.0 / math.sqrt(a2 * math.cos(lat) ** 2 + b2 * math.sin(lat) ** 2)
68-
x = (a2 * L + alt) * math.cos(lat) * math.cos(lon)
69-
y = (a2 * L + alt) * math.cos(lat) * math.sin(lon)
70-
z = (b2 * L + alt) * math.sin(lat)
71-
return x, y, z
72-
73-
7449
def _ecef_from_lla2(lat: float, lon: float) -> T.Tuple[float, float, float]:
7550
"""
7651
Compute ECEF XYZ from latitude, longitude and altitude.

mapillary_tools/upload.py

Lines changed: 0 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
config,
1818
constants,
1919
exceptions,
20-
geo,
2120
history,
2221
ipc,
2322
types,
@@ -27,11 +26,8 @@
2726
VERSION,
2827
)
2928
from .geotag import (
30-
blackvue_parser,
3129
camm_builder,
32-
camm_parser,
3330
simple_mp4_builder,
34-
utils as video_utils,
3531
)
3632
from .types import FileType
3733

@@ -682,22 +678,6 @@ def upload(
682678
raise UploadError(ex) from ex
683679
LOG.debug("Uploaded to cluster: %s", cluster_id)
684680

685-
if DirectUploadFileType.RAW_BLACKVUE in filetypes:
686-
video_paths = utils.find_videos(
687-
import_paths,
688-
skip_subfolders=skip_subfolders,
689-
check_file_suffix=check_file_suffix,
690-
)
691-
_upload_raw_blackvues_DEPRECATED(mly_uploader, video_paths)
692-
693-
if DirectUploadFileType.RAW_CAMM in filetypes:
694-
video_paths = utils.find_videos(
695-
import_paths,
696-
skip_subfolders=skip_subfolders,
697-
check_file_suffix=check_file_suffix,
698-
)
699-
_upload_raw_camm_DEPRECATED(mly_uploader, video_paths)
700-
701681
if DirectUploadFileType.ZIP in filetypes:
702682
zip_paths = utils.find_zipfiles(
703683
import_paths,
@@ -743,111 +723,6 @@ def upload(
743723
LOG.info("Nothing uploaded. Bye.")
744724

745725

746-
def _check_blackvue_DEPRECATED(video_path: Path) -> None:
747-
# Skip in tests only because we don't have valid sample blackvue for tests
748-
if os.getenv("MAPILLARY__DISABLE_BLACKVUE_CHECK") == "YES":
749-
return
750-
751-
points = blackvue_parser.parse_gps_points(video_path)
752-
if not points:
753-
raise exceptions.MapillaryGPXEmptyError("No GPS found in the BlackVue video")
754-
755-
stationary = video_utils.is_video_stationary(
756-
geo.get_max_distance_from_start([(p.lat, p.lon) for p in points])
757-
)
758-
if stationary:
759-
raise exceptions.MapillaryStationaryVideoError("Stationary BlackVue video")
760-
761-
762-
def _upload_raw_blackvues_DEPRECATED(
763-
mly_uploader: uploader.Uploader,
764-
video_paths: T.Sequence[Path],
765-
) -> None:
766-
for idx, video_path in enumerate(video_paths):
767-
event_payload: uploader.Progress = {
768-
"total_sequence_count": len(video_paths),
769-
"sequence_idx": idx,
770-
"file_type": DirectUploadFileType.RAW_BLACKVUE.value,
771-
"import_path": str(video_path),
772-
}
773-
774-
try:
775-
_check_blackvue_DEPRECATED(video_path)
776-
except Exception as ex:
777-
LOG.warning(
778-
"Skipping %s %s due to: %s",
779-
DirectUploadFileType.RAW_BLACKVUE.value.upper(),
780-
video_path.name,
781-
ex,
782-
)
783-
continue
784-
785-
with video_path.open("rb") as fp:
786-
upload_md5sum = utils.md5sum_fp(fp).hexdigest()
787-
try:
788-
cluster_id = mly_uploader.upload_stream(
789-
fp,
790-
upload_api_v4.ClusterFileType.BLACKVUE,
791-
upload_md5sum,
792-
event_payload=event_payload,
793-
)
794-
except Exception as ex:
795-
raise UploadError(ex) from ex
796-
LOG.debug("Uploaded to cluster: %s", cluster_id)
797-
798-
799-
def _check_camm_DEPRECATED(video_path: Path) -> None:
800-
# Skip in tests only because we don't have valid sample CAMM for tests
801-
if os.getenv("MAPILLARY__DISABLE_CAMM_CHECK") == "YES":
802-
return
803-
804-
points = camm_parser.parse_gpx(video_path)
805-
if not points:
806-
raise exceptions.MapillaryGPXEmptyError("No GPS found in the CAMM video")
807-
808-
stationary = video_utils.is_video_stationary(
809-
geo.get_max_distance_from_start([(p.lat, p.lon) for p in points])
810-
)
811-
if stationary:
812-
raise exceptions.MapillaryStationaryVideoError("Stationary CAMM video")
813-
814-
815-
def _upload_raw_camm_DEPRECATED(
816-
mly_uploader: uploader.Uploader,
817-
video_paths: T.Sequence[Path],
818-
) -> None:
819-
for idx, video_path in enumerate(video_paths):
820-
event_payload: uploader.Progress = {
821-
"total_sequence_count": len(video_paths),
822-
"sequence_idx": idx,
823-
"file_type": DirectUploadFileType.RAW_CAMM.value,
824-
"import_path": str(video_path),
825-
}
826-
try:
827-
_check_camm_DEPRECATED(video_path)
828-
except Exception as ex:
829-
LOG.warning(
830-
"Skipping %s %s due to: %s",
831-
DirectUploadFileType.RAW_CAMM.value.upper(),
832-
video_path.name,
833-
ex,
834-
)
835-
continue
836-
try:
837-
with video_path.open("rb") as fp:
838-
upload_md5sum = utils.md5sum_fp(fp).hexdigest()
839-
cluster_id = mly_uploader.upload_stream(
840-
fp,
841-
upload_api_v4.ClusterFileType.CAMM,
842-
upload_md5sum,
843-
event_payload=event_payload,
844-
)
845-
except Exception as ex:
846-
raise UploadError(ex) from ex
847-
848-
LOG.debug("Uploaded to cluster: %s", cluster_id)
849-
850-
851726
def _upload_zipfiles(
852727
mly_uploader: uploader.Uploader,
853728
zip_paths: T.Sequence[Path],

tests/integration/test_process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222

2323

24-
PROCESS_FLAGS = "--add_import_date"
24+
PROCESS_FLAGS = ""
2525

2626
_DEFAULT_EXPECTED_DESCS = {
2727
"DSC00001.JPG": {

0 commit comments

Comments
 (0)