pybiolib 1.2.735__py3-none-any.whl → 1.2.744__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.
@@ -1,10 +1,31 @@
1
- from .typing import TypedDict
1
+ from .result import ResultDict
2
+ from .typing import Optional, TypedDict
2
3
 
3
4
 
4
- class ExperimentSlimDict(TypedDict):
5
+ class ResultCounts(TypedDict):
6
+ cancelled: int
7
+ completed: int
8
+ failed: int
9
+ in_progress: int
10
+ queued: int
11
+ total: int
12
+
13
+
14
+ class DeprecatedExperimentDict(TypedDict):
15
+ # Note: fields on this TypedDict are deprecated
5
16
  job_count: int
6
17
  job_running_count: int
7
18
 
8
19
 
9
- class ExperimentDetailedDict(ExperimentSlimDict):
20
+ class ExperimentDict(DeprecatedExperimentDict):
21
+ uuid: Optional[str]
22
+ name: Optional[str]
23
+ created_at: Optional[str]
24
+ finished_at: Optional[str]
25
+ last_created_at: Optional[str]
26
+ last_created_result: Optional[ResultDict]
27
+ result_counts: ResultCounts
28
+
29
+
30
+ class ExperimentDetailedDict(ExperimentDict):
10
31
  pass
@@ -1,6 +1,6 @@
1
1
  from .app import AppSlimDict
2
2
  from .data_record import DataRecordSlimDict
3
- from .experiment import ExperimentSlimDict
3
+ from .experiment import DeprecatedExperimentDict
4
4
  from .typing import Optional, TypedDict
5
5
 
6
6
 
@@ -15,4 +15,4 @@ class ResourceDict(TypedDict):
15
15
  class ResourceDetailedDict(ResourceDict):
16
16
  app: Optional[AppSlimDict]
17
17
  data_record: Optional[DataRecordSlimDict]
18
- experiment: Optional[ExperimentSlimDict]
18
+ experiment: Optional[DeprecatedExperimentDict]
@@ -0,0 +1,14 @@
1
+ from .typing import Optional, TypedDict
2
+
3
+
4
+ class ResultDict(TypedDict):
5
+ uuid: str
6
+ name: str
7
+ app_uri: str
8
+ created_at: str
9
+ state: str
10
+ finished_at: Optional[str]
11
+
12
+
13
+ class ResultDetailedDict(ResultDict):
14
+ pass
@@ -1,8 +1,9 @@
1
1
  import time
2
2
  from collections import OrderedDict
3
3
 
4
- import biolib._internal.types as _types
5
4
  from biolib import api
5
+ from biolib._internal.types.experiment import DeprecatedExperimentDict, ExperimentDict
6
+ from biolib._internal.types.resource import ResourceDetailedDict
6
7
  from biolib.biolib_errors import BioLibError
7
8
  from biolib.jobs.job import Job
8
9
  from biolib.jobs.types import JobsPaginatedResponse
@@ -22,8 +23,8 @@ class Experiment:
22
23
  }
23
24
  )
24
25
 
25
- def __init__(self, uri: str, _resource_dict: Optional[_types.ResourceDetailedDict] = None):
26
- self._resource_dict: _types.ResourceDetailedDict = _resource_dict or self._get_or_create_resource_dict(uri)
26
+ def __init__(self, uri: str, _resource_dict: Optional[ResourceDetailedDict] = None):
27
+ self._resource_dict: ResourceDetailedDict = _resource_dict or self._get_or_create_resource_dict(uri)
27
28
 
28
29
  def __enter__(self):
29
30
  Experiment._BIOLIB_EXPERIMENTS.append(self)
@@ -50,7 +51,7 @@ class Experiment:
50
51
  return self._resource_dict['uri']
51
52
 
52
53
  @property
53
- def _experiment_dict(self) -> _types.ExperimentSlimDict:
54
+ def _experiment_dict(self) -> DeprecatedExperimentDict:
54
55
  if not self._resource_dict['experiment']:
