synapse-sdk 1.0.0a30__py3-none-any.whl → 1.0.0a31__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.

@@ -40,31 +40,27 @@ class BaseClient:
40
40
  headers = self._get_headers()
41
41
  headers.update(kwargs.pop('headers', {}))
42
42
 
43
+ # List to store opened files to close after request
44
+ opened_files = []
45
+
43
46
  if method in ['post', 'put', 'patch']:
44
47
  # If files are included in the request, open them as binary files
45
48
  if kwargs.get('files') is not None:
46
- opened_files = [] # List to store opened files
47
- try:
48
- for name, file in kwargs['files'].items():
49
- # If file is a path string, bind it as a Path object and open
50
- if isinstance(file, str):
51
- opened_file = open(Path(file), mode='rb')
52
- kwargs['files'][name] = opened_file
53
- opened_files.append(opened_file)
54
- # If file is a Path object, open it directly
55
- elif isinstance(file, Path):
56
- opened_file = open(file, mode='rb')
57
- kwargs['files'][name] = opened_file
58
- opened_files.append(opened_file)
59
- if 'data' in kwargs:
60
- for name, value in kwargs['data'].items():
61
- if isinstance(value, dict):
62
- kwargs['data'][name] = json.dumps(value)
63
- finally:
64
- # Close all opened files
65
- for opened_file in opened_files:
66
- opened_file.close()
67
-
49
+ for name, file in kwargs['files'].items():
50
+ # If file is a path string, bind it as a Path object and open
51
+ if isinstance(file, str):
52
+ opened_file = Path(file).open(mode='rb')
53
+ kwargs['files'][name] = opened_file
54
+ opened_files.append(opened_file)
55
+ # If file is a Path object, open it directly
56
+ elif isinstance(file, Path):
57
+ opened_file = file.open(mode='rb')
58
+ kwargs['files'][name] = opened_file
59
+ opened_files.append(opened_file)
60
+ if 'data' in kwargs:
61
+ for name, value in kwargs['data'].items():
62
+ if isinstance(value, dict):
63
+ kwargs['data'][name] = json.dumps(value)
68
64
  else:
69
65
  headers['Content-Type'] = 'application/json'
70
66
  if 'data' in kwargs:
@@ -79,6 +75,10 @@ class BaseClient:
79
75
  except requests.ConnectionError:
80
76
  raise ClientError(408, f'{self.name} is not responding')
81
77
 
78
+ # Close all opened files
79
+ for opened_file in opened_files:
80
+ opened_file.close()
81
+
82
82
  return self._post_response(response)
83
83
 
84
84
  def _post_response(self, response):
@@ -61,11 +61,8 @@ class ExportAction(Action):
61
61
  }
62
62
 
63
63
  def get_filtered_results(self):
64
- """Get filtered ground truth."""
65
- ground_truth_dataset_version = self.params['ground_truth_dataset_version']
66
- self.params['filter']['ground_truth_dataset'] = self.client.get_ground_truth_version(
67
- ground_truth_dataset_version
68
- )['ground_truth_dataset']
64
+ """Get filtered ground truth events."""
65
+ self.params['filter']['ground_truth_dataset_versions'] = self.params['ground_truth_dataset_version']
69
66
  filters = {'expand': 'data', **self.params['filter']}
70
67
 
71
68
  try:
@@ -51,7 +51,7 @@ class TrainParams(BaseModel):
51
51
  params={
52
52
  'ids_ex': action.job_id,
53
53
  'category': 'neural_net',
54
- 'action': 'train',
54
+ 'job__action': 'train',
55
55
  'is_active': True,
56
56
  'params': f'name:{value}',
57
57
  },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: synapse-sdk
3
- Version: 1.0.0a30
3
+ Version: 1.0.0a31
4
4
  Summary: synapse sdk
5
5
  Author-email: datamaker <developer@datamaker.io>
6
6
  License: MIT
@@ -21,7 +21,7 @@ synapse_sdk/cli/plugin/create.py,sha256=HpYTpohV1NbSrULaVUlc4jWLWznPrx7glgydTM3s
21
21
  synapse_sdk/cli/plugin/publish.py,sha256=sIl1wiuSC3lAUpE3rOF4UDKDy2G5EVLlelMjk2aT05g,1221
22
22
  synapse_sdk/cli/plugin/run.py,sha256=xz5LRm3zh8Y9DMjw5FFRFVRWSCWtYfZJskfCmrPikaQ,2598
23
23
  synapse_sdk/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- synapse_sdk/clients/base.py,sha256=l4_9BvqKykE9EiW9KygTRBf4tFUZLutG4CfwFIo2LRg,4710
24
+ synapse_sdk/clients/base.py,sha256=T-PR20BH0oPIelnR-owSGsjY_wG8yIie2opFjW_bskw,4589
25
25
  synapse_sdk/clients/exceptions.py,sha256=ylv7x10eOp4aA3a48jwonnvqvkiYwzJYXjkVkRTAjwk,220
