synapse-sdk 1.0.0a52__py3-none-any.whl → 1.0.0a53__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 synapse-sdk might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  from synapse_sdk.clients.backend.annotation import AnnotationClientMixin
2
2
  from synapse_sdk.clients.backend.core import CoreClientMixin
3
- from synapse_sdk.clients.backend.dataset import DatasetClientMixin
3
+ from synapse_sdk.clients.backend.data_collection import DataCollectionClientMixin
4
4
  from synapse_sdk.clients.backend.hitl import HITLClientMixin
5
5
  from synapse_sdk.clients.backend.integration import IntegrationClientMixin
6
6
  from synapse_sdk.clients.backend.ml import MLClientMixin
@@ -9,7 +9,7 @@ from synapse_sdk.clients.backend.ml import MLClientMixin
9
9
  class BackendClient(
10
10
  AnnotationClientMixin,
11
11
  CoreClientMixin,
12
- DatasetClientMixin,
12
+ DataCollectionClientMixin,
13
13
  IntegrationClientMixin,
14
14
  MLClientMixin,
15
15
  HITLClientMixin,
@@ -8,18 +8,18 @@ from synapse_sdk.clients.base import BaseClient
8
8
  from synapse_sdk.clients.utils import get_batched_list
9
9
 
10
10
 
11
- class DatasetClientMixin(BaseClient):
12
- def list_dataset(self):
13
- path = 'datasets/'
11
+ class DataCollectionClientMixin(BaseClient):
12
+ def list_data_collection(self):
13
+ path = 'data_collections/'
14
14
  return self._list(path)
15
15
 
16
- def get_dataset(self, dataset_id):
17
- """Get dataset from synapse-backend.
16
+ def get_data_collection(self, data_collection_id):
17
+ """Get data_collection from synapse-backend.
18
18
 
19
19
  Args:
20
- dataset_id: The dataset id to get.
20
+ data_collection_id: The data_collection id to get.
21
21
  """
22
- path = f'datasets/{dataset_id}/?expand=file_specifications'
22
+ path = f'data_collections/{data_collection_id}/?expand=file_specifications'
23
23
  return self._get(path)
24
24
 
25
25
  def create_data_file(self, file_path: Path):
@@ -40,19 +40,19 @@ class DatasetClientMixin(BaseClient):
40
40
  path = 'data_units/'
41
41
  return self._post(path, data=data)
42
42
 
43
- def upload_dataset(
43
+ def upload_data_collection(
44
44
  self,
45
- dataset_id: int,
46
- dataset: Dict,
45
+ data_collection_id: int,
46
+ data_collection: Dict,
47
47
  project_id: Optional[int] = None,
48
48
  batch_size: int = 1000,
49
49
  process_pool: int = 10,
50
50
  ):
51
- """Upload dataset to synapse-backend.
51
+ """Upload data_collection to synapse-backend.
52
52
 
53
53
  Args:
54
- dataset_id: The dataset id to upload the data to.
55
- dataset: The dataset to upload.
54
+ data_collection_id: The data_collection id to upload the data to.
55
+ data_collection: The data_collection to upload.
56
56
  * structure:
57
57
  - files: The files to upload. (key: file name, value: file pathlib object)
58
58
  - meta: The meta data to upload.
@@ -60,14 +60,14 @@ class DatasetClientMixin(BaseClient):
60
60
  batch_size: The batch size to upload the data.
61
61
  process_pool: The process pool to upload the data.
62
62
  """
63
- # TODO validate dataset with schema
63
+ # TODO validate data_collection with schema
64
64
 
65
- params = [(data, dataset_id) for data in dataset]
65
+ params = [(data, data_collection_id) for data in data_collection]
66
66
 
67
67
  with Pool(processes=process_pool) as pool:
68
- dataset = pool.starmap(self.upload_data_file, tqdm(params))
68
+ data_collection = pool.starmap(self.upload_data_file, tqdm(params))
69
69
 
70
- batches = get_batched_list(dataset, batch_size)
70
+ batches = get_batched_list(data_collection, batch_size)
71
71
 
72
72
  for batch in tqdm(batches):
73
73
  data_units = self.create_data_units(batch)
@@ -82,7 +82,7 @@ class DatasetClientMixin(BaseClient):
82
82
 
83
83
  self.create_tasks(tasks_data)
84
84
 
85
- def upload_data_file(self, data: Dict, dataset_id: int) -> Dict:
85
+ def upload_data_file(self, data: Dict, data_collection_id: int) -> Dict:
86
86
  """Upload files to synapse-backend.
87
87
 
88
88
  Args:
@@ -90,13 +90,13 @@ class DatasetClientMixin(BaseClient):
90
90
  * structure:
91
91
  - files: The files to upload. (key: file name, value: file pathlib object)
92
92
  - meta: The meta data to upload.
93
- dataset_id: The dataset id to upload the data to.
93
+ data_collection_id: The data_collection id to upload the data to.
94
94
 
95
95
  Returns:
96
96
  Dict: The result of the upload.
97
97
  """
98
98
  for name, path in data['files'].items():
99
99
  data_file = self.create_data_file(path)
100
- data['dataset'] = dataset_id
100
+ data['data_collection'] = data_collection_id
101
101
  data['files'][name] = {'checksum': data_file['checksum'], 'path': str(path)}
102
102
  return data
@@ -45,7 +45,7 @@ class TaskPreAnnotationParams(BaseModel):
45
45
  action = info.context['action']
46
46
  client = action.client
47
47
  try:
48
- client.get_dataset(value)
48
+ client.get_data_collection(value)
49
49
  except ClientError:
50
50
  raise PydanticCustomError('client_error', 'Error occurred while checking data collection exists.')
51
51
  return value
@@ -129,7 +129,7 @@ class UploadParams(BaseModel):
129
129
  action = info.context['action']
130
130
  client = action.client
131
131
  try:
132
- client.get_dataset(value)
132
+ client.get_data_collection(value)
133
133
  except ClientError:
134
134
  raise PydanticCustomError('client_error', _('Error occurred while checking collection exists.'))
135
135
  return value
@@ -244,7 +244,7 @@ class UploadAction(Action):
244
244
 
245
245
  client = self.run.client
246
246
  collection_id = self.params['collection']
247
- collection = client.get_dataset(collection_id)
247
+ collection = client.get_data_collection(collection_id)
248
248
 
249
249
  # Finish progress
250
250
  self.run.set_progress(1, 1, category='analyze_collection')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synapse-sdk
3
- Version: 1.0.0a52
3
+ Version: 1.0.0a53
4
4
  Summary: synapse sdk
5
5
  Author-email: datamaker <developer@datamaker.io>
6
6
  License: MIT
@@ -28,10 +28,10 @@ synapse_sdk/clients/agent/__init__.py,sha256=Pz8_iTbIbnb7ywGJ3feqoZVmO2I3mEbwpWs
28
28
  synapse_sdk/clients/agent/core.py,sha256=x2jgORTjT7pJY67SLuc-5lMG6CD5OWpy8UgGeTf7IhA,270
29
29
  synapse_sdk/clients/agent/ray.py,sha256=JrwLyVOUDG2yYsbPrxyUtWbM-FWp9B6Bl_GdDby0rt8,1559
30
30
  synapse_sdk/clients/agent/service.py,sha256=s7KuPK_DB1nr2VHrigttV1WyFonaGHNrPvU8loRxHcE,478
31
- synapse_sdk/clients/backend/__init__.py,sha256=Fiehino2n3voaHTdpJHXSY7K_CDnMkQeokapbgeoTBk,1187
31
+ synapse_sdk/clients/backend/__init__.py,sha256=MC3pndBk-SPyW9L6WnrTozoub9-EK7auXFvPHCaxeFU,1209
32
32
  synapse_sdk/clients/backend/annotation.py,sha256=f4jS4qlXH7M7mQ3EuCq-NrjJ_hJNDz8pEFAYqf-e008,996
33
33
  synapse_sdk/clients/backend/core.py,sha256=5XAOdo6JZ0drfk-FMPJ96SeTd9oja-VnTwzGXdvK7Bg,1027
34
- synapse_sdk/clients/backend/dataset.py,sha256=11R5LuTva9jgXatxQAlKy7UEJmwIWzTsLVdFf3MZ9F8,3400
34
+ synapse_sdk/clients/backend/data_collection.py,sha256=kj9TurBAljK_mFF75oaazlqnL0bd6PHbgRfR3KyTUmI,3623
35
35
  synapse_sdk/clients/backend/hitl.py,sha256=na2mSXFud92p4zUEuagcDWk2klxO7xn-e86cm0VZEvs,709
36
36
  synapse_sdk/clients/backend/integration.py,sha256=9LjkYcBpi7aog-MODSDS4RlmYahypu65qxBj-AcY7xc,2683
37
37
  synapse_sdk/clients/backend/ml.py,sha256=JoPH9Ly2E3HJ7S5mdGLtcGq7ruQVVrYfWArogwZLlms,1193
@@ -100,8 +100,8 @@ synapse_sdk/plugins/categories/smart_tool/templates/plugin/__init__.py,sha256=47
100
100
  synapse_sdk/plugins/categories/smart_tool/templates/plugin/auto_label.py,sha256=eevNg0nOcYFR4z_L_R-sCvVOYoLWSAH1jwDkAf3YCjY,320
101
101
  synapse_sdk/plugins/categories/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
102
  synapse_sdk/plugins/categories/upload/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
103
- synapse_sdk/plugins/categories/upload/actions/task_pre_annotation.py,sha256=SehWN55Turhyv_GEBpetykvB4-mZnoDL0h5XlWszPe8,3058
104
- synapse_sdk/plugins/categories/upload/actions/upload.py,sha256=3qjuvH28BfMdBK2bOTo-GlqoF24eKPX10hFhha0-GEk,11278
103
+ synapse_sdk/plugins/categories/upload/actions/task_pre_annotation.py,sha256=YkQZ7QECu6-PnSEv2lAbbL3smxeIHxUiu9ruBdA0_0k,3066
104
+ synapse_sdk/plugins/categories/upload/actions/upload.py,sha256=xTO40dB00uE9xSQxnQYIyuZEvTzx99cSxfCOXLKZAsQ,11294
105
105
  synapse_sdk/plugins/categories/upload/templates/config.yaml,sha256=1O0kMfkFMGYwnpBcttrlC9bu4xzU9docw2MBOq_Elmo,417
106
106
  synapse_sdk/plugins/categories/upload/templates/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
107
  synapse_sdk/plugins/categories/upload/templates/plugin/task_pre_annotation.py,sha256=9XkUZu7USjVjDPufM0NlYmkdKfV7Hf_9v5GN1RgZzS0,350
@@ -136,9 +136,9 @@ synapse_sdk/utils/storage/providers/__init__.py,sha256=x7RGwZryT2FpVxS7fGWryRVpq
136
136
  synapse_sdk/utils/storage/providers/gcp.py,sha256=i2BQCu1Kej1If9SuNr2_lEyTcr5M_ncGITZrL0u5wEA,363
137
137
  synapse_sdk/utils/storage/providers/s3.py,sha256=W94rQvhGRXti3R4mYP7gmU5pcyCQpGFIBLvxxqLVdRM,2231
138
138
  synapse_sdk/utils/storage/providers/sftp.py,sha256=_8s9hf0JXIO21gvm-JVS00FbLsbtvly4c-ETLRax68A,1426
139
- synapse_sdk-1.0.0a52.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
140
- synapse_sdk-1.0.0a52.dist-info/METADATA,sha256=HXeyrqhs7vO8PtUOUf4hy7XREJYywB-Mq55s_Oa4CjQ,1303
141
- synapse_sdk-1.0.0a52.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
142
- synapse_sdk-1.0.0a52.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
143
- synapse_sdk-1.0.0a52.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
144
- synapse_sdk-1.0.0a52.dist-info/RECORD,,
139
+ synapse_sdk-1.0.0a53.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
140
+ synapse_sdk-1.0.0a53.dist-info/METADATA,sha256=QZFYv1IY06vc9HM-VCqi8aL3G4D54ruvDPUgX4RlRDg,1303
141
+ synapse_sdk-1.0.0a53.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
142
+ synapse_sdk-1.0.0a53.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
143
+ synapse_sdk-1.0.0a53.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
144
+ synapse_sdk-1.0.0a53.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5