55
56
  raise ValueError(f'Resource {self.uri} is not an Experiment')
56
57
 
@@ -65,7 +66,8 @@ class Experiment:
65
66
  # Prints a table listing info about experiments accessible to the user
66
67
  @staticmethod
67
68
  def show_experiments(count: int = 25) -> None:
68
- experiment_dicts = api.client.get(path='/experiments/', params={'page_size': str(count)}).json()['results']
69
+ pagniated_response = api.client.get(path='/experiments/', params={'page_size': str(count)}).json()
70
+ experiment_dicts: List[ExperimentDict] = pagniated_response['results']
69
71
  BioLibTable(
70
72
  columns_to_row_map=Experiment._table_columns_to_row_map,
71
73
  rows=experiment_dicts,
@@ -75,7 +77,7 @@ class Experiment:
75
77
  @staticmethod
76
78
  def get_by_uri(uri: str) -> 'Experiment':
77
79
  query_param_key = 'uri' if '/' in uri else 'name'
78
- resource_dict: _types.ResourceDetailedDict = api.client.get('/resource/', params={query_param_key: uri}).json()
80
+ resource_dict: ResourceDetailedDict = api.client.get('/resource/', params={query_param_key: uri}).json()
79
81
  if not resource_dict['experiment']:
80
82
  raise ValueError(f'Resource {uri} is not an experiment')
81
83
 
@@ -200,15 +202,15 @@ class Experiment:
200
202
  self._refetch()
201
203
 
202
204
  @staticmethod
203
- def _get_resource_dict_by_uuid(uuid: str) -> _types.ResourceDetailedDict:
204
- resource_dict: _types.ResourceDetailedDict = api.client.get(f'/resources/{uuid}/').json()
205
+ def _get_resource_dict_by_uuid(uuid: str) -> ResourceDetailedDict:
206
+ resource_dict: ResourceDetailedDict = api.client.get(f'/resources/{uuid}/').json()
205
207
  if not resource_dict['experiment']:
206
208
  raise ValueError('Resource from URI is not an experiment')
207
209
 
208
210
  return resource_dict
209
211
 
210
212
  @staticmethod
211
- def _get_or_create_resource_dict(uri: str) -> _types.ResourceDetailedDict:
213
+ def _get_or_create_resource_dict(uri: str) -> ResourceDetailedDict:
212
214
  response_dict = api.client.post(path='/experiments/', data={'uri' if '/' in uri else 'name': uri}).json()
213
215
  return Experiment._get_resource_dict_by_uuid(uuid=response_dict['uuid'])
214
216
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pybiolib
3
- Version: 1.2.735
3
+ Version: 1.2.744
4
4
  Summary: BioLib Python Client
5
5
  License: MIT
6
6
  Keywords: biolib
@@ -25,11 +25,12 @@ biolib/_internal/tree_utils.py,sha256=_Q_6_NDtIiROcefymqxEVddjqti6Mt3OZ4U0GcDW61
25
25
  biolib/_internal/types/__init__.py,sha256=WvtlSHh77QhYVTLeRpoPAzqvByLzbEPf_ZqYGHFlQug,247
26
26
  biolib/_internal/types/app.py,sha256=Mz2QGD_jESX-K9JYnLWPo4YA__Q_1FQQTk9pvidCohU,118
27
27
  biolib/_internal/types/data_record.py,sha256=9r_vdhVs60YTnzU4XQFXfDrfS2P2MqD3BH2xa7lk6ck,852
28
- biolib/_internal/types/experiment.py,sha256=D94iBdn2nS92lRW-TOs1a2WKXJD5ZtmzL4ypggKX2ys,176
28
+ biolib/_internal/types/experiment.py,sha256=2SbCLSwgLglmQgyUHYb5SvO0Cfsgs-f3jqao9--Z_sY,682
29
29
  biolib/_internal/types/file_node.py,sha256=T6BIqo662f3nwMBRqtBHYsg6YuuUaKpiokHcVjv9_ME,283
30
- biolib/_internal/types/resource.py,sha256=uUI9Rt5ehkXv9NEDW9zsaPXiTXxnj811rSUW3g_joJw,437
30
+ biolib/_internal/types/resource.py,sha256=LQnIYBR8Fi7zvnA5vBpzcL2c6ZjpaKNTe38hXck82k0,449
31
31
  biolib/_internal/types/resource_permission.py,sha256=ZE7eokpzswAiqe4GdpdxdZ6_jl0LdiRD9gP81I8C3fY,292
32
32
  biolib/_internal/types/resource_version.py,sha256=cU0YFHqxO-wX_Y6CoeK0Iei61gFwVoyR_kPOSTQ4mCs,304
33
+ biolib/_internal/types/result.py,sha256=MesSTBXCkaw8HydXgHf1OKGVLzsxhZ1KV5z4w-VI-0M,231
33
34
  biolib/_internal/types/typing.py,sha256=qrsk8hHcGEbDpU1QQFzHAKnhQxkMe7uJ6pxHeAnfv1Y,414
34
35
  biolib/_internal/utils/__init__.py,sha256=p5vsIFyu-zYqBgdSMfwW9NC_jk7rXvvCbV4Bzd3As7c,630
35
36
  biolib/_internal/utils/multinode.py,sha256=-J3PEAK3NaOwCn--5T7vWHkA3yu5w9QhmuhkQcH-2wY,8229
@@ -109,7 +110,7 @@ biolib/compute_node/webserver/webserver_types.py,sha256=2t8EaFKESnves3BA_NBdnS2y
109
110
  biolib/compute_node/webserver/webserver_utils.py,sha256=XWvwYPbWNR3qS0FYbLLp-MDDfVk0QdaAmg3xPrT0H2s,4234
110
111
  biolib/compute_node/webserver/worker_thread.py,sha256=7uD9yQPhePYvP2HCJ27EeZ_h6psfIWFgqm1RHZxzobs,12483
111
112
  biolib/experiments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
- biolib/experiments/experiment.py,sha256=pBtnOHz0kKoFxlIGf08o8ZCEOze-CljwfOsTdhvCTCk,8646
113
+ biolib/experiments/experiment.py,sha256=31FfD88OsYZDWj5y3kVevTxlL7KJYICrvMxOivmqEM4,8785
113
114
  biolib/jobs/__init__.py,sha256=aIb2H2DHjQbM2Bs-dysFijhwFcL58Blp0Co0gimED3w,32
114
115
  biolib/jobs/job.py,sha256=X33-s9u8x3uZI0x_fSDgEFAW0ke-8Qi96M-VB-W29MA,26703
115
116
  biolib/jobs/job_result.py,sha256=rALHiKYNaC9lHi_JJqBob1RubzNLwG9Z386kwRJjd2M,5885
@@ -129,8 +130,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
129
130
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
130
131
  biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
131
132
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
132
- pybiolib-1.2.735.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
133
- pybiolib-1.2.735.dist-info/METADATA,sha256=JKPR2I_OJUwWhzlEtKfbGyCFL1Z7rBFBESDyO1DyRjs,1570
134
- pybiolib-1.2.735.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
135
- pybiolib-1.2.735.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
136
- pybiolib-1.2.735.dist-info/RECORD,,
133
+ pybiolib-1.2.744.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
134
+ pybiolib-1.2.744.dist-info/METADATA,sha256=P3UqZUDlG3cM1txzPN6teYWNjyWs9xNg92mJpbTFuZs,1570
135
+ pybiolib-1.2.744.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
136
+ pybiolib-1.2.744.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
137
+ pybiolib-1.2.744.dist-info/RECORD,,