26
26
  synapse_sdk/clients/utils.py,sha256=8pPJTdzHiRPSbZMoQYHAgR2BAMO6u_R_jMV6a2p34iQ,392
27
27
  synapse_sdk/clients/agent/__init__.py,sha256=Pz8_iTbIbnb7ywGJ3feqoZVmO2I3mEbwpWsISIxh0BU,1968
@@ -56,7 +56,7 @@ synapse_sdk/plugins/categories/data_validation/templates/plugin/__init__.py,sha2
56
56
  synapse_sdk/plugins/categories/data_validation/templates/plugin/validation.py,sha256=90I5boUpEXvO3mEuKKBs528ls2A4h8Iw4ReOID2h00Y,139
57
57
  synapse_sdk/plugins/categories/export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
58
  synapse_sdk/plugins/categories/export/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
- synapse_sdk/plugins/categories/export/actions/export.py,sha256=GNmsrJncf7WaxNfnN9I1sNiYYxMbqPhcbpnDcBQC1DM,3062
59
+ synapse_sdk/plugins/categories/export/actions/export.py,sha256=45hnvM3myFgRJyGpC_jpDu_VaDC-iaNCqy4DcH24eDU,2926
60
60
  synapse_sdk/plugins/categories/export/actions/utils.py,sha256=ixilT_VtgwtbX9kbBTrIybbAyW1kPLhNEkOHABKmZ88,131
61
61
  synapse_sdk/plugins/categories/export/templates/config.yaml,sha256=N7YmnFROb3s3M35SA9nmabyzoSb5O2t2TRPicwFNN2o,56
62
62
  synapse_sdk/plugins/categories/export/templates/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -69,7 +69,7 @@ synapse_sdk/plugins/categories/neural_net/actions/__init__.py,sha256=47DEQpj8HBS
69
69
  synapse_sdk/plugins/categories/neural_net/actions/deployment.py,sha256=Wmi7in_Mgizt1d5XcDR080h1CIMWKh2_mjub9N380qA,1917
70
70
  synapse_sdk/plugins/categories/neural_net/actions/inference.py,sha256=0a655ELqNVjPFZTJDiw4EUdcMCPGveUEKyoYqpwMFBU,1019
71
71
  synapse_sdk/plugins/categories/neural_net/actions/test.py,sha256=JY25eg-Fo6WbgtMkGoo_qNqoaZkp3AQNEypJmeGzEog,320
72
- synapse_sdk/plugins/categories/neural_net/actions/train.py,sha256=CBg8ky2-bvS5pZlzuf49HcdpyronHkSugwq0UeHhiKg,5401
72
+ synapse_sdk/plugins/categories/neural_net/actions/train.py,sha256=kve6iTCg2kUeavMQTR2JFuoYDu-QWZFFlB58ZICQtdM,5406
73
73
  synapse_sdk/plugins/categories/neural_net/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
74
  synapse_sdk/plugins/categories/neural_net/base/inference.py,sha256=R5DASI6-5vzsjDOYxqeGGMBjnav5qHF4hNJT8zNUR3I,1097
75
75
  synapse_sdk/plugins/categories/neural_net/templates/config.yaml,sha256=vSTHgKzi7sHzsuUvhOT001hzR6JBpPCue5nECmruEnI,433
@@ -123,9 +123,9 @@ synapse_sdk/utils/storage/providers/__init__.py,sha256=NM9yRIWcPkH53DeNHgIhH9zaD
123
123
  synapse_sdk/utils/storage/providers/gcp.py,sha256=i2BQCu1Kej1If9SuNr2_lEyTcr5M_ncGITZrL0u5wEA,363
124
124
  synapse_sdk/utils/storage/providers/s3.py,sha256=r94aUGVNf8yxihU0lN62yaXdxSS7P783_sfD-hCiK40,1191
125
125
  synapse_sdk/utils/storage/providers/sftp.py,sha256=TUQXkKJf0-fh8NhGC_1zzqI4autFNHZVCqngwkQ1aD4,523
126
- synapse_sdk-1.0.0a30.dist-info/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
127
- synapse_sdk-1.0.0a30.dist-info/METADATA,sha256=CZ9X66Gy-UkyIZic1g3FSh9kfCVJ-lWSkvON9qox20M,1138
128
- synapse_sdk-1.0.0a30.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
129
- synapse_sdk-1.0.0a30.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
130
- synapse_sdk-1.0.0a30.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
131
- synapse_sdk-1.0.0a30.dist-info/RECORD,,
126
+ synapse_sdk-1.0.0a31.dist-info/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
127
+ synapse_sdk-1.0.0a31.dist-info/METADATA,sha256=Fy5pk7TcwtwzXs8dCrEAF4yMyUa_eTLmsYvX3c90Q-o,1138
128
+ synapse_sdk-1.0.0a31.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
129
+ synapse_sdk-1.0.0a31.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
130
+ synapse_sdk-1.0.0a31.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
131
+ synapse_sdk-1.0.0a31.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (76.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5