datamint 1.9.0__py3-none-any.whl → 1.9.1__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.
Potentially problematic release.
This version of datamint might be problematic. Click here for more details.
- datamint/apihandler/root_api_handler.py +54 -11
- {datamint-1.9.0.dist-info → datamint-1.9.1.dist-info}/METADATA +1 -1
- {datamint-1.9.0.dist-info → datamint-1.9.1.dist-info}/RECORD +5 -5
- {datamint-1.9.0.dist-info → datamint-1.9.1.dist-info}/WHEEL +0 -0
- {datamint-1.9.0.dist-info → datamint-1.9.1.dist-info}/entry_points.txt +0 -0
|
@@ -429,8 +429,21 @@ class RootAPIHandler(BaseAPIHandler):
|
|
|
429
429
|
|
|
430
430
|
# Discard DICOM reports
|
|
431
431
|
if discard_dicom_reports:
|
|
432
|
-
files_path = [f for f in files_path if not is_dicom_report(f)]
|
|
433
432
|
old_size = len(files_path)
|
|
433
|
+
# Create filtered lists maintaining index correspondence
|
|
434
|
+
filtered_files = []
|
|
435
|
+
filtered_metadata = []
|
|
436
|
+
|
|
437
|
+
for i, f in enumerate(files_path):
|
|
438
|
+
if not is_dicom_report(f):
|
|
439
|
+
filtered_files.append(f)
|
|
440
|
+
if metadata is not None:
|
|
441
|
+
filtered_metadata.append(metadata[i])
|
|
442
|
+
|
|
443
|
+
files_path = filtered_files
|
|
444
|
+
if metadata is not None:
|
|
445
|
+
metadata = filtered_metadata
|
|
446
|
+
|
|
434
447
|
if old_size is not None and old_size != len(files_path):
|
|
435
448
|
_LOGGER.info(f"Discarded {old_size - len(files_path)} DICOM report files from upload.")
|
|
436
449
|
|
|
@@ -1099,16 +1112,46 @@ class RootAPIHandler(BaseAPIHandler):
|
|
|
1099
1112
|
"""
|
|
1100
1113
|
if isinstance(resource_ids, str):
|
|
1101
1114
|
resource_ids = [resource_ids]
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1115
|
+
|
|
1116
|
+
async def _delete_all_resources_async():
|
|
1117
|
+
async with aiohttp.ClientSession() as session:
|
|
1118
|
+
tasks = [
|
|
1119
|
+
self._delete_resource_async(resource_id, session)
|
|
1120
|
+
for resource_id in resource_ids
|
|
1121
|
+
]
|
|
1122
|
+
await asyncio.gather(*tasks)
|
|
1123
|
+
|
|
1124
|
+
loop = asyncio.get_event_loop()
|
|
1125
|
+
loop.run_until_complete(_delete_all_resources_async())
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
async def _delete_resource_async(self,
|
|
1129
|
+
resource_id: str,
|
|
1130
|
+
session: aiohttp.ClientSession | None = None) -> None:
|
|
1131
|
+
"""
|
|
1132
|
+
Asynchronously delete a resource by its unique id.
|
|
1133
|
+
|
|
1134
|
+
Args:
|
|
1135
|
+
resource_id (str): The resource unique id.
|
|
1136
|
+
session (aiohttp.ClientSession | None): The aiohttp session to use for the request.
|
|
1137
|
+
|
|
1138
|
+
Raises:
|
|
1139
|
+
ResourceNotFoundError: If the resource does not exist.
|
|
1140
|
+
"""
|
|
1141
|
+
if session is not None and not isinstance(session, aiohttp.ClientSession):
|
|
1142
|
+
raise ValueError("session must be an aiohttp.ClientSession object.")
|
|
1143
|
+
|
|
1144
|
+
url = f"{self._get_endpoint_url(RootAPIHandler.ENDPOINT_RESOURCES)}/{resource_id}"
|
|
1145
|
+
request_params = {
|
|
1146
|
+
'method': 'DELETE',
|
|
1147
|
+
'url': url
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
try:
|
|
1151
|
+
await self._run_request_async(request_params, session)
|
|
1152
|
+
except ResourceNotFoundError as e:
|
|
1153
|
+
e.set_params('resource', {'resource_id': resource_id})
|
|
1154
|
+
raise e
|
|
1112
1155
|
|
|
1113
1156
|
def get_datasets(self) -> list[dict]:
|
|
1114
1157
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: datamint
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.1
|
|
4
4
|
Summary: A library for interacting with the Datamint API, designed for efficient data management, processing and Deep Learning workflows.
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -4,7 +4,7 @@ datamint/apihandler/api_handler.py,sha256=cdVSddrFCKlF_BJ81LO1aJ0OP49rssjpNEFzJ6
|
|
|
4
4
|
datamint/apihandler/base_api_handler.py,sha256=GQuJS3FFjxPi-2vkJtbHeNKywoa-PWa3Qvw3NGRzxug,12206
|
|
5
5
|
datamint/apihandler/dto/annotation_dto.py,sha256=qId1RK1VO7dXrvGJ7dqJ31jBQB7Z8yy5x0tLSiMxTB4,7105
|
|
6
6
|
datamint/apihandler/exp_api_handler.py,sha256=hFUgUgBc5rL7odK7gTW3MnrvMY1pVfJUpUdzRNobMQE,6226
|
|
7
|
-
datamint/apihandler/root_api_handler.py,sha256=
|
|
7
|
+
datamint/apihandler/root_api_handler.py,sha256=yrd1CL6am9a40mIQig8jil2X2LA8I_Np1SmY5_p1jtw,60864
|
|
8
8
|
datamint/client_cmd_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
datamint/client_cmd_tools/datamint_config.py,sha256=md7dnWrbl10lPtXKbmD9yo6onLJsajeG8Vz0ZWH1v4M,8181
|
|
10
10
|
datamint/client_cmd_tools/datamint_upload.py,sha256=J62xBDTaLxwBFWDmuXhzgbmZfPWaAZLr7CKsbqgTI7U,31389
|
|
@@ -22,7 +22,7 @@ datamint/logging.yaml,sha256=a5dsATpul7QHeUHB2TjABFjWaPXBMbO--dgn8GlRqwk,483
|
|
|
22
22
|
datamint/utils/logging_utils.py,sha256=DvoA35ATYG3JTwfXEXYawDyKRfHeCrH0a9czfkmz8kM,1851
|
|
23
23
|
datamint/utils/torchmetrics.py,sha256=lwU0nOtsSWfebyp7dvjlAggaqXtj5ohSEUXOg3L0hJE,2837
|
|
24
24
|
datamint/utils/visualization.py,sha256=yaUVAOHar59VrGUjpAWv5eVvQSfztFG0eP9p5Vt3l-M,4470
|
|
25
|
-
datamint-1.9.
|
|
26
|
-
datamint-1.9.
|
|
27
|
-
datamint-1.9.
|
|
28
|
-
datamint-1.9.
|
|
25
|
+
datamint-1.9.1.dist-info/METADATA,sha256=Lz98qJH8boR1qaI50NHESTLOHdVi6qMLZwyYDh8ZId8,4100
|
|
26
|
+
datamint-1.9.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
27
|
+
datamint-1.9.1.dist-info/entry_points.txt,sha256=mn5H6jPjO-rY0W0CAZ6Z_KKWhMLvyVaSpoqk77jlTI4,145
|
|
28
|
+
datamint-1.9.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|