pybiolib 1.2.517__py3-none-any.whl → 1.2.558__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.
- biolib/_internal/types/resource_version.py +9 -3
- biolib/_internal/types/typing.py +3 -0
- biolib/app/app.py +1 -1
- biolib/jobs/job.py +39 -1
- {pybiolib-1.2.517.dist-info → pybiolib-1.2.558.dist-info}/METADATA +2 -2
- {pybiolib-1.2.517.dist-info → pybiolib-1.2.558.dist-info}/RECORD +9 -9
- {pybiolib-1.2.517.dist-info → pybiolib-1.2.558.dist-info}/LICENSE +0 -0
- {pybiolib-1.2.517.dist-info → pybiolib-1.2.558.dist-info}/WHEEL +0 -0
- {pybiolib-1.2.517.dist-info → pybiolib-1.2.558.dist-info}/entry_points.txt +0 -0
@@ -1,7 +1,13 @@
|
|
1
|
-
from .typing import Literal, TypedDict
|
1
|
+
from .typing import Literal, NotRequired, TypedDict
|
2
2
|
|
3
3
|
|
4
|
-
class
|
4
|
+
class ResourceVersionDict(TypedDict):
|
5
|
+
uuid: str
|
5
6
|
semantic_version: str
|
6
7
|
state: Literal['published', 'unpublished']
|
7
|
-
|
8
|
+
created_at: str
|
9
|
+
git_branch_name: NotRequired[str]
|
10
|
+
|
11
|
+
|
12
|
+
class ResourceVersionDetailedDict(ResourceVersionDict):
|
13
|
+
pass
|
biolib/_internal/types/typing.py
CHANGED
@@ -5,3 +5,6 @@ from typing import * # noqa:F403 pylint: disable=wildcard-import, unused-wildca
|
|
5
5
|
|
6
6
|
if sys.version_info < (3, 8): # noqa: UP036
|
7
7
|
from typing_extensions import Literal, TypedDict # pylint: disable=unused-import
|
8
|
+
|
9
|
+
if sys.version_info < (3, 11): # noqa: UP036
|
10
|
+
from typing_extensions import NotRequired # pylint: disable=unused-import
|
biolib/app/app.py
CHANGED
@@ -108,7 +108,7 @@ class BioLibApp:
|
|
108
108
|
(utils.STREAM_STDOUT or stream_logs)
|
109
109
|
and (self._app_version.get('main_output_file') or self._app_version.get('stdout_render_type') == 'text')
|
110
110
|
)
|
111
|
-
job._stream_logs(enable_print=enable_print)
|
111
|
+
job._stream_logs(enable_print=enable_print) # pylint: disable=protected-access
|
112
112
|
|
113
113
|
if check:
|
114
114
|
exit_code = job.get_exit_code()
|
biolib/jobs/job.py
CHANGED
@@ -230,7 +230,35 @@ class Job:
|
|
230
230
|
except Exception as error:
|
231
231
|
raise BioLibError(f'Failed to rename job {self._uuid} due to: {error}') from error
|
232
232
|
|
233
|
-
def recompute(
|
233
|
+
def recompute(
|
234
|
+
self,
|
235
|
+
app_uri: Optional[str] = None,
|
236
|
+
machine: Optional[str] = None,
|
237
|
+
blocking: bool = True,
|
238
|
+
arguments: Optional[List[str]] = None,
|
239
|
+
) -> 'Job':
|
240
|
+
"""Recompute the job with the same input files but potentially different arguments.
|
241
|
+
|
242
|
+
Args:
|
243
|
+
app_uri (Optional[str], optional): The URI of the app to use for recomputation.
|
244
|
+
If None, uses the original app URI. Defaults to None.
|
245
|
+
machine (Optional[str], optional): The machine to run the job on.
|
246
|
+
If None, uses the original requested machine. Defaults to None.
|
247
|
+
blocking (bool, optional): Whether to block until the job completes.
|
248
|
+
If True, streams logs until completion. Defaults to True.
|
249
|
+
arguments (Optional[List[str]], optional): New arguments to use for the job.
|
250
|
+
If None, uses the original arguments. Defaults to None.
|
251
|
+
|
252
|
+
Returns:
|
253
|
+
Job: A new Job instance for the recomputed job.
|
254
|
+
|
255
|
+
Example::
|
256
|
+
>>> job = biolib.get_job("job_id")
|
257
|
+
>>> # Recompute with the same arguments
|
258
|
+
>>> new_job = job.recompute()
|
259
|
+
>>> # Recompute with different arguments
|
260
|
+
>>> new_job = job.recompute(arguments=["--new-arg", "value"])
|
261
|
+
"""
|
234
262
|
app_response = BiolibAppApi.get_by_uri(uri=app_uri or self._job_dict['app_uri'])
|
235
263
|
|
236
264
|
job_storage_input = RemoteJobStorageEndpoint(
|
@@ -241,6 +269,16 @@ class Job:
|
|
241
269
|
http_response = HttpClient.request(url=job_storage_input.get_remote_url())
|
242
270
|
module_input_serialized = http_response.content
|
243
271
|
|
272
|
+
# If arguments are provided, deserialize the module input, update the arguments, and serialize it again
|
273
|
+
if arguments is not None:
|
274
|
+
module_input = ModuleInput(module_input_serialized)
|
275
|
+
module_input_dict = module_input.deserialize()
|
276
|
+
|
277
|
+
# Create a new ModuleInput with updated arguments
|
278
|
+
module_input_serialized = ModuleInput().serialize(
|
279
|
+
stdin=module_input_dict['stdin'], arguments=arguments, files=module_input_dict['files']
|
280
|
+
)
|
281
|
+
|
244
282
|
original_requested_machine = (
|
245
283
|
self._job_dict['requested_machine'] if self._job_dict['requested_machine'] else None
|
246
284
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: pybiolib
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.558
|
4
4
|
Summary: BioLib Python Client
|
5
5
|
License: MIT
|
6
6
|
Keywords: biolib
|
@@ -26,7 +26,7 @@ Requires-Dist: gunicorn (>=20.1.0) ; extra == "compute-node"
|
|
26
26
|
Requires-Dist: importlib-metadata (>=1.6.1)
|
27
27
|
Requires-Dist: pyyaml (>=5.3.1)
|
28
28
|
Requires-Dist: rich (>=12.4.4)
|
29
|
-
Requires-Dist:
|
29
|
+
Requires-Dist: typing-extensions (>=4.1.0) ; python_version < "3.11"
|
30
30
|
Project-URL: Homepage, https://github.com/biolib
|
31
31
|
Description-Content-Type: text/markdown
|
32
32
|
|
@@ -21,15 +21,15 @@ biolib/_internal/types/data_record.py,sha256=9r_vdhVs60YTnzU4XQFXfDrfS2P2MqD3BH2
|
|
21
21
|
biolib/_internal/types/experiment.py,sha256=D94iBdn2nS92lRW-TOs1a2WKXJD5ZtmzL4ypggKX2ys,176
|
22
22
|
biolib/_internal/types/file_node.py,sha256=T6BIqo662f3nwMBRqtBHYsg6YuuUaKpiokHcVjv9_ME,283
|
23
23
|
biolib/_internal/types/resource.py,sha256=uUI9Rt5ehkXv9NEDW9zsaPXiTXxnj811rSUW3g_joJw,437
|
24
|
-
biolib/_internal/types/resource_version.py,sha256=
|
25
|
-
biolib/_internal/types/typing.py,sha256=
|
24
|
+
biolib/_internal/types/resource_version.py,sha256=cU0YFHqxO-wX_Y6CoeK0Iei61gFwVoyR_kPOSTQ4mCs,304
|
25
|
+
biolib/_internal/types/typing.py,sha256=qrsk8hHcGEbDpU1QQFzHAKnhQxkMe7uJ6pxHeAnfv1Y,414
|
26
26
|
biolib/_internal/utils/__init__.py,sha256=p5vsIFyu-zYqBgdSMfwW9NC_jk7rXvvCbV4Bzd3As7c,630
|
27
27
|
biolib/_internal/utils/multinode.py,sha256=-J3PEAK3NaOwCn--5T7vWHkA3yu5w9QhmuhkQcH-2wY,8229
|
28
28
|
biolib/_runtime/runtime.py,sha256=bZQ0m39R9jOBVAtlyvzDnOobKueOAQUCwMUZjDQnO7E,4439
|
29
29
|
biolib/api/__init__.py,sha256=mQ4u8FijqyLzjYMezMUUbbBGNB3iFmkNdjXnWPZ7Jlw,138
|
30
30
|
biolib/api/client.py,sha256=EN3lDbbgWxw3aPDe8W5XIU6WkMfOHW7Dmsz-R6QqxAw,4176
|
31
31
|
biolib/app/__init__.py,sha256=cdPtcfb_U-bxb9iSL4fCEq2rpD9OjkyY4W-Zw60B0LI,37
|
32
|
-
biolib/app/app.py,sha256
|
32
|
+
biolib/app/app.py,sha256=-Ed4wV3RSMIq7DgQqCHkzkooyr2RRzoUuOAtJRl3E5E,9622
|
33
33
|
biolib/app/search_apps.py,sha256=K4a41f5XIWth2BWI7OffASgIsD0ko8elCax8YL2igaY,1470
|
34
34
|
biolib/biolib_api_client/__init__.py,sha256=E5EMa19wJoblwSdQPYrxc_BtIeRsAuO0L_jQweWw-Yk,182
|
35
35
|
biolib/biolib_api_client/api_client.py,sha256=ohvbWbpresxLHFGPkvXACfmiTYsBk8RBx5XsBbLYg_M,7546
|
@@ -101,7 +101,7 @@ biolib/compute_node/webserver/worker_thread.py,sha256=7uD9yQPhePYvP2HCJ27EeZ_h6p
|
|
101
101
|
biolib/experiments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
102
102
|
biolib/experiments/experiment.py,sha256=pBtnOHz0kKoFxlIGf08o8ZCEOze-CljwfOsTdhvCTCk,8646
|
103
103
|
biolib/jobs/__init__.py,sha256=aIb2H2DHjQbM2Bs-dysFijhwFcL58Blp0Co0gimED3w,32
|
104
|
-
biolib/jobs/job.py,sha256=
|
104
|
+
biolib/jobs/job.py,sha256=vmALUOA9APqz0qTjmlisT6ChZHUwOaTlX-1VLhWJSrA,23176
|
105
105
|
biolib/jobs/job_result.py,sha256=rALHiKYNaC9lHi_JJqBob1RubzNLwG9Z386kwRJjd2M,5885
|
106
106
|
biolib/jobs/types.py,sha256=ezvaoTANsWazK6PmfpYcqezdfjP7MNBEBfqIZGoZhz8,997
|
107
107
|
biolib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -119,8 +119,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
|
|
119
119
|
biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
|
120
120
|
biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
|
121
121
|
biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
|
122
|
-
pybiolib-1.2.
|
123
|
-
pybiolib-1.2.
|
124
|
-
pybiolib-1.2.
|
125
|
-
pybiolib-1.2.
|
126
|
-
pybiolib-1.2.
|
122
|
+
pybiolib-1.2.558.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
123
|
+
pybiolib-1.2.558.dist-info/METADATA,sha256=QO2zAOtRMRujoLhdT7UcWJqp3xx5lssaGVTbpcH2R-M,1570
|
124
|
+
pybiolib-1.2.558.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
125
|
+
pybiolib-1.2.558.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
|
126
|
+
pybiolib-1.2.558.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|