Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/job/create_and_submit_job.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"outputs": [],
"source": [
"from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n",
"from utils.generic import display_JSON\n",
"from utils.visualize import display_JSON\n",
"\n",
"from exabyte_api_client.endpoints.jobs import JobEndpoints\n",
"from exabyte_api_client.endpoints.materials import MaterialEndpoints\n",
Expand Down
46 changes: 24 additions & 22 deletions examples/job/get-file-from-job.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"colab": {
Expand All @@ -75,6 +76,7 @@
"id": "nXDYU_oP8GIr",
"outputId": "aee909b7-1a48-43c2-81b7-3659e0fc9c79"
},
"outputs": [],
"source": [
"# @title Authorization Form\n",
"ACCOUNT_ID = \"ACCOUNT_ID\" # @param {type:\"string\"}\n",
Expand Down Expand Up @@ -115,9 +117,7 @@
" from mat3ra.utils.jupyterlite.packages import install_packages\n",
"\n",
" await install_packages(\"api_examples\")"
],
"outputs": [],
"execution_count": null
]
},
{
"attachments": {},
Expand All @@ -131,15 +131,19 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "rG9HfjnR8GIs"
},
"outputs": [],
"source": [
"# Import settings file and utils file\n",
"from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n",
"from utils.generic import (\n",
"from utils.api import (\n",
" wait_for_jobs_to_finish,\n",
" get_property_by_subworkflow_and_unit_indicies,\n",
")\n",
"from utils.visualize import (\n",
" dataframe_to_html,\n",
" display_JSON,\n",
")\n",
Expand All @@ -150,9 +154,7 @@
"from exabyte_api_client.endpoints.materials import MaterialEndpoints\n",
"from exabyte_api_client.endpoints.bank_materials import BankMaterialEndpoints\n",
"from exabyte_api_client.endpoints.bank_workflows import BankWorkflowEndpoints"
],
"outputs": [],
"execution_count": null
]
},
{
"attachments": {},
Expand All @@ -176,13 +178,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "le9f28c08GIt",
"outputId": "27e9b94f-29dd-4742-9448-2e1bce79cb15"
},
"outputs": [],
"source": [
"# Get some account information\n",
"project_endpoints = ProjectEndpoints(*ENDPOINT_ARGS)\n",
Expand Down Expand Up @@ -215,9 +219,7 @@
"# Submit the job\n",
"job_endpoints.submit(job[\"_id\"])\n",
"wait_for_jobs_to_finish(job_endpoints, [job[\"_id\"]])"
],
"outputs": [],
"execution_count": null
]
},
{
"attachments": {},
Expand All @@ -244,22 +246,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "yijRe7qp8GIv",
"outputId": "19b147fc-736e-41f0-bd0f-6f69e77b0adf"
},
"outputs": [],
"source": [
"files = job_endpoints.list_files(job[\"_id\"])\n",
"paths = [file[\"key\"] for file in files]\n",
"for path in paths:\n",
" if \"outdir\" not in path:\n",
" print(path)"
],
"outputs": [],
"execution_count": null
]
},
{
"attachments": {},
Expand All @@ -284,21 +286,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "U2dq0A1e8GIw",
"outputId": "7b4f8c36-6342-46fa-d02e-0825b44e6c64"
},
"outputs": [],
"source": [
"for file in files:\n",
" if file[\"name\"] == \"pw_scf.out\":\n",
" output_file_metadata = file\n",
"display_JSON(output_file_metadata)"
],
"outputs": [],
"execution_count": null
]
},
{
"attachments": {},
Expand All @@ -314,13 +316,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "OpdOMuDT8GIw",
"outputId": "e4e2e6b1-8431-439a-8606-ae500534e601"
},
"outputs": [],
"source": [
"from mat3ra.utils.jupyterlite.url import read_from_url\n",
"\n",
Expand All @@ -330,9 +334,7 @@
"lines = output_file.split(\"\\n\")\n",
"for line in lines[-90:]:\n",
" print(line)"
],
"outputs": [],
"execution_count": null
]
},
{
"attachments": {},
Expand All @@ -348,16 +350,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "COPinBrO8GIx"
},
"outputs": [],
"source": [
"from utils.jupyterlite import download_content_to_file\n",
"\n",
"download_content_to_file(content=output_file, filename=output_file_metadata[\"name\"])"
],
"outputs": [],
"execution_count": null
]
}
],
"metadata": {
Expand Down
Loading