Skip to content

Commit 9f35a3b

Browse files
committed
fix: wait for jobs to finish async
1 parent 9cfa8aa commit 9f35a3b

7 files changed

Lines changed: 14 additions & 18 deletions

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"# Import settings file and utils file\n",
141141
"from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n",
142142
"from utils.api import (\n",
143-
" wait_for_jobs_to_finish,\n",
143+
" wait_for_jobs_to_finish_async,\n",
144144
" get_property_by_subworkflow_and_unit_indicies,\n",
145145
")\n",
146146
"from utils.visualize import (\n",
@@ -218,7 +218,7 @@
218218
"\n",
219219
"# Submit the job\n",
220220
"job_endpoints.submit(job[\"_id\"])\n",
221-
"wait_for_jobs_to_finish(job_endpoints, [job[\"_id\"]])"
221+
"await wait_for_jobs_to_finish_async(job_endpoints, [job[\"_id\"]])"
222222
]
223223
},
224224
{

examples/job/ml-train-model-predict-properties.ipynb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n",
143143
"from utils.api import (\n",
144144
" copy_bank_workflow_by_system_name,\n",
145-
" wait_for_jobs_to_finish,\n",
145+
" wait_for_jobs_to_finish_async,\n",
146146
" get_property_by_subworkflow_and_unit_indicies,\n",
147147
")\n",
148148
"from utils.visualize import (\n",
@@ -434,7 +434,7 @@
434434
"outputs": [],
435435
"source": [
436436
"job_ids = [job[\"_id\"] for job in jobs]\n",
437-
"wait_for_jobs_to_finish(job_endpoints, job_ids)"
437+
"await wait_for_jobs_to_finish_async(job_endpoints, job_ids)"
438438
]
439439
},
440440
{
@@ -505,9 +505,7 @@
505505
"outputId": "dfca0a46-6318-40a9-84a0-5e8925f5958e"
506506
},
507507
"outputs": [],
508-
"source": [
509-
"wait_for_jobs_to_finish(job_endpoints, [job[\"_id\"]])"
510-
]
508+
"source": "await wait_for_jobs_to_finish_async(job_endpoints, [job[\"_id\"]])"
511509
},
512510
{
513511
"attachments": {},
@@ -628,9 +626,7 @@
628626
"outputId": "3892222c-1f00-4d83-d5b7-83195af3ec5a"
629627
},
630628
"outputs": [],
631-
"source": [
632-
"wait_for_jobs_to_finish(job_endpoints, [job[\"_id\"]])"
633-
]
629+
"source": "await wait_for_jobs_to_finish_async(job_endpoints, [job[\"_id\"]])"
634630
},
635631
{
636632
"attachments": {},

examples/job/run-simulations-and-extract-properties.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"\n",
151151
"# Import settings file and utils file\n",
152152
"from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n",
153-
"from utils.api import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies\n",
153+
"from utils.api import wait_for_jobs_to_finish_async, get_property_by_subworkflow_and_unit_indicies\n",
154154
"from utils.visualize import dataframe_to_html\n",
155155
"\n",
156156
"import pandas as pd\n",
@@ -523,7 +523,7 @@
523523
"outputs": [],
524524
"source": [
525525
"job_ids = [job[\"_id\"] for job in jobs]\n",
526-
"wait_for_jobs_to_finish(job_endpoints, job_ids)"
526+
"await wait_for_jobs_to_finish_async(job_endpoints, job_ids)"
527527
]
528528
},
529529
{

examples/reproducing_publications/band_gaps_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@
763763
"\n",
764764
"job_ids = [job[\"_id\"] for job in jobs]\n",
765765
"\n",
766-
"wait_for_jobs_to_finish(job_endpoints, job_ids, poll_interval=60)"
766+
"await wait_for_jobs_to_finish_async(job_endpoints, job_ids, poll_interval=60)"
767767
]
768768
},
769769
{

examples/reproducing_publications/band_structure_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@
750750
"\n",
751751
"job_ids = [job[\"_id\"] for job in jobs]\n",
752752
"\n",
753-
"wait_for_jobs_to_finish(job_endpoints, job_ids, poll_interval=60)"
753+
"await wait_for_jobs_to_finish_async(job_endpoints, job_ids, poll_interval=60)"
754754
]
755755
},
756756
{

examples/workflow/qe_scf_calculation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@
337337
"outputs": [],
338338
"source": [
339339
"# monitor job and wait for it to be finished\n",
340-
"wait_for_jobs_to_finish(job_endpoints, [JOB_RESP[\"_id\"]], 30)"
340+
"await wait_for_jobs_to_finish_async(job_endpoints, [JOB_RESP[\"_id\"]], 30)"
341341
]
342342
},
343343
{

other/jarvis/run_job_using_material_from_jarvis_db.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@
247247
"outputs": [],
248248
"source": [
249249
"from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n",
250-
"from utils.api import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies\n",
250+
"from utils.api import wait_for_jobs_to_finish_async, get_property_by_subworkflow_and_unit_indicies\n",
251251
"from utils.visualize import dataframe_to_html, display_JSON\n",
252252
"\n",
253253
"# Relevant functions from the API client\n",
@@ -439,9 +439,9 @@
439439
},
440440
"outputs": [],
441441
"source": [
442-
"from utils.api import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies\n",
442+
"from utils.api import wait_for_jobs_to_finish_async, get_property_by_subworkflow_and_unit_indicies\n",
443443
"job_id = job[\"_id\"]\n",
444-
"wait_for_jobs_to_finish(job_endpoints, [job_id])"
444+
"await wait_for_jobs_to_finish_async(job_endpoints, [job_id])"
445445
]
446446
},
447447
{

0 commit comments

Comments
 (0)