Skip to content

Commit a0bdbd9

Browse files
committed
update: imports
1 parent 1beae99 commit a0bdbd9

22 files changed

+558
-489
lines changed

examples/job/create_and_submit_job.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"outputs": [],
106106
"source": [
107107
"from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n",
108-
"from utils.generic import display_JSON\n",
108+
"from utils.visualize import display_JSON\n",
109109
"\n",
110110
"from exabyte_api_client.endpoints.jobs import JobEndpoints\n",
111111
"from exabyte_api_client.endpoints.materials import MaterialEndpoints\n",

examples/job/get-file-from-job.ipynb

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
},
6868
{
6969
"cell_type": "code",
70+
"execution_count": null,
7071
"metadata": {
7172
"cellView": "form",
7273
"colab": {
@@ -75,6 +76,7 @@
7576
"id": "nXDYU_oP8GIr",
7677
"outputId": "aee909b7-1a48-43c2-81b7-3659e0fc9c79"
7778
},
79+
"outputs": [],
7880
"source": [
7981
"# @title Authorization Form\n",
8082
"ACCOUNT_ID = \"ACCOUNT_ID\" # @param {type:\"string\"}\n",
@@ -115,9 +117,7 @@
115117
" from mat3ra.utils.jupyterlite.packages import install_packages\n",
116118
"\n",
117119
" await install_packages(\"api_examples\")"
118-
],
119-
"outputs": [],
120-
"execution_count": null
120+
]
121121
},
122122
{
123123
"attachments": {},
@@ -131,15 +131,19 @@
131131
},
132132
{
133133
"cell_type": "code",
134+
"execution_count": null,
134135
"metadata": {
135136
"id": "rG9HfjnR8GIs"
136137
},
138+
"outputs": [],
137139
"source": [
138140
"# Import settings file and utils file\n",
139141
"from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n",
140-
"from utils.generic import (\n",
142+
"from utils.api import (\n",
141143
" wait_for_jobs_to_finish,\n",
142144
" get_property_by_subworkflow_and_unit_indicies,\n",
145+
")\n",
146+
"from utils.visualize import (\n",
143147
" dataframe_to_html,\n",
144148
" display_JSON,\n",
145149
")\n",
@@ -150,9 +154,7 @@
150154
"from exabyte_api_client.endpoints.materials import MaterialEndpoints\n",
151155
"from exabyte_api_client.endpoints.bank_materials import BankMaterialEndpoints\n",
152156
"from exabyte_api_client.endpoints.bank_workflows import BankWorkflowEndpoints"
153-
],
154-
"outputs": [],
155-
"execution_count": null
157+
]
156158
},
157159
{
158160
"attachments": {},
@@ -176,13 +178,15 @@
176178
},
177179
{
178180
"cell_type": "code",
181+
"execution_count": null,
179182
"metadata": {
180183
"colab": {
181184
"base_uri": "https://localhost:8080/"
182185
},
183186
"id": "le9f28c08GIt",
184187
"outputId": "27e9b94f-29dd-4742-9448-2e1bce79cb15"
185188
},
189+
"outputs": [],
186190
"source": [
187191
"# Get some account information\n",
188192
"project_endpoints = ProjectEndpoints(*ENDPOINT_ARGS)\n",
@@ -215,9 +219,7 @@
215219
"# Submit the job\n",
216220
"job_endpoints.submit(job[\"_id\"])\n",
217221
"wait_for_jobs_to_finish(job_endpoints, [job[\"_id\"]])"
218-
],
219-
"outputs": [],
220-
"execution_count": null
222+
]
221223
},
222224
{
223225
"attachments": {},
@@ -244,22 +246,22 @@
244246
},
245247
{
246248
"cell_type": "code",
249+
"execution_count": null,
247250
"metadata": {
248251
"colab": {
249252
"base_uri": "https://localhost:8080/"
250253
},
251254
"id": "yijRe7qp8GIv",
252255
"outputId": "19b147fc-736e-41f0-bd0f-6f69e77b0adf"
253256
},
257+
"outputs": [],
254258
"source": [
255259
"files = job_endpoints.list_files(job[\"_id\"])\n",
256260
"paths = [file[\"key\"] for file in files]\n",
257261
"for path in paths:\n",
258262
" if \"outdir\" not in path:\n",
259263
" print(path)"
260-
],
261-
"outputs": [],
262-
"execution_count": null
264+
]
263265
},
264266
{
265267
"attachments": {},
@@ -284,21 +286,21 @@
284286
},
285287
{
286288
"cell_type": "code",
289+
"execution_count": null,
287290
"metadata": {
288291
"colab": {
289292
"base_uri": "https://localhost:8080/"
290293
},
291294
"id": "U2dq0A1e8GIw",
292295
"outputId": "7b4f8c36-6342-46fa-d02e-0825b44e6c64"
293296
},
297+
"outputs": [],
294298
"source": [
295299
"for file in files:\n",
296300
" if file[\"name\"] == \"pw_scf.out\":\n",
297301
" output_file_metadata = file\n",
298302
"display_JSON(output_file_metadata)"
299-
],
300-
"outputs": [],
301-
"execution_count": null
303+
]
302304
},
303305
{
304306
"attachments": {},
@@ -314,13 +316,15 @@
314316
},
315317
{
316318
"cell_type": "code",
319+
"execution_count": null,
317320
"metadata": {
318321
"colab": {
319322
"base_uri": "https://localhost:8080/"
320323
},
321324
"id": "OpdOMuDT8GIw",
322325
"outputId": "e4e2e6b1-8431-439a-8606-ae500534e601"
323326
},
327+
"outputs": [],
324328
"source": [
325329
"from mat3ra.utils.jupyterlite.url import read_from_url\n",
326330
"\n",
@@ -330,9 +334,7 @@
330334
"lines = output_file.split(\"\\n\")\n",
331335
"for line in lines[-90:]:\n",
332336
" print(line)"
333-
],
334-
"outputs": [],
335-
"execution_count": null
337+
]
336338
},
337339
{
338340
"attachments": {},
@@ -348,16 +350,16 @@
348350
},
349351
{
350352
"cell_type": "code",
353+
"execution_count": null,
351354
"metadata": {
352355
"id": "COPinBrO8GIx"
353356
},
357+
"outputs": [],
354358
"source": [
355359
"from utils.jupyterlite import download_content_to_file\n",
356360
"\n",
357361
"download_content_to_file(content=output_file, filename=output_file_metadata[\"name\"])"
358-
],
359-
"outputs": [],
360-
"execution_count": null
362+
]
361363
}
362364
],
363365
"metadata": {

0 commit comments

Comments
 (0)