supervisely 6.73.239__py3-none-any.whl → 6.73.240__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1056,6 +1056,7 @@ class FileApi(ModuleApiBase):
1056
1056
  team_id: int,
1057
1057
  paths: List[str],
1058
1058
  progress_cb: Optional[Union[tqdm, Callable]] = None,
1059
+ batch_size: int = 1000,
1059
1060
  ) -> None:
1060
1061
  """
1061
1062
  Removes list of files from Team Files.
@@ -1064,6 +1065,10 @@ class FileApi(ModuleApiBase):
1064
1065
  :type team_id: int
1065
1066
  :param paths: List of paths to Files in Team Files.
1066
1067
  :type paths: List[str]
1068
+ :param progress_cb: Function for tracking progress.
1069
+ :type progress_cb: tqdm or callable, optional
1070
+ :param batch_size: Number of files to remove in one request. Default is 1000. Maximum is 20000.
1071
+ :type batch_size: int
1067
1072
  :return: None
1068
1073
  :rtype: :class:`NoneType`
1069
1074
  :Usage example:
@@ -1081,13 +1086,22 @@ class FileApi(ModuleApiBase):
1081
1086
  "/999_App_Test/ds1/01588.json",
1082
1087
  "/999_App_Test/ds1/01587.json"
1083
1088
  ]
1084
- api.file.remove(8, paths_to_del)
1089
+ api.file.remove_batch(8, paths_to_del)
1085
1090
  """
1091
+ if batch_size > 20000:
1092
+ logger.warning(
1093
+ "Batch size is more than maximum and automatically reduced to 20000. "
1094
+ "If you get an error, try reducing the batch size."
1095
+ )
1096
+ batch_size = 20000
1097
+ elif batch_size < 100:
1098
+ logger.warning("Batch size is less than minimum and automatically increased to 100.")
1099
+ batch_size = 100
1086
1100
 
1087
- for paths_batch in batched(paths, batch_size=100):
1101
+ for paths_batch in batched(paths, batch_size=batch_size):
1088
1102
  for path in paths_batch:
1089
1103
  if self.is_on_agent(path) is True:
1090
- logger.warn(
1104
+ logger.warning(
1091
1105
  f"Data '{path}' is on agent. File skipped. Method does not support agent storage. Remove your data manually on the computer with agent."
1092
1106
  )
1093
1107
  paths_batch.remove(path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supervisely
3
- Version: 6.73.239
3
+ Version: 6.73.240
4
4
  Summary: Supervisely Python SDK.
5
5
  Home-page: https://github.com/supervisely/supervisely
6
6
  Author: Supervisely
@@ -25,7 +25,7 @@ supervisely/api/annotation_api.py,sha256=s9kd1G759R8YSvbDcNXrPa9xv95j1cWE1RgD6Xe
25
25
  supervisely/api/api.py,sha256=SI7DuSi2Jnj5NFS_V9aQ9Sg3CrS97Y5p1pqeeb-4Jb4,64729
26
26
  supervisely/api/app_api.py,sha256=-T4sISQ7POyR2yirf1kEWj4JaJFpJxCyRWqbf_99Jak,67036
27
27
  supervisely/api/dataset_api.py,sha256=2-SQBlgEnIN-0uvDbtPlSXr6ztBeZ3WPryhkOtpBmk4,40786
28
- supervisely/api/file_api.py,sha256=WMg80fxqMKOo3ai-IGON2w-IDAySPk90USoVk29JOdE,82415
28
+ supervisely/api/file_api.py,sha256=c4iIzH2BF8-GLFLk_wc9Qz225AbHhbzH22wv5HdsGg4,83128
29
29
  supervisely/api/github_api.py,sha256=NIexNjEer9H5rf5sw2LEZd7C1WR-tK4t6IZzsgeAAwQ,623
30
30
  supervisely/api/image_annotation_tool_api.py,sha256=YcUo78jRDBJYvIjrd-Y6FJAasLta54nnxhyaGyanovA,5237
31
31
  supervisely/api/image_api.py,sha256=_wXn10tKKCcfvTiQax0O2X9lnE54nXucwQHTjA1WbRM,169172
@@ -1019,9 +1019,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
1019
1019
  supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
1020
1020
  supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
1021
1021
  supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
1022
- supervisely-6.73.239.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1023
- supervisely-6.73.239.dist-info/METADATA,sha256=HB0zKoGrY2Re0c5UKMdxQxOJsynBYG73MkyJB1VuxPc,33277
1024
- supervisely-6.73.239.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
1025
- supervisely-6.73.239.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1026
- supervisely-6.73.239.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1027
- supervisely-6.73.239.dist-info/RECORD,,
1022
+ supervisely-6.73.240.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1023
+ supervisely-6.73.240.dist-info/METADATA,sha256=AIoj0IdizC_kg3QG2ExZsXz19mHqbh7qFPZF7OPO_nY,33277
1024
+ supervisely-6.73.240.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
1025
+ supervisely-6.73.240.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1026
+ supervisely-6.73.240.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1027
+ supervisely-6.73.240.dist-info/RECORD,,