pybiolib 1.2.1352__py3-none-any.whl → 1.2.1379__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 pybiolib might be problematic. Click here for more details.
- biolib/_internal/templates/gui_template/biolib-sdk.ts +6 -3
- biolib/_internal/templates/gui_template/package.json +1 -0
- biolib/_internal/templates/gui_template/vite-plugin-dev-data.ts +4 -7
- biolib/_internal/templates/gui_template/vite.config.mts +1 -1
- biolib/app/app.py +3 -3
- biolib/experiments/experiment.py +21 -14
- {pybiolib-1.2.1352.dist-info → pybiolib-1.2.1379.dist-info}/METADATA +1 -1
- {pybiolib-1.2.1352.dist-info → pybiolib-1.2.1379.dist-info}/RECORD +11 -11
- {pybiolib-1.2.1352.dist-info → pybiolib-1.2.1379.dist-info}/WHEEL +0 -0
- {pybiolib-1.2.1352.dist-info → pybiolib-1.2.1379.dist-info}/entry_points.txt +0 -0
- {pybiolib-1.2.1352.dist-info → pybiolib-1.2.1379.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,14 +6,17 @@ declare global {
|
|
|
6
6
|
const biolib: IBioLibGlobals;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// DO NOT MODIFY: Development data files are injected at build time from gui/dev-data/ folder
|
|
10
|
+
const DEV_DATA_FILES: Record<string, string> = {};
|
|
10
11
|
|
|
11
12
|
const devSdkBioLib: IBioLibGlobals = {
|
|
12
13
|
getOutputFileData: async (path: string): Promise<Uint8Array> => {
|
|
13
14
|
console.log(`[SDK] getOutputFileData called with path: ${path}`);
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const normalizedPath = path.startsWith('/') ? path.slice(1) : path;
|
|
17
|
+
|
|
18
|
+
if (typeof DEV_DATA_FILES !== 'undefined' && normalizedPath in DEV_DATA_FILES) {
|
|
19
|
+
const base64Data = DEV_DATA_FILES[normalizedPath];
|
|
17
20
|
const binaryString = atob(base64Data);
|
|
18
21
|
const bytes = new Uint8Array(binaryString.length);
|
|
19
22
|
for (let i = 0; i < binaryString.length; i++) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
|
|
@@ -32,14 +32,11 @@ export function devDataPlugin(): Plugin {
|
|
|
32
32
|
|
|
33
33
|
const devDataJson = JSON.stringify(devDataMap);
|
|
34
34
|
injectedCode = code.replace(
|
|
35
|
-
|
|
36
|
-
`const DEV_DATA_FILES
|
|
35
|
+
"const DEV_DATA_FILES = {};",
|
|
36
|
+
`const DEV_DATA_FILES = ${devDataJson};`
|
|
37
37
|
);
|
|
38
38
|
} else {
|
|
39
|
-
injectedCode = code
|
|
40
|
-
'/* DEV_DATA_INJECTION */',
|
|
41
|
-
'// Dev data not included in production build'
|
|
42
|
-
);
|
|
39
|
+
injectedCode = code;
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
return {
|
|
@@ -2,7 +2,7 @@ import { defineConfig } from "vite";
|
|
|
2
2
|
import react from "@vitejs/plugin-react";
|
|
3
3
|
import tailwindcss from "@tailwindcss/vite";
|
|
4
4
|
import { viteSingleFile } from "vite-plugin-singlefile";
|
|
5
|
-
import { devDataPlugin } from "./vite-plugin-dev-data";
|
|
5
|
+
import { devDataPlugin } from "./gui/vite-plugin-dev-data";
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
plugins: [react(), tailwindcss(), devDataPlugin(), viteSingleFile()],
|
biolib/app/app.py
CHANGED
|
@@ -7,6 +7,8 @@ import string
|
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
|
|
9
9
|
from biolib import utils
|
|
10
|
+
from biolib._internal.file_utils import path_to_renamed_path
|
|
11
|
+
from biolib._runtime.runtime import Runtime
|
|
10
12
|
from biolib.api.client import ApiClient
|
|
11
13
|
from biolib.biolib_api_client import JobState
|
|
12
14
|
from biolib.biolib_api_client.app_types import App, AppVersion
|
|
@@ -20,8 +22,6 @@ from biolib.experiments.experiment import Experiment
|
|
|
20
22
|
from biolib.jobs.job import Result
|
|
21
23
|
from biolib.typing_utils import Dict, Optional
|
|
22
24
|
from biolib.utils.app_uri import parse_app_uri
|
|
23
|
-
from biolib._runtime.runtime import Runtime
|
|
24
|
-
from biolib._internal.file_utils import path_to_renamed_path
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class BioLibApp:
|
|
@@ -95,7 +95,7 @@ class BioLibApp:
|
|
|
95
95
|
experiment_to_use = experiment if experiment is not None else self._experiment
|
|
96
96
|
experiment_instance: Optional[Experiment]
|
|
97
97
|
if experiment_to_use:
|
|
98
|
-
experiment_instance = Experiment(experiment_to_use)
|
|
98
|
+
experiment_instance = Experiment(experiment_to_use, _api_client=self._api_client)
|
|
99
99
|
else:
|
|
100
100
|
experiment_instance = Experiment.get_experiment_in_context()
|
|
101
101
|
experiment_id = experiment_instance.uuid if experiment_instance else None
|
biolib/experiments/experiment.py
CHANGED
|
@@ -6,6 +6,7 @@ from biolib import api
|
|
|
6
6
|
from biolib._internal.types.experiment import DeprecatedExperimentDict, ExperimentDict
|
|
7
7
|
from biolib._internal.types.resource import ResourceDetailedDict
|
|
8
8
|
from biolib._internal.utils import open_browser_window_from_notebook
|
|
9
|
+
from biolib.api.client import ApiClient
|
|
9
10
|
from biolib.biolib_api_client import BiolibApiClient
|
|
10
11
|
from biolib.biolib_errors import BioLibError
|
|
11
12
|
from biolib.jobs.job import Job
|
|
@@ -28,7 +29,13 @@ class Experiment:
|
|
|
28
29
|
}
|
|
29
30
|
)
|
|
30
31
|
|
|
31
|
-
def __init__(
|
|
32
|
+
def __init__(
|
|
33
|
+
self,
|
|
34
|
+
uri: str,
|
|
35
|
+
_resource_dict: Optional[ResourceDetailedDict] = None,
|
|
36
|
+
_api_client: Optional[ApiClient] = None,
|
|
37
|
+
):
|
|
38
|
+
self._api_client = _api_client or api.client
|
|
32
39
|
self._resource_dict: ResourceDetailedDict = _resource_dict or self._get_or_create_resource_dict(uri)
|
|
33
40
|
|
|
34
41
|
def __enter__(self):
|
|
@@ -113,7 +120,7 @@ class Experiment:
|
|
|
113
120
|
job_id = job
|
|
114
121
|
elif job is None and job_id is None:
|
|
115
122
|
raise BioLibError('A job ID or job object must be provided to add job')
|
|
116
|
-
|
|
123
|
+
self._api_client.post(
|
|
117
124
|
path=f'/experiments/{self.uuid}/jobs/',
|
|
118
125
|
data={'job_uuid': job_id},
|
|
119
126
|
)
|
|
@@ -126,7 +133,7 @@ class Experiment:
|
|
|
126
133
|
else:
|
|
127
134
|
raise BioLibError('A job ID or job object must be provided to remove job')
|
|
128
135
|
|
|
129
|
-
|
|
136
|
+
self._api_client.delete(path=f'/experiments/{self.uuid}/jobs/{job_id}/')
|
|
130
137
|
|
|
131
138
|
def mount_files(self, mount_path: str) -> None:
|
|
132
139
|
try:
|
|
@@ -175,7 +182,7 @@ class Experiment:
|
|
|
175
182
|
|
|
176
183
|
# Prints a table listing info about the jobs in this experiment
|
|
177
184
|
def show_jobs(self) -> None:
|
|
178
|
-
response: JobsPaginatedResponse =
|
|
185
|
+
response: JobsPaginatedResponse = self._api_client.get(
|
|
179
186
|
path=f'/experiments/{self.uuid}/jobs/',
|
|
180
187
|
params=dict(page_size=10),
|
|
181
188
|
).json()
|
|
@@ -197,11 +204,13 @@ class Experiment:
|
|
|
197
204
|
if status:
|
|
198
205
|
params['status'] = status
|
|
199
206
|
|
|
200
|
-
response: JobsPaginatedResponse =
|
|
207
|
+
response: JobsPaginatedResponse = self._api_client.get(url, params=params).json()
|
|
201
208
|
jobs: List[Job] = [Job(job_dict) for job_dict in response['results']]
|
|
202
209
|
|
|
203
210
|
for page_number in range(2, response['page_count'] + 1):
|
|
204
|
-
page_response: JobsPaginatedResponse =
|
|
211
|
+
page_response: JobsPaginatedResponse = self._api_client.get(
|
|
212
|
+
url, params=dict(**params, page=page_number)
|
|
213
|
+
).json()
|
|
205
214
|
jobs.extend([Job(job_dict) for job_dict in page_response['results']])
|
|
206
215
|
|
|
207
216
|
return jobs
|
|
@@ -300,21 +309,19 @@ class Experiment:
|
|
|
300
309
|
)
|
|
301
310
|
|
|
302
311
|
def rename(self, destination: str) -> None:
|
|
303
|
-
|
|
312
|
+
self._api_client.patch(f'/resources/{self.uuid}/', data={'uri': destination})
|
|
304
313
|
self._refetch()
|
|
305
314
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
resource_dict: ResourceDetailedDict = api.client.get(f'/resources/{uuid}/').json()
|
|
315
|
+
def _get_resource_dict_by_uuid(self, uuid: str) -> ResourceDetailedDict:
|
|
316
|
+
resource_dict: ResourceDetailedDict = self._api_client.get(f'/resources/{uuid}/').json()
|
|
309
317
|
if not resource_dict['experiment']:
|
|
310
318
|
raise ValueError('Resource from URI is not an experiment')
|
|
311
319
|
|
|
312
320
|
return resource_dict
|
|
313
321
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
return Experiment._get_resource_dict_by_uuid(uuid=response_dict['uuid'])
|
|
322
|
+
def _get_or_create_resource_dict(self, uri: str) -> ResourceDetailedDict:
|
|
323
|
+
response_dict = self._api_client.post(path='/experiments/', data={'uri' if '/' in uri else 'name': uri}).json()
|
|
324
|
+
return self._get_resource_dict_by_uuid(uuid=response_dict['uuid'])
|
|
318
325
|
|
|
319
326
|
def _refetch(self) -> None:
|
|
320
327
|
self._resource_dict = self._get_resource_dict_by_uuid(uuid=self._resource_dict['uuid'])
|
|
@@ -30,15 +30,15 @@ biolib/_internal/templates/copilot_template/.github/prompts/biolib_run_apps.prom
|
|
|
30
30
|
biolib/_internal/templates/gui_template/.yarnrc.yml,sha256=Rz5t74b8A2OBIODAHQyLurCVZ3JWRg-k6nY-XUaX8nA,25
|
|
31
31
|
biolib/_internal/templates/gui_template/App.tsx,sha256=VfaJO_mxbheRrfO1dU28G9Q4pGsGzeJpPREqtAT4fGE,1692
|
|
32
32
|
biolib/_internal/templates/gui_template/Dockerfile,sha256=nGZQiL7coQBUnH1E2abK2PJ4XRjVS1QXn6HDX9UGpcE,479
|
|
33
|
-
biolib/_internal/templates/gui_template/biolib-sdk.ts,sha256=
|
|
33
|
+
biolib/_internal/templates/gui_template/biolib-sdk.ts,sha256=zRN2h4ws7ZuidxYKaRPaurfTxNJN-hX0MdG6POvdxU0,1195
|
|
34
34
|
biolib/_internal/templates/gui_template/dev-data/output.json,sha256=wKcJQtN7NGaCJkmEWyRjEbBtTLMHB6pOkqTgWsKmOh8,162
|
|
35
35
|
biolib/_internal/templates/gui_template/index.css,sha256=WYds1xQY2of84ebHhRW9ummbw0Bg9N-EyfmBzJKigck,70
|
|
36
36
|
biolib/_internal/templates/gui_template/index.html,sha256=EM5xzJ9CsJalgzL-jLNkAoP4tgosw0WYExcH5W6DOs8,403
|
|
37
37
|
biolib/_internal/templates/gui_template/index.tsx,sha256=YrdrpcckwLo0kYIA-2egtzlo0OMWigGxnt7mNN4qmlU,234
|
|
38
|
-
biolib/_internal/templates/gui_template/package.json,sha256=
|
|
38
|
+
biolib/_internal/templates/gui_template/package.json,sha256=4E8pDdnrYYjmKAL8NYFE3OZzBf4-CWdHWEZFAo_zBwg,652
|
|
39
39
|
biolib/_internal/templates/gui_template/tsconfig.json,sha256=T3DJIzeLQ2BL8HLfPHI-IvHtJhnMXdHOoRjkmQlJQAw,541
|
|
40
|
-
biolib/_internal/templates/gui_template/vite-plugin-dev-data.ts,sha256=
|
|
41
|
-
biolib/_internal/templates/gui_template/vite.config.mts,sha256=
|
|
40
|
+
biolib/_internal/templates/gui_template/vite-plugin-dev-data.ts,sha256=jLFSl7_DU9W3ScM6fm0aFSCzDhAtzhI9G6zr1exze84,1397
|
|
41
|
+
biolib/_internal/templates/gui_template/vite.config.mts,sha256=5RjRfJHgqLOr-LRydBUnDPr5GrHQuRsviTMC60hvKxU,348
|
|
42
42
|
biolib/_internal/templates/init_template/.biolib/config.yml,sha256=gxMVd1wjbsDvMv4byc8fKEdJFby4qgi6v38mO5qmhoY,453
|
|
43
43
|
biolib/_internal/templates/init_template/.github/workflows/biolib.yml,sha256=sphjoiycV_oc4VbaA8wbUEokSMpnrdB6N-bYju_5Ibo,522
|
|
44
44
|
biolib/_internal/templates/init_template/.gitignore,sha256=dR_jhtT0boUspgk3S5PPUwuO0o8gKGIbdwu8IH638CY,20
|
|
@@ -70,7 +70,7 @@ biolib/_session/session.py,sha256=Ymi9OQW_u_CfYA3JlBakPwRhNaKlb20P2G8SmtJhnzA,18
|
|
|
70
70
|
biolib/api/__init__.py,sha256=mQ4u8FijqyLzjYMezMUUbbBGNB3iFmkNdjXnWPZ7Jlw,138
|
|
71
71
|
biolib/api/client.py,sha256=2GpKE7QrPgyPdgJgrV7XnZByIJf1n26UCy3aoaHBs1M,7881
|
|
72
72
|
biolib/app/__init__.py,sha256=cdPtcfb_U-bxb9iSL4fCEq2rpD9OjkyY4W-Zw60B0LI,37
|
|
73
|
-
biolib/app/app.py,sha256=
|
|
73
|
+
biolib/app/app.py,sha256=8k7M8G3HO1TPfBTZrE_iODKX28rxxf-7g-OsUa3x-fY,12260
|
|
74
74
|
biolib/app/search_apps.py,sha256=K4a41f5XIWth2BWI7OffASgIsD0ko8elCax8YL2igaY,1470
|
|
75
75
|
biolib/biolib_api_client/__init__.py,sha256=E5EMa19wJoblwSdQPYrxc_BtIeRsAuO0L_jQweWw-Yk,182
|
|
76
76
|
biolib/biolib_api_client/api_client.py,sha256=IONzXeFCHl4wuct6fqOC_7NiTv_zFy6ys0hsAtvLzTA,7578
|
|
@@ -143,7 +143,7 @@ biolib/compute_node/webserver/webserver_types.py,sha256=2t8EaFKESnves3BA_NBdnS2y
|
|
|
143
143
|
biolib/compute_node/webserver/webserver_utils.py,sha256=XWvwYPbWNR3qS0FYbLLp-MDDfVk0QdaAmg3xPrT0H2s,4234
|
|
144
144
|
biolib/compute_node/webserver/worker_thread.py,sha256=7uD9yQPhePYvP2HCJ27EeZ_h6psfIWFgqm1RHZxzobs,12483
|
|
145
145
|
biolib/experiments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
146
|
-
biolib/experiments/experiment.py,sha256=
|
|
146
|
+
biolib/experiments/experiment.py,sha256=ePipnJs6TW84jr9iBfYYRpYuEXUVGIxaD8Z8Jf0FYIA,13909
|
|
147
147
|
biolib/jobs/__init__.py,sha256=aIb2H2DHjQbM2Bs-dysFijhwFcL58Blp0Co0gimED3w,32
|
|
148
148
|
biolib/jobs/job.py,sha256=X7F_jCwAwtPcI1qu-oLamZNzt1IVSIeOPWlax1ztfAM,29674
|
|
149
149
|
biolib/jobs/job_result.py,sha256=_xqQu9z9BqPQrU6tjqKPuKlQDt5W0Zw5xiQvzEBkDyE,5266
|
|
@@ -161,8 +161,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
|
|
|
161
161
|
biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
|
|
162
162
|
biolib/utils/seq_util.py,sha256=rImaghQGuIqTVWks6b9P2yKuN34uePUYPUFW_Wyoa4A,6737
|
|
163
163
|
biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
|
|
164
|
-
pybiolib-1.2.
|
|
165
|
-
pybiolib-1.2.
|
|
166
|
-
pybiolib-1.2.
|
|
167
|
-
pybiolib-1.2.
|
|
168
|
-
pybiolib-1.2.
|
|
164
|
+
pybiolib-1.2.1379.dist-info/METADATA,sha256=K_Bnjzo9XB9Aq5g63v7A6CEKrEc1YC5jh6u0gYMGqCA,1644
|
|
165
|
+
pybiolib-1.2.1379.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
166
|
+
pybiolib-1.2.1379.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
|
|
167
|
+
pybiolib-1.2.1379.dist-info/licenses/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
|
168
|
+
pybiolib-1.2.1379.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|