pybiolib 1.1.1747__py3-none-any.whl → 1.1.1881__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/__init__.py +8 -2
- biolib/_internal/data_record/__init__.py +1 -0
- biolib/_internal/data_record/data_record.py +153 -0
- biolib/_internal/data_record/remote_storage_endpoint.py +27 -0
- biolib/_internal/http_client.py +14 -15
- biolib/_internal/push_application.py +22 -37
- biolib/_internal/runtime.py +73 -0
- biolib/_internal/utils/__init__.py +18 -0
- biolib/app/app.py +6 -1
- biolib/app/search_apps.py +8 -12
- biolib/biolib_api_client/api_client.py +14 -9
- biolib/biolib_api_client/app_types.py +1 -0
- biolib/biolib_api_client/biolib_app_api.py +1 -1
- biolib/biolib_binary_format/utils.py +19 -2
- biolib/cli/__init__.py +6 -2
- biolib/cli/auth.py +58 -0
- biolib/cli/data_record.py +43 -0
- biolib/cli/download_container.py +3 -1
- biolib/cli/init.py +1 -0
- biolib/cli/lfs.py +39 -9
- biolib/cli/push.py +1 -1
- biolib/cli/run.py +3 -2
- biolib/cli/start.py +1 -0
- biolib/compute_node/cloud_utils/cloud_utils.py +2 -2
- biolib/compute_node/job_worker/cache_state.py +1 -1
- biolib/compute_node/job_worker/executors/docker_executor.py +9 -7
- biolib/compute_node/job_worker/job_worker.py +8 -2
- biolib/compute_node/remote_host_proxy.py +30 -2
- biolib/jobs/job.py +28 -29
- biolib/lfs/__init__.py +0 -2
- biolib/lfs/utils.py +23 -107
- biolib/runtime/__init__.py +13 -1
- biolib/sdk/__init__.py +17 -4
- biolib/user/sign_in.py +8 -12
- biolib/utils/__init__.py +1 -1
- biolib/utils/app_uri.py +11 -4
- biolib/utils/cache_state.py +2 -2
- biolib/utils/seq_util.py +15 -10
- {pybiolib-1.1.1747.dist-info → pybiolib-1.1.1881.dist-info}/METADATA +1 -1
- {pybiolib-1.1.1747.dist-info → pybiolib-1.1.1881.dist-info}/RECORD +43 -39
- {pybiolib-1.1.1747.dist-info → pybiolib-1.1.1881.dist-info}/WHEEL +1 -1
- biolib/biolib_api_client/biolib_account_api.py +0 -8
- biolib/biolib_api_client/biolib_large_file_system_api.py +0 -34
- biolib/runtime/results.py +0 -20
- {pybiolib-1.1.1747.dist-info → pybiolib-1.1.1881.dist-info}/LICENSE +0 -0
- {pybiolib-1.1.1747.dist-info → pybiolib-1.1.1881.dist-info}/entry_points.txt +0 -0
biolib/lfs/utils.py
CHANGED
@@ -1,30 +1,15 @@
|
|
1
1
|
import io
|
2
|
-
import json
|
3
2
|
import os
|
4
3
|
import zipfile as zf
|
5
|
-
from collections import namedtuple
|
6
4
|
from pathlib import Path
|
7
|
-
from struct import Struct
|
8
5
|
|
9
|
-
from biolib import utils
|
10
|
-
from biolib._internal.http_client import HttpClient
|
11
|
-
from biolib.app import BioLibApp
|
12
|
-
from biolib.biolib_api_client.biolib_account_api import BiolibAccountApi
|
13
|
-
from biolib.biolib_api_client.biolib_large_file_system_api import BiolibLargeFileSystemApi
|
6
|
+
from biolib import utils, api
|
14
7
|
from biolib.biolib_api_client import BiolibApiClient
|
8
|
+
from biolib.biolib_api_client.lfs_types import LargeFileSystem, LargeFileSystemVersion
|
15
9
|
from biolib.biolib_logging import logger
|
16
10
|
from biolib.biolib_errors import BioLibError
|
17
11
|
from biolib.typing_utils import List, Tuple, Iterator, Optional
|
18
|
-
from biolib.utils.
|
19
|
-
|
20
|
-
|
21
|
-
def _get_lfs_info_from_uri(lfs_uri):
|
22
|
-
lfs_uri_parts = lfs_uri.split('/')
|
23
|
-
lfs_uri_parts = [uri_part for uri_part in lfs_uri_parts if '@' not in uri_part] # Remove hostname
|
24
|
-
team_account_handle = lfs_uri_parts[0]
|
25
|
-
lfs_name = lfs_uri_parts[1]
|
26
|
-
account = BiolibAccountApi.fetch_by_handle(team_account_handle)
|
27
|
-
return account, lfs_name
|
12
|
+
from biolib.utils.app_uri import parse_app_uri
|
28
13
|
|
29
14
|
|
30
15
|
def get_files_and_size_of_directory(directory: str) -> Tuple[List[str], int]:
|
@@ -98,14 +83,23 @@ def get_iterable_zip_stream(files: List[str], chunk_size: int) -> Iterator[bytes
|
|
98
83
|
yield chunk
|
99
84
|
|
100
85
|
|
101
|
-
def create_large_file_system(lfs_uri: str):
|
86
|
+
def create_large_file_system(lfs_uri: str) -> str:
|
102
87
|
BiolibApiClient.assert_is_signed_in(authenticated_action_description='create a Large File System')
|
103
|
-
|
104
|
-
|
105
|
-
|
88
|
+
|
89
|
+
uri_parsed = parse_app_uri(lfs_uri)
|
90
|
+
response = api.client.post(
|
91
|
+
path='/lfs/',
|
92
|
+
data={
|
93
|
+
'account_handle': uri_parsed['account_handle_normalized'],
|
94
|
+
'name': uri_parsed['app_name'],
|
95
|
+
},
|
96
|
+
)
|
97
|
+
lfs: LargeFileSystem = response.json()
|
98
|
+
logger.info(f"Successfully created new Large File System '{lfs['uri']}'")
|
99
|
+
return lfs['uri']
|
106
100
|
|
107
101
|
|
108
|
-
def push_large_file_system(lfs_uri: str, input_dir: str, chunk_size_in_mb: Optional[int] = None) ->
|
102
|
+
def push_large_file_system(lfs_uri: str, input_dir: str, chunk_size_in_mb: Optional[int] = None) -> str:
|
109
103
|
BiolibApiClient.assert_is_signed_in(authenticated_action_description='push data to a Large File System')
|
110
104
|
|
111
105
|
if not os.path.isdir(input_dir):
|
@@ -114,8 +108,6 @@ def push_large_file_system(lfs_uri: str, input_dir: str, chunk_size_in_mb: Optio
|
|
114
108
|
if os.path.realpath(input_dir) == '/':
|
115
109
|
raise BioLibError('Pushing your root directory is not possible')
|
116
110
|
|
117
|
-
lfs_resource = BioLibApp(lfs_uri)
|
118
|
-
|
119
111
|
original_working_dir = os.getcwd()
|
120
112
|
os.chdir(input_dir)
|
121
113
|
files_to_zip, data_size_in_bytes = get_files_and_size_of_directory(directory=os.getcwd())
|
@@ -137,9 +129,8 @@ def push_large_file_system(lfs_uri: str, input_dir: str, chunk_size_in_mb: Optio
|
|
137
129
|
data_size_in_mb = round(data_size_in_bytes / 10 ** 6)
|
138
130
|
print(f'Zipping {len(files_to_zip)} files, in total ~{data_size_in_mb}mb of data')
|
139
131
|
|
140
|
-
|
141
|
-
|
142
|
-
|
132
|
+
response = api.client.post(path='/lfs/versions/', data={'resource_uri': lfs_uri})
|
133
|
+
lfs_version: LargeFileSystemVersion = response.json()
|
143
134
|
iterable_zip_stream = get_iterable_zip_stream(files=files_to_zip, chunk_size=chunk_size_in_bytes)
|
144
135
|
|
145
136
|
multipart_uploader = utils.MultiPartUploader(
|
@@ -147,91 +138,16 @@ def push_large_file_system(lfs_uri: str, input_dir: str, chunk_size_in_mb: Optio
|
|
147
138
|
get_presigned_upload_url_request=dict(
|
148
139
|
headers=None,
|
149
140
|
requires_biolib_auth=True,
|
150
|
-
path=f
|
141
|
+
path=f"/lfs/versions/{lfs_version['uuid']}/presigned_upload_url/",
|
151
142
|
),
|
152
143
|
complete_upload_request=dict(
|
153
144
|
headers=None,
|
154
145
|
requires_biolib_auth=True,
|
155
|
-
path=f
|
146
|
+
path=f"/lfs/versions/{lfs_version['uuid']}/complete_upload/",
|
156
147
|
),
|
157
148
|
)
|
158
149
|
|
159
150
|
multipart_uploader.upload(payload_iterator=iterable_zip_stream, payload_size_in_bytes=data_size_in_bytes)
|
160
|
-
logger.info(f"Successfully pushed a new LFS version '{lfs_resource_version['uri']}'")
|
161
151
|
os.chdir(original_working_dir)
|
162
|
-
|
163
|
-
|
164
|
-
def describe_large_file_system(lfs_uri: str, output_as_json: bool = False) -> None:
|
165
|
-
BiolibApiClient.assert_is_signed_in(authenticated_action_description='describe a Large File System')
|
166
|
-
lfs_resource = BioLibApp(lfs_uri)
|
167
|
-
lfs_version = BiolibLargeFileSystemApi.fetch_version(lfs_version_uuid=lfs_resource.version['public_id'])
|
168
|
-
|
169
|
-
files = []
|
170
|
-
total_size = 0
|
171
|
-
with RemoteZip(url=lfs_version['presigned_download_url']) as remote_zip:
|
172
|
-
central_directory = remote_zip.get_central_directory()
|
173
|
-
for file in central_directory.values():
|
174
|
-
files.append(dict(path=file['filename'], size_bytes=file['file_size']))
|
175
|
-
total_size += file['file_size']
|
176
|
-
|
177
|
-
lfs_version_metadata = dict(files=files, **lfs_version)
|
178
|
-
lfs_version_metadata['size_bytes'] = total_size
|
179
|
-
|
180
|
-
if output_as_json:
|
181
|
-
print(json.dumps(lfs_version_metadata, indent=4))
|
182
|
-
else:
|
183
|
-
print(f"Large File System {lfs_version_metadata['uri']}\ntotal {lfs_version_metadata['size_bytes']} bytes\n")
|
184
|
-
print('size bytes path')
|
185
|
-
for file in files:
|
186
|
-
size_string = str(file['size_bytes'])
|
187
|
-
leading_space_string = ' ' * (10 - len(size_string))
|
188
|
-
print(f"{leading_space_string}{size_string} {file['path']}")
|
189
|
-
|
190
|
-
|
191
|
-
def get_file_data_from_large_file_system(lfs_uri: str, file_path: str) -> bytes:
|
192
|
-
BiolibApiClient.assert_is_signed_in(authenticated_action_description='get file from a Large File System')
|
193
|
-
lfs_resource = BioLibApp(lfs_uri)
|
194
|
-
lfs_version = BiolibLargeFileSystemApi.fetch_version(lfs_version_uuid=lfs_resource.version['public_id'])
|
195
|
-
lfs_url = lfs_version['presigned_download_url']
|
196
|
-
|
197
|
-
with RemoteZip(lfs_url) as remote_zip:
|
198
|
-
central_directory = remote_zip.get_central_directory()
|
199
|
-
if file_path not in central_directory:
|
200
|
-
raise Exception('File not found in Large File System')
|
201
|
-
|
202
|
-
file_info = central_directory[file_path]
|
203
|
-
|
204
|
-
local_file_header_signature_bytes = b'\x50\x4b\x03\x04'
|
205
|
-
local_file_header_struct = Struct('<H2sHHHIIIHH')
|
206
|
-
LocalFileHeader = namedtuple('LocalFileHeader', (
|
207
|
-
'version',
|
208
|
-
'flags',
|
209
|
-
'compression_raw',
|
210
|
-
'mod_time',
|
211
|
-
'mod_date',
|
212
|
-
'crc_32_expected',
|
213
|
-
'compressed_size_raw',
|
214
|
-
'uncompressed_size_raw',
|
215
|
-
'file_name_len',
|
216
|
-
'extra_field_len',
|
217
|
-
))
|
218
|
-
|
219
|
-
local_file_header_start = file_info['header_offset'] + len(local_file_header_signature_bytes)
|
220
|
-
local_file_header_end = local_file_header_start + local_file_header_struct.size
|
221
|
-
|
222
|
-
local_file_header_response = HttpClient.request(
|
223
|
-
url=lfs_url,
|
224
|
-
headers={'range': f'bytes={local_file_header_start}-{local_file_header_end - 1}'},
|
225
|
-
timeout_in_seconds=300,
|
226
|
-
)
|
227
|
-
local_file_header = LocalFileHeader._make(local_file_header_struct.unpack(local_file_header_response.content))
|
228
|
-
|
229
|
-
file_start = local_file_header_end + local_file_header.file_name_len + local_file_header.extra_field_len
|
230
|
-
file_end = file_start + file_info['file_size']
|
231
|
-
|
232
|
-
response = HttpClient.request(
|
233
|
-
url=lfs_url,
|
234
|
-
headers={'range': f'bytes={file_start}-{file_end - 1}'},
|
235
|
-
timeout_in_seconds=300, # timeout after 5 min
|
236
|
-
)
|
237
|
-
return response.content
|
152
|
+
logger.info(f"Successfully pushed a new LFS version '{lfs_version['uri']}'")
|
153
|
+
return lfs_version['uri']
|
biolib/runtime/__init__.py
CHANGED
@@ -1 +1,13 @@
|
|
1
|
-
|
1
|
+
import warnings
|
2
|
+
from biolib.sdk import Runtime as _Runtime
|
3
|
+
|
4
|
+
|
5
|
+
def set_main_result_prefix(result_prefix: str) -> None:
|
6
|
+
warnings.warn(
|
7
|
+
'The "biolib.runtime.set_main_result_prefix" function is deprecated. '
|
8
|
+
'It will be removed in future releases from mid 2024. '
|
9
|
+
'Please use "from biolib.sdk import Runtime" and then "Runtime.set_main_result_prefix" instead.',
|
10
|
+
DeprecationWarning,
|
11
|
+
stacklevel=2,
|
12
|
+
)
|
13
|
+
_Runtime.set_main_result_prefix(result_prefix)
|
biolib/sdk/__init__.py
CHANGED
@@ -1,24 +1,33 @@
|
|
1
|
+
# Imports to hide and use as private internal utils
|
2
|
+
from biolib._internal.data_record import DataRecord as _DataRecord
|
1
3
|
from biolib._internal.push_application import push_application as _push_application
|
2
4
|
from biolib._internal.push_application import set_app_version_as_active as _set_app_version_as_active
|
3
|
-
|
4
5
|
from biolib.app import BioLibApp as _BioLibApp
|
6
|
+
from biolib.typing_utils import Optional as _Optional
|
7
|
+
|
8
|
+
# Imports to expose as public API
|
9
|
+
from biolib._internal.runtime import Runtime
|
10
|
+
|
5
11
|
|
6
12
|
def push_app_version(uri: str, path: str) -> _BioLibApp:
|
7
13
|
push_data = _push_application(
|
8
14
|
app_uri=uri,
|
9
15
|
app_path=path,
|
10
16
|
app_version_to_copy_images_from=None,
|
11
|
-
is_dev_version=True
|
17
|
+
is_dev_version=True,
|
18
|
+
)
|
12
19
|
uri = f'{push_data["app_uri"]}:{push_data["sematic_version"]}'
|
13
20
|
return _BioLibApp(uri)
|
14
21
|
|
22
|
+
|
15
23
|
def set_app_version_as_default(app_version: _BioLibApp) -> None:
|
16
24
|
app_version_uuid = app_version.version['public_id']
|
17
25
|
_set_app_version_as_active(app_version_uuid)
|
18
26
|
|
27
|
+
|
19
28
|
def get_app_version_pytest_plugin(app_version: _BioLibApp):
|
20
29
|
try:
|
21
|
-
import pytest
|
30
|
+
import pytest # type: ignore # pylint: disable=import-outside-toplevel,import-error
|
22
31
|
except BaseException:
|
23
32
|
raise Exception('Failed to import pytest; please make sure it is installed') from None
|
24
33
|
|
@@ -27,7 +36,11 @@ def get_app_version_pytest_plugin(app_version: _BioLibApp):
|
|
27
36
|
self.app_version_ref = app_version_ref
|
28
37
|
|
29
38
|
@pytest.fixture(scope='session')
|
30
|
-
def app_version(self, request):
|
39
|
+
def app_version(self, request): # pylint: disable=unused-argument
|
31
40
|
return self.app_version_ref
|
32
41
|
|
33
42
|
return AppVersionFixturePlugin(app_version)
|
43
|
+
|
44
|
+
|
45
|
+
def create_data_record(destination: str, data_path: str, name: _Optional[str] = None) -> _DataRecord:
|
46
|
+
return _DataRecord.create(destination, data_path, name)
|
biolib/user/sign_in.py
CHANGED
@@ -1,19 +1,11 @@
|
|
1
1
|
import time
|
2
|
-
import
|
2
|
+
import webbrowser
|
3
3
|
|
4
4
|
from biolib.biolib_api_client import BiolibApiClient
|
5
5
|
from biolib.biolib_api_client.auth import BiolibAuthChallengeApi
|
6
6
|
from biolib.biolib_logging import logger_no_user_data
|
7
7
|
from biolib.utils import IS_RUNNING_IN_NOTEBOOK
|
8
|
-
|
9
|
-
|
10
|
-
def _open_browser_window(url_to_open: str) -> None:
|
11
|
-
from IPython.display import display, Javascript, update_display # type:ignore # pylint: disable=import-error, import-outside-toplevel
|
12
|
-
|
13
|
-
display_id = str(uuid.uuid4())
|
14
|
-
display(Javascript(f'window.open("{url_to_open}");'), display_id=display_id)
|
15
|
-
time.sleep(1)
|
16
|
-
update_display(Javascript(''), display_id=display_id)
|
8
|
+
from biolib._internal.utils import open_browser_window_from_notebook
|
17
9
|
|
18
10
|
|
19
11
|
def sign_out() -> None:
|
@@ -21,7 +13,7 @@ def sign_out() -> None:
|
|
21
13
|
api_client.sign_out()
|
22
14
|
|
23
15
|
|
24
|
-
def sign_in() -> None:
|
16
|
+
def sign_in(open_in_default_browser: bool = False) -> None:
|
25
17
|
api_client = BiolibApiClient.get()
|
26
18
|
if api_client.is_signed_in:
|
27
19
|
logger_no_user_data.info('Already signed in')
|
@@ -37,7 +29,11 @@ def sign_in() -> None:
|
|
37
29
|
if IS_RUNNING_IN_NOTEBOOK:
|
38
30
|
print(f'Opening authorization page at: {frontend_sign_in_url}')
|
39
31
|
print('If your browser does not open automatically, click on the link above.')
|
40
|
-
|
32
|
+
open_browser_window_from_notebook(frontend_sign_in_url)
|
33
|
+
elif open_in_default_browser:
|
34
|
+
print(f'Opening authorization page at: {frontend_sign_in_url}')
|
35
|
+
print('If your browser does not open automatically, click on the link above.')
|
36
|
+
webbrowser.open(frontend_sign_in_url)
|
41
37
|
else:
|
42
38
|
print('Please copy and paste the following link into your browser:')
|
43
39
|
print(frontend_sign_in_url)
|
biolib/utils/__init__.py
CHANGED
@@ -4,9 +4,9 @@ import os
|
|
4
4
|
import socket
|
5
5
|
import sys
|
6
6
|
|
7
|
-
from typing import Optional
|
8
7
|
from importlib_metadata import version, PackageNotFoundError
|
9
8
|
|
9
|
+
from biolib.typing_utils import Optional
|
10
10
|
from biolib.utils.seq_util import SeqUtil, SeqUtilRecord
|
11
11
|
from biolib._internal.http_client import HttpClient
|
12
12
|
from biolib.biolib_logging import logger_no_user_data, logger
|
biolib/utils/app_uri.py
CHANGED
@@ -12,17 +12,18 @@ class SemanticVersion(TypedDict):
|
|
12
12
|
|
13
13
|
class AppUriParsed(TypedDict):
|
14
14
|
account_handle_normalized: str
|
15
|
-
app_name_normalized: str
|
15
|
+
app_name_normalized: Optional[str]
|
16
|
+
app_name: Optional[str]
|
16
17
|
resource_name_prefix: Optional[str]
|
17
18
|
version: Optional[SemanticVersion]
|
18
19
|
|
19
20
|
|
20
|
-
def normalize(string):
|
21
|
+
def normalize(string: str) -> str:
|
21
22
|
return string.replace('-', '_').lower()
|
22
23
|
|
23
24
|
|
24
25
|
# Mainly copied from backend
|
25
|
-
def parse_app_uri(uri: str) -> AppUriParsed:
|
26
|
+
def parse_app_uri(uri: str, use_account_as_name_default: bool = True) -> AppUriParsed:
|
26
27
|
uri_regex = r'^(@(?P<resource_name_prefix>[\w._-]+)/)?(?P<account_handle>[\w-]+)(/(?P<app_name>[\w-]+))?' \
|
27
28
|
r'(:(?P<version>(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)))?$'
|
28
29
|
|
@@ -36,12 +37,18 @@ def parse_app_uri(uri: str) -> AppUriParsed:
|
|
36
37
|
app_name: Optional[str] = matches.group('app_name')
|
37
38
|
|
38
39
|
# Default to account_handle if app_name is not supplied
|
39
|
-
|
40
|
+
if app_name:
|
41
|
+
app_name_normalized = normalize(app_name)
|
42
|
+
elif use_account_as_name_default:
|
43
|
+
app_name_normalized = account_handle_normalized
|
44
|
+
else:
|
45
|
+
app_name_normalized = None
|
40
46
|
|
41
47
|
return AppUriParsed(
|
42
48
|
resource_name_prefix=resource_name_prefix.lower() if resource_name_prefix is not None else 'biolib.com',
|
43
49
|
account_handle_normalized=account_handle_normalized,
|
44
50
|
app_name_normalized=app_name_normalized,
|
51
|
+
app_name=app_name if app_name is not None or not use_account_as_name_default else account_handle_normalized,
|
45
52
|
version=None if not matches.group('version') else SemanticVersion(
|
46
53
|
major=int(matches.group('major')),
|
47
54
|
minor=int(matches.group('minor')),
|
biolib/utils/cache_state.py
CHANGED
@@ -10,7 +10,7 @@ from biolib.biolib_errors import BioLibError
|
|
10
10
|
from biolib.biolib_logging import logger_no_user_data
|
11
11
|
from biolib.typing_utils import Optional, Generic, TypeVar
|
12
12
|
|
13
|
-
StateType = TypeVar('StateType')
|
13
|
+
StateType = TypeVar('StateType') # pylint: disable=invalid-name
|
14
14
|
|
15
15
|
|
16
16
|
class CacheStateError(BioLibError):
|
@@ -37,7 +37,7 @@ class CacheState(abc.ABC, Generic[StateType]):
|
|
37
37
|
def _state_lock_path(self) -> str:
|
38
38
|
return f'{self._state_path}.lock'
|
39
39
|
|
40
|
-
def __init__(self):
|
40
|
+
def __init__(self) -> None:
|
41
41
|
self._state: Optional[StateType] = None
|
42
42
|
|
43
43
|
def __enter__(self) -> StateType:
|
biolib/utils/seq_util.py
CHANGED
@@ -3,16 +3,21 @@ from io import BufferedIOBase
|
|
3
3
|
from biolib.typing_utils import List, Optional, Dict, Union
|
4
4
|
|
5
5
|
allowed_sequence_chars = set("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.")
|
6
|
+
|
7
|
+
|
6
8
|
def find_invalid_sequence_characters(sequence):
|
7
9
|
invalid_chars = [char for char in sequence if char not in allowed_sequence_chars]
|
8
10
|
return invalid_chars
|
9
11
|
|
12
|
+
|
10
13
|
class SeqUtilRecord:
|
11
|
-
def __init__(
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
def __init__(
|
15
|
+
self,
|
16
|
+
sequence: str,
|
17
|
+
sequence_id: str,
|
18
|
+
description: Optional['str'],
|
19
|
+
properties: Optional[Dict[str, str]] = None,
|
20
|
+
):
|
16
21
|
self.sequence = sequence
|
17
22
|
self.id = sequence_id # pylint: disable=invalid-name
|
18
23
|
self.description = description
|
@@ -33,11 +38,11 @@ class SeqUtilRecord:
|
|
33
38
|
class SeqUtil:
|
34
39
|
@staticmethod
|
35
40
|
def parse_fasta(
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
+
input_file: Union[str, BufferedIOBase, None] = None,
|
42
|
+
default_header: Optional[str] = None,
|
43
|
+
allow_any_sequence_characters: bool = False,
|
44
|
+
allow_empty_sequence: bool = False,
|
45
|
+
file_name: Optional[str] = None,
|
41
46
|
) -> List[SeqUtilRecord]:
|
42
47
|
if input_file is None:
|
43
48
|
if file_name:
|
@@ -1,22 +1,25 @@
|
|
1
1
|
LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
2
2
|
README.md,sha256=_IH7pxFiqy2bIAmaVeA-iVTyUwWRjMIlfgtUbYTtmls,368
|
3
|
-
biolib/__init__.py,sha256=
|
3
|
+
biolib/__init__.py,sha256=nfZvVkrHZLvjvvlAvFzhvem9NMfqgmw8NWaCH9HGzew,4045
|
4
4
|
biolib/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
biolib/_internal/
|
6
|
-
biolib/_internal/
|
5
|
+
biolib/_internal/data_record/__init__.py,sha256=1Bk303i3rFet9veS56fIsrBYtT5X3n9vcsYMA6T6c5o,36
|
6
|
+
biolib/_internal/data_record/data_record.py,sha256=oQ2R7bD1on5aPC3jXP7OOSPeuXkWEqRUR8GV4a6hsJA,6539
|
7
|
+
biolib/_internal/data_record/remote_storage_endpoint.py,sha256=LPq8Lr5FhKF9_o5K-bUdT7TeLe5XFUD0AAeTkNEVZug,1133
|
8
|
+
biolib/_internal/http_client.py,sha256=cSBIzh00x2HL3BmLxt_GvDI7bWQMNytv_wOy7EXg8kI,4064
|
9
|
+
biolib/_internal/push_application.py,sha256=H1PGNtVJ0vRC0li39gFMpPpjm6QeZ8Ob-7cLkLmxS_Y,10009
|
10
|
+
biolib/_internal/runtime.py,sha256=un18gmB2wFOXVjKca1Oe6mZI-xGydz8C8seScNvnC2s,2197
|
11
|
+
biolib/_internal/utils/__init__.py,sha256=p5vsIFyu-zYqBgdSMfwW9NC_jk7rXvvCbV4Bzd3As7c,630
|
7
12
|
biolib/api/__init__.py,sha256=iIO8ZRdn7YDhY5cR47-Wo1YsNOK8H6RN6jn8yor5WJI,137
|
8
13
|
biolib/api/client.py,sha256=MtDkH2Amr2Fko-bCR5DdookJu0yZ1q-6K_PPg4KK_Ek,2941
|
9
14
|
biolib/app/__init__.py,sha256=cdPtcfb_U-bxb9iSL4fCEq2rpD9OjkyY4W-Zw60B0LI,37
|
10
|
-
biolib/app/app.py,sha256=
|
11
|
-
biolib/app/search_apps.py,sha256=
|
15
|
+
biolib/app/app.py,sha256=r63gDoH1s8uQOGITmiKOVIrYDYdMrB5nwXHNRt2Da2M,10197
|
16
|
+
biolib/app/search_apps.py,sha256=K4a41f5XIWth2BWI7OffASgIsD0ko8elCax8YL2igaY,1470
|
12
17
|
biolib/biolib_api_client/__init__.py,sha256=E5EMa19wJoblwSdQPYrxc_BtIeRsAuO0L_jQweWw-Yk,182
|
13
|
-
biolib/biolib_api_client/api_client.py,sha256=
|
14
|
-
biolib/biolib_api_client/app_types.py,sha256=
|
18
|
+
biolib/biolib_api_client/api_client.py,sha256=J03jRVvod1bgwwAZ3BZVKlUSJi43-ev2DUB0j63GZpc,7189
|
19
|
+
biolib/biolib_api_client/app_types.py,sha256=rEw4HICV7ujdmlzM3BjRcMNMbiYItliivpH0rkeJx4s,2465
|
15
20
|
biolib/biolib_api_client/auth.py,sha256=kjm0ZHnH3I8so3su2sZbBxNHYp-ZUdrZ5lwQ0K36RSw,949
|
16
|
-
biolib/biolib_api_client/
|
17
|
-
biolib/biolib_api_client/biolib_app_api.py,sha256=vPFoONWh-i-Bg7pm_x50EQqbN9qQFLgNDTkkWKqDUTY,4248
|
21
|
+
biolib/biolib_api_client/biolib_app_api.py,sha256=DndlVxrNTes6DOaWyMINLGZQCRMWVvR7gwt5HVlyf5Y,4240
|
18
22
|
biolib/biolib_api_client/biolib_job_api.py,sha256=IpFahcRzm7GNy8DJ-XHYe-x7r4Voba8o22IXw5puHn8,6782
|
19
|
-
biolib/biolib_api_client/biolib_large_file_system_api.py,sha256=p8QhvQ0aI0NJgyRm7duqDVtPx0zrVaSLKS22ocOafFQ,1038
|
20
23
|
biolib/biolib_api_client/common_types.py,sha256=RH-1KNHqUF-EkTpfPOSTt5Mq1GPdfju_cqXDesscO1I,123
|
21
24
|
biolib/biolib_api_client/job_types.py,sha256=XlDIxijxymLoJcClXhl91h1E4b2fT3pszO9wjlssD4A,1284
|
22
25
|
biolib/biolib_api_client/lfs_types.py,sha256=xaGjE-yUyNVM3LyKdslJn5ZXWp6_kVCd4o-ch8Czfm4,227
|
@@ -32,41 +35,43 @@ biolib/biolib_binary_format/saved_job.py,sha256=nFHVFRNTNcAFGODLSiBntCtMk55QKwre
|
|
32
35
|
biolib/biolib_binary_format/stdout_and_stderr.py,sha256=WfUUJFFCBrtfXjuWIaRPiWCpuBLxfko68oxoTKhrwx8,1023
|
33
36
|
biolib/biolib_binary_format/system_exception.py,sha256=T3iL4_cSHAHim3RSDPS8Xyb1mfteaJBZonSXuRltc28,853
|
34
37
|
biolib/biolib_binary_format/system_status_update.py,sha256=aOELuQ0k-GtpaZTUxYd0GFomP_OInmrK585y6fuQuKE,1191
|
35
|
-
biolib/biolib_binary_format/utils.py,sha256=
|
38
|
+
biolib/biolib_binary_format/utils.py,sha256=1mZFX6KtbhvAXnzxnMJC_rYkiAjh9zhV31l68wVpA4A,4150
|
36
39
|
biolib/biolib_docker_client/__init__.py,sha256=aBfA6mtWSI5dBEfNNMD6bIZzCPloW4ghKm0wqQiljdo,1481
|
37
40
|
biolib/biolib_download_container.py,sha256=8TmBV8iv3bCvkNlHa1SSsc4zl0wX_eaxhfnW5rvFIh8,1779
|
38
41
|
biolib/biolib_errors.py,sha256=5m4lK2l39DafpoXBImEBD4EPH3ayXBX0JgtPzmGClow,689
|
39
42
|
biolib/biolib_logging.py,sha256=J3E5H_LL5k6ZUim2C8gqN7E6lCBZMTpO4tnMpOPwG9U,2854
|
40
|
-
biolib/cli/__init__.py,sha256=
|
41
|
-
biolib/cli/
|
42
|
-
biolib/cli/
|
43
|
-
biolib/cli/
|
44
|
-
biolib/cli/
|
45
|
-
biolib/cli/
|
43
|
+
biolib/cli/__init__.py,sha256=0v3c_J-U0k46c5ZWeQjLG_kTaKDJm81LBxQpDO2B_aI,1286
|
44
|
+
biolib/cli/auth.py,sha256=wp-JQRzDgiEbxeUTxwlHfugk-9u6PiOtZiHl9brAgcA,2050
|
45
|
+
biolib/cli/data_record.py,sha256=piN3QUbRAkMi4wpayghN4unFfuiNE5VCjI1gag4d8qg,1725
|
46
|
+
biolib/cli/download_container.py,sha256=HIZVHOPmslGE5M2Dsp9r2cCkAEJx__vcsDz5Wt5LRos,483
|
47
|
+
biolib/cli/init.py,sha256=wQOfii_au-d30Hp7DdH-WVw-WVraKvA_zY4za1w7DE8,821
|
48
|
+
biolib/cli/lfs.py,sha256=S9Ov-HWwtpMeRcwclh0qItnzviOaQL4aI0nnaCcZ_MM,3771
|
49
|
+
biolib/cli/push.py,sha256=TFi7O9tJ3zFe0VmtVTV3Vh9_xIMHnrc41xxcaBKU46g,813
|
50
|
+
biolib/cli/run.py,sha256=BbvXLQ-XibjQ71Y2d4URMH_8dflNVwM0i3TIWhw_u_c,1634
|
46
51
|
biolib/cli/runtime.py,sha256=Xv-nrma5xX8NidWcvbUKcUvuN5TCarZa4A8mPVmF-z0,361
|
47
|
-
biolib/cli/start.py,sha256=
|
52
|
+
biolib/cli/start.py,sha256=rg8VVY8rboFhf1iQo3zE3WA5oh_R1VWWfYJEO1gMReY,1737
|
48
53
|
biolib/compute_node/.gitignore,sha256=GZdZ4g7HftqfOfasFpBC5zV1YQAbht1a7EzcXD6f3zg,45
|
49
54
|
biolib/compute_node/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
50
55
|
biolib/compute_node/cloud_utils/__init__.py,sha256=VZSScLqaz5tg_gpMvWgwkAu9Qf-vgW_QHRoDOaAmU44,67
|
51
|
-
biolib/compute_node/cloud_utils/cloud_utils.py,sha256=
|
56
|
+
biolib/compute_node/cloud_utils/cloud_utils.py,sha256=KIZjBnZPBtHParrR_KnRl7N343sHXMQugH9lkwAwTFk,7621
|
52
57
|
biolib/compute_node/job_worker/__init__.py,sha256=ipdPWaABKYrltxny15e2kK8PWdEE7VzXbkKK6wM_zDk,71
|
53
|
-
biolib/compute_node/job_worker/cache_state.py,sha256=
|
58
|
+
biolib/compute_node/job_worker/cache_state.py,sha256=MwjSRzcJJ_4jybqvBL4xdgnDYSIiw4s90pNn83Netoo,4830
|
54
59
|
biolib/compute_node/job_worker/cache_types.py,sha256=ajpLy8i09QeQS9dEqTn3T6NVNMY_YsHQkSD5nvIHccQ,818
|
55
60
|
biolib/compute_node/job_worker/docker_image_cache.py,sha256=ansHIkJIq_EMW1nZNlW-RRLVVeKWTbzNICYaOHpKiRE,7460
|
56
61
|
biolib/compute_node/job_worker/executors/__init__.py,sha256=bW6t1qi3PZTlHM4quaTLa8EI4ALTCk83cqcVJfJfJfE,145
|
57
|
-
biolib/compute_node/job_worker/executors/docker_executor.py,sha256=
|
62
|
+
biolib/compute_node/job_worker/executors/docker_executor.py,sha256=ezXRhVBW5dYpLJjM2m5Qf-I6PrrNeBdEYjApjo7XVso,26419
|
58
63
|
biolib/compute_node/job_worker/executors/docker_types.py,sha256=VhsU1DKtJjx_BbCkVmiPZPH4ROiL1ygW1Y_s1Kbpa2o,216
|
59
64
|
biolib/compute_node/job_worker/executors/tars/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
60
65
|
biolib/compute_node/job_worker/executors/types.py,sha256=yP5gG39hr-DLnw9bOE--VHi-1arDbIYiGuV1rlTbbHI,1466
|
61
66
|
biolib/compute_node/job_worker/job_legacy_input_wait_timeout_thread.py,sha256=_cvEiZbOwfkv6fYmfrvdi_FVviIEYr_dSClQcOQaUWM,1198
|
62
67
|
biolib/compute_node/job_worker/job_max_runtime_timer_thread.py,sha256=K_xgz7IhiIjpLlXRk8sqaMyLoApcidJkgu29sJX0gb8,1174
|
63
68
|
biolib/compute_node/job_worker/job_storage.py,sha256=Ol43f43W6aD2EUkA6G2i9-WxdREr5JPSjo1xFylddOQ,4030
|
64
|
-
biolib/compute_node/job_worker/job_worker.py,sha256=
|
69
|
+
biolib/compute_node/job_worker/job_worker.py,sha256=QifGpDBn1ojJ5b43--XyXmz8YqsgNlGskh-z8mkYQqg,28147
|
65
70
|
biolib/compute_node/job_worker/large_file_system.py,sha256=XXqRlVtYhs-Ji9zQGIk5KQPXFO_Q5jJH0nnlw4GkeMY,10461
|
66
71
|
biolib/compute_node/job_worker/mappings.py,sha256=Z48Kg4nbcOvsT2-9o3RRikBkqflgO4XeaWxTGz-CNvI,2499
|
67
72
|
biolib/compute_node/job_worker/utilization_reporter_thread.py,sha256=7tm5Yk9coqJ9VbEdnO86tSXI0iM0omwIyKENxdxiVXk,8575
|
68
73
|
biolib/compute_node/job_worker/utils.py,sha256=wgxcIA8yAhUPdCwyvuuJ0JmreyWmmUoBO33vWtG60xg,1282
|
69
|
-
biolib/compute_node/remote_host_proxy.py,sha256=
|
74
|
+
biolib/compute_node/remote_host_proxy.py,sha256=spjYghbqwX3dFrmedGvXZGXEsnwop1IbbyrXTv1PWz0,15080
|
70
75
|
biolib/compute_node/socker_listener_thread.py,sha256=T5_UikA3MB9bD5W_dckYLPTgixh72vKUlgbBvj9dbM0,1601
|
71
76
|
biolib/compute_node/socket_sender_thread.py,sha256=YgamPHeUm2GjMFGx8qk-99WlZhEs-kAb3q_2O6qByig,971
|
72
77
|
biolib/compute_node/utils.py,sha256=M7i_WTyxbFM3Lri9RWZ_8FeQNYrQIWpKGLfp2I55oeY,4677
|
@@ -80,29 +85,28 @@ biolib/experiments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
80
85
|
biolib/experiments/experiment.py,sha256=xUd3LkV5ztFIjTx_ehBu8e-flvfuQnYimFtPj1upzb0,5942
|
81
86
|
biolib/experiments/types.py,sha256=n9GxdFA7cLMfHvLLqLmZzX31ELeSSkMXFoEEdFsdWGY,171
|
82
87
|
biolib/jobs/__init__.py,sha256=aIb2H2DHjQbM2Bs-dysFijhwFcL58Blp0Co0gimED3w,32
|
83
|
-
biolib/jobs/job.py,sha256=
|
88
|
+
biolib/jobs/job.py,sha256=_lYtqaTrtq3ayDvnaB9RuUMBTxCRKYGKVADUd473pWQ,15718
|
84
89
|
biolib/jobs/job_result.py,sha256=8GasUmUXD8SjUYrE2N-HrDx7-AI6TEkFONH8H91t01Q,4913
|
85
90
|
biolib/jobs/types.py,sha256=4OAvlhOKANzFMrZDd-mhXpEd8RaKcx8sPneZUoWhJ2U,970
|
86
|
-
biolib/lfs/__init__.py,sha256=
|
91
|
+
biolib/lfs/__init__.py,sha256=Qv8vdYeK43JecT4SsE93ZYE2VmNiZENdNpW8P9-omxs,115
|
87
92
|
biolib/lfs/cache.py,sha256=pQS2np21rdJ6I3DpoOutnzPHpLOZgUIS8TMltUJk_k4,2226
|
88
|
-
biolib/lfs/utils.py,sha256=
|
89
|
-
biolib/runtime/__init__.py,sha256=
|
90
|
-
biolib/
|
91
|
-
biolib/sdk/__init__.py,sha256=vqqE2Sf3gLySkaJv8VgWtPRkYMi9hOf66y9Ay2waYVE,1339
|
93
|
+
biolib/lfs/utils.py,sha256=HSs7F2wXklYhhv5tabfaeC5noXJyxRjbGD5IhWOVdxs,5918
|
94
|
+
biolib/runtime/__init__.py,sha256=x1Ivydtu9TFTaX-Cofg_kGA-TI0zLon-ccrFiiVgBok,492
|
95
|
+
biolib/sdk/__init__.py,sha256=77IBthMbwgmYymjQwLP4ny1X2ikvI1I0ocP6Eyzfyaw,1766
|
92
96
|
biolib/tables.py,sha256=acH7VjwAbadLo8P84FSnKEZxCTVsF5rEg9VPuxElNs8,872
|
93
97
|
biolib/templates/__init__.py,sha256=Yx62sSyDCDesRQDQgmbDsLpfgEh93fWE8r9u4g2azXk,36
|
94
98
|
biolib/templates/example_app.py,sha256=EB3E3RT4SeO_ii5nVQqJpi5KDGNE_huF1ub-e5ZFveE,715
|
95
99
|
biolib/typing_utils.py,sha256=krMhxB3SedVQA3HXIrC7DBXWpHKWN5JNmXGcSrrysOc,263
|
96
100
|
biolib/user/__init__.py,sha256=Db5wtxLfFz3ID9TULSSTo77csw9tO6RtxMRvV5cqKEE,39
|
97
|
-
biolib/user/sign_in.py,sha256=
|
98
|
-
biolib/utils/__init__.py,sha256=
|
99
|
-
biolib/utils/app_uri.py,sha256=
|
100
|
-
biolib/utils/cache_state.py,sha256=
|
101
|
+
biolib/user/sign_in.py,sha256=q-E2B3wLVwPU5plbITJXP4GDWWUzUcDpYu_y8BShNQ8,2039
|
102
|
+
biolib/utils/__init__.py,sha256=fwjciJyJicvYyZcVTzfDBgD0SKY13DeXqvTeG4qZIy8,5548
|
103
|
+
biolib/utils/app_uri.py,sha256=Yq_-_VGugQhMMo6mM5f0G9yNlLkr0WK4j0Nrf3FE4xQ,2171
|
104
|
+
biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3100
|
101
105
|
biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
|
102
|
-
biolib/utils/seq_util.py,sha256=
|
106
|
+
biolib/utils/seq_util.py,sha256=jC5WhH63FTD7SLFJbxQGA2hOt9NTwq9zHl_BEec1Z0c,4907
|
103
107
|
biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
|
104
|
-
pybiolib-1.1.
|
105
|
-
pybiolib-1.1.
|
106
|
-
pybiolib-1.1.
|
107
|
-
pybiolib-1.1.
|
108
|
-
pybiolib-1.1.
|
108
|
+
pybiolib-1.1.1881.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
109
|
+
pybiolib-1.1.1881.dist-info/METADATA,sha256=oanwAPIfyI5nATML26HjNK4sjPb2ciuoyP2jLxg8Kbs,1508
|
110
|
+
pybiolib-1.1.1881.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
111
|
+
pybiolib-1.1.1881.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
|
112
|
+
pybiolib-1.1.1881.dist-info/RECORD,,
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import biolib.api
|
2
|
-
from biolib.biolib_api_client.lfs_types import LargeFileSystemVersion, LargeFileSystem
|
3
|
-
|
4
|
-
|
5
|
-
class BiolibLargeFileSystemApi:
|
6
|
-
|
7
|
-
@staticmethod
|
8
|
-
def create(account_uuid: str, name: str) -> LargeFileSystem:
|
9
|
-
response = biolib.api.client.post(
|
10
|
-
path='/lfs/',
|
11
|
-
data={'account_uuid': account_uuid, 'name': name},
|
12
|
-
)
|
13
|
-
|
14
|
-
lfs: LargeFileSystem = response.json()
|
15
|
-
return lfs
|
16
|
-
|
17
|
-
@staticmethod
|
18
|
-
def fetch_version(lfs_version_uuid: str) -> LargeFileSystemVersion:
|
19
|
-
response = biolib.api.client.get(
|
20
|
-
path=f'/lfs/versions/{lfs_version_uuid}/',
|
21
|
-
)
|
22
|
-
|
23
|
-
lfs_version: LargeFileSystemVersion = response.json()
|
24
|
-
return lfs_version
|
25
|
-
|
26
|
-
@staticmethod
|
27
|
-
def create_version(resource_uuid: str) -> LargeFileSystemVersion:
|
28
|
-
response = biolib.api.client.post(
|
29
|
-
path='/lfs/versions/',
|
30
|
-
data={'resource_uuid': resource_uuid},
|
31
|
-
)
|
32
|
-
|
33
|
-
lfs_version: LargeFileSystemVersion = response.json()
|
34
|
-
return lfs_version
|
biolib/runtime/results.py
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
import json
|
2
|
-
|
3
|
-
from biolib import api
|
4
|
-
|
5
|
-
|
6
|
-
def set_main_result_prefix(result_prefix: str) -> None:
|
7
|
-
try:
|
8
|
-
with open('/biolib/secrets/biolib_system_secret', mode='r') as system_secrets_file:
|
9
|
-
system_secrets = json.loads(system_secrets_file.read())
|
10
|
-
except Exception: # pylint: disable=broad-except
|
11
|
-
raise Exception('Unable to load the BioLib runtime system secret') from None
|
12
|
-
|
13
|
-
if not system_secrets['version'].startswith('1.'):
|
14
|
-
raise Exception(f"Unexpected system secret version {system_secrets['version']} expected 1.x.x")
|
15
|
-
|
16
|
-
api.client.patch(
|
17
|
-
data={'result_name_prefix': result_prefix},
|
18
|
-
headers={'Job-Auth-Token': system_secrets['job_auth_token']},
|
19
|
-
path=f"/jobs/{system_secrets['job_uuid']}/main_result/",
|
20
|
-
)
|
File without changes
|
File without changes
|