From c61c09db8939714d39346d68554e0f370ce76f10 Mon Sep 17 00:00:00 2001 From: Kamal Choudhary Date: Fri, 2 Feb 2024 12:35:07 -0500 Subject: [PATCH 1/5] Created using Colaboratory --- other/material/run_job_from_jarvis.ipynb | 829 +++++++++++++++++++++++ 1 file changed, 829 insertions(+) create mode 100644 other/material/run_job_from_jarvis.ipynb diff --git a/other/material/run_job_from_jarvis.ipynb b/other/material/run_job_from_jarvis.ipynb new file mode 100644 index 00000000..a016c694 --- /dev/null +++ b/other/material/run_job_from_jarvis.ipynb @@ -0,0 +1,829 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "\n", + "\"Open\n", + "" + ], + "metadata": { + "collapsed": false, + "id": "3c567b6400249971" + }, + "id": "3c567b6400249971" + }, + { + "cell_type": "markdown", + "source": [ + "## Install Packages\n", + "First, install `express-py` which includes `jarvis-tools` as dependency." + ], + "metadata": { + "collapsed": false, + "id": "8b00ab6854f2263b" + }, + "id": "8b00ab6854f2263b" + }, + { + "cell_type": "code", + "execution_count": 4, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Requirement already satisfied: express-py==2024.1.25.post7 in /usr/local/lib/python3.10/dist-packages (2024.1.25.post7)\n", + "Requirement already satisfied: munch==2.5.0 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (2.5.0)\n", + "Requirement already satisfied: pymatgen>=2023.8.10 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (2023.9.25)\n", + "Requirement already satisfied: ase>=3.17.0 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (3.22.1)\n", + "Requirement already satisfied: mat3ra-esse>=2024.1.25.post7 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (2024.1.31.post0)\n", + "Requirement already satisfied: rdkit-pypi>=2022.3.5 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (2022.9.5)\n", + "Requirement already satisfied: jarvis-tools>=2023.12.12 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (2023.12.12)\n", + "Requirement already satisfied: numpy==1.23.5 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (1.23.5)\n", + "Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from munch==2.5.0->express-py==2024.1.25.post7) (1.16.0)\n", + "Requirement already satisfied: matplotlib>=3.1.0 in /usr/local/lib/python3.10/dist-packages (from ase>=3.17.0->express-py==2024.1.25.post7) (3.7.1)\n", + "Requirement already satisfied: scipy>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from ase>=3.17.0->express-py==2024.1.25.post7) (1.11.4)\n", + "Requirement already satisfied: spglib>=1.14.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.3.0)\n", + "Requirement already satisfied: joblib>=0.14.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (1.3.2)\n", + "Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.31.0)\n", + "Requirement already satisfied: toolz>=0.9.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.12.1)\n", + "Requirement already satisfied: xmltodict>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.13.0)\n", + "Requirement already satisfied: tqdm>=4.41.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (4.66.1)\n", + "Requirement already satisfied: mkdocs-material>=9.0.5 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (9.5.6)\n", + "Requirement already satisfied: markdown>=3.2.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.5.2)\n", + "Requirement already satisfied: exabyte-json-include>=2023.12.23.post0 in /usr/local/lib/python3.10/dist-packages (from mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (2023.12.23.post0)\n", + "Requirement already satisfied: jsonschema>=2.6.0 in /usr/local/lib/python3.10/dist-packages (from mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (4.19.2)\n", + "Requirement already satisfied: monty>=3.0.2 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (2024.1.26)\n", + "Requirement already satisfied: networkx>=2.2 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (3.2.1)\n", + "Requirement already satisfied: palettable>=3.1.1 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (3.3.3)\n", + "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (1.5.3)\n", + "Requirement already satisfied: plotly>=4.5.0 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (5.15.0)\n", + "Requirement already satisfied: pybtex in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (0.24.0)\n", + "Requirement already satisfied: ruamel.yaml>=0.17.0 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (0.18.5)\n", + "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (1.12)\n", + "Requirement already satisfied: tabulate in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (0.9.0)\n", + "Requirement already satisfied: uncertainties>=3.1.4 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (3.1.7)\n", + "Requirement already satisfied: Pillow in /usr/local/lib/python3.10/dist-packages (from rdkit-pypi>=2022.3.5->express-py==2024.1.25.post7) (9.4.0)\n", + "Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (23.2.0)\n", + "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (2023.12.1)\n", + "Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (0.33.0)\n", + "Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (0.17.1)\n", + "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (1.2.0)\n", + "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (0.12.1)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (4.47.2)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (1.4.5)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (23.2)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (3.1.1)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (2.8.2)\n", + "Requirement already satisfied: babel~=2.10 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.14.0)\n", + "Requirement already satisfied: colorama~=0.4 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.4.6)\n", + "Requirement already satisfied: jinja2~=3.0 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.1.3)\n", + "Requirement already satisfied: mkdocs-material-extensions~=1.3 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (1.3.1)\n", + "Requirement already satisfied: mkdocs~=1.5.3 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (1.5.3)\n", + "Requirement already satisfied: paginate~=0.5 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.5.6)\n", + "Requirement already satisfied: pygments~=2.16 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.16.1)\n", + "Requirement already satisfied: pymdown-extensions~=10.2 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (10.7)\n", + "Requirement already satisfied: regex>=2022.4 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2023.6.3)\n", + "Requirement already satisfied: tenacity>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from plotly>=4.5.0->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (8.2.3)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.3.2)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.6)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.0.7)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2023.11.17)\n", + "Requirement already satisfied: ruamel.yaml.clib>=0.2.7 in /usr/local/lib/python3.10/dist-packages (from ruamel.yaml>=0.17.0->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (0.2.8)\n", + "Requirement already satisfied: future in /usr/local/lib/python3.10/dist-packages (from uncertainties>=3.1.4->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (0.18.3)\n", + "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (2023.4)\n", + "Requirement already satisfied: PyYAML>=3.01 in /usr/local/lib/python3.10/dist-packages (from pybtex->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (6.0.1)\n", + "Requirement already satisfied: latexcodec>=1.0.4 in /usr/local/lib/python3.10/dist-packages (from pybtex->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (2.0.1)\n", + "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (1.3.0)\n", + "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2~=3.0->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.1.4)\n", + "Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (8.1.7)\n", + "Requirement already satisfied: ghp-import>=1.0 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.1.0)\n", + "Requirement already satisfied: mergedeep>=1.3.4 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (1.3.4)\n", + "Requirement already satisfied: pathspec>=0.11.1 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.12.1)\n", + "Requirement already satisfied: platformdirs>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (4.1.0)\n", + "Requirement already satisfied: pyyaml-env-tag>=0.1 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.1)\n", + "Requirement already satisfied: watchdog>=2.0 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.0.0)\n" + ] + } + ], + "source": [ + "!pip install express-py==2024.1.25.post7\n" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "b1288bc79ee2c828", + "outputId": "65f99dbc-c663-4a34-cb23-aefdfbb5ab42" + }, + "id": "b1288bc79ee2c828" + }, + { + "cell_type": "markdown", + "source": [ + "## Get Materials Data From JARVIS\n", + "Then, let's get the dataset containing 2D materials from JARVIS and wrap it into a pandas dataframe." + ], + "metadata": { + "collapsed": false, + "id": "f418c51a7f794f9f" + }, + "id": "f418c51a7f794f9f" + }, + { + "cell_type": "code", + "execution_count": 5, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Obtaining 2D dataset 1.1k ...\n", + "Reference:https://www.nature.com/articles/s41524-020-00440-1\n", + "Other versions:https://doi.org/10.6084/m9.figshare.6815705\n", + "Loading the zipfile...\n", + "Loading completed.\n" + ] + } + ], + "source": [ + "import pandas as pd\n", + "from jarvis.db.figshare import data, get_jid_data\n", + "\n", + "dft_2d=data('dft_2d')\n", + "df = pd.DataFrame(dft_2d)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "b1ee775d1476f884", + "outputId": "37e962cb-7438-4066-dc9e-6b033173397c" + }, + "id": "b1ee775d1476f884" + }, + { + "cell_type": "markdown", + "source": [ + "## Extract Structure and Convert to ESSE\n", + "Next, we extract an entry from the JARVIS dataset and convert it into ESSE format ready to be uploaded to Mat3ra.com." + ], + "metadata": { + "collapsed": false, + "id": "15fe5f9de299c935" + }, + "id": "15fe5f9de299c935" + }, + { + "cell_type": "code", + "execution_count": 6, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "{\n", + " \"_id\": \"\",\n", + " \"name\": \"material\",\n", + " \"exabyteId\": \"\",\n", + " \"hash\": \"\",\n", + " \"formula\": \"Te2Mo\",\n", + " \"unitCellFormula\": \"Te2 Mo1\",\n", + " \"lattice\": {\n", + " \"type\": \"HEX\",\n", + " \"a\": 3.562364004499092,\n", + " \"b\": 3.562364004499092,\n", + " \"c\": 35.346645,\n", + " \"alpha\": 90.0,\n", + " \"beta\": 90.0,\n", + " \"gamma\": 120.00001186178349,\n", + " \"units\": {\n", + " \"length\": \"angstrom\",\n", + " \"angle\": \"degree\"\n", + " }\n", + " },\n", + " \"basis\": {\n", + " \"units\": \"crystal\",\n", + " \"elements\": [\n", + " {\n", + " \"id\": 1,\n", + " \"value\": \"Te\"\n", + " },\n", + " {\n", + " \"id\": 2,\n", + " \"value\": \"Te\"\n", + " },\n", + " {\n", + " \"id\": 3,\n", + " \"value\": \"Mo\"\n", + " }\n", + " ],\n", + " \"coordinates\": [\n", + " {\n", + " \"id\": 1,\n", + " \"value\": [\n", + " 0.6666669999999999,\n", + " 0.3333330000000001,\n", + " 0.05727934272677686\n", + " ]\n", + " },\n", + " {\n", + " \"id\": 2,\n", + " \"value\": [\n", + " 0.6666669999999999,\n", + " 0.3333330000000001,\n", + " 0.15980865727548643\n", + " ]\n", + " },\n", + " {\n", + " \"id\": 3,\n", + " \"value\": [\n", + " 0.33333299999999993,\n", + " 0.6666670000000001,\n", + " 0.10854400000113165\n", + " ]\n", + " }\n", + " ]\n", + " },\n", + " \"derivedProperties\": [\n", + " {\n", + " \"name\": \"density\",\n", + " \"units\": \"g/cm^3\",\n", + " \"value\": 1.5009769971314555\n", + " },\n", + " {\n", + " \"name\": \"elemental_ratio\",\n", + " \"value\": 0.6666666666666666,\n", + " \"element\": \"Te\"\n", + " },\n", + " {\n", + " \"name\": \"elemental_ratio\",\n", + " \"value\": 0.3333333333333333,\n", + " \"element\": \"Mo\"\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 2,\n", + " \"degree\": 0\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 0.7453559924999299,\n", + " \"degree\": 2\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 0.6933612743506347,\n", + " \"degree\": 3\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 0.6707822056951861,\n", + " \"degree\": 5\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 0.667408235036379,\n", + " \"degree\": 7\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 0.6667317422407864,\n", + " \"degree\": 10\n", + " },\n", + " {\n", + " \"spaceGroupSymbol\": \"P-6m2\",\n", + " \"tolerance\": {\n", + " \"value\": 0.3,\n", + " \"units\": \"angstrom\"\n", + " },\n", + " \"name\": \"symmetry\"\n", + " },\n", + " {\n", + " \"name\": \"volume\",\n", + " \"units\": \"angstrom^3\",\n", + " \"value\": 388.46810374859973\n", + " }\n", + " ],\n", + " \"creator\": {\n", + " \"_id\": \"\",\n", + " \"cls\": \"User\",\n", + " \"slug\": \"\"\n", + " },\n", + " \"owner\": {\n", + " \"_id\": \"\",\n", + " \"cls\": \"Account\",\n", + " \"slug\": \"\"\n", + " },\n", + " \"schemaVersion\": \"0.2.0\"\n", + "}\n" + ] + } + ], + "source": [ + "import json\n", + "from express import ExPrESS\n", + "\n", + "## Note: JVASP-670 is an entry for MoTe2\n", + "jarvis_db_entry = json.dumps(json.loads(df[(df['jid']=='JVASP-670')].to_json(orient='records'))[0])\n", + "\n", + "kwargs = {\n", + " \"structure_string\": jarvis_db_entry,\n", + " \"cell_type\": \"original\",\n", + " \"structure_format\": \"jarvis-db-entry\"\n", + "}\n", + "\n", + "handler = ExPrESS(\"structure\", **kwargs)\n", + "data = handler.property(\"material\", **kwargs)\n", + "\n", + "# To preview resulting JSON data\n", + "print(json.dumps(data, indent=4))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "c41fb68c6d25fe48", + "outputId": "2e609d57-b063-48cb-de10-c2a6c0a6ce6e" + }, + "id": "c41fb68c6d25fe48" + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "TTfqDI6722cG" + }, + "id": "TTfqDI6722cG", + "execution_count": 17, + "outputs": [] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "esZRmwMR22WV" + }, + "id": "esZRmwMR22WV", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "# @title Authorization Form\n", + "ACCOUNT_ID = \"7qzeKmx8jH8M73whg\" # @param {type:\"string\"}\n", + "AUTH_TOKEN = \"6jFd5x64XwUOUe9uhbHm5ydsbmB1Hkn7-Wgsjd72Dt0\" # @param {type:\"string\"}\n", + "MATERIALS_PROJECT_API_KEY = \"MATERIALS_PROJECT_API_KEY\" # @param {type:\"string\"}\n", + "ORGANIZATION_ID = \"\"\n", + "\n", + "\n", + "import os\n", + "\n", + "if \"COLAB_JUPYTER_IP\" in os.environ:\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=ACCOUNT_ID,\n", + " AUTH_TOKEN=AUTH_TOKEN,\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=ORGANIZATION_ID,\n", + " )\n", + " )\n", + "\n", + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Lf8xXwCW1grk", + "outputId": "af553eb9-4681-4059-f177-4ad23ef218c3" + }, + "id": "Lf8xXwCW1grk", + "execution_count": 7, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Traceback (most recent call last):\n", + " File \"/usr/local/bin/notebook-path\", line 8, in \n", + " sys.exit(print_notebook_path())\n", + " File \"/usr/local/lib/python3.10/dist-packages/utils/notebook.py\", line 46, in print_notebook_path\n", + " print(get_notebook_info()[\"notebook_path\"])\n", + " File \"/usr/local/lib/python3.10/dist-packages/utils/notebook.py\", line 22, in get_notebook_info\n", + " parsed = re.findall(\"(.*)/blob/(.*)/examples/(.*)\", path)[0]\n", + "IndexError: list index out of range\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n", + "from utils.generic import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies, dataframe_to_html, display_JSON\n", + "\n", + "import pandas as pd\n", + "\n", + "# Relevant functions from the API client\n", + "from exabyte_api_client.endpoints.jobs import JobEndpoints\n", + "from exabyte_api_client.endpoints.projects import ProjectEndpoints\n", + "from exabyte_api_client.endpoints.materials import MaterialEndpoints\n", + "from exabyte_api_client.endpoints.bank_workflows import BankWorkflowEndpoints\n", + "from exabyte_api_client.endpoints.properties import PropertiesEndpoints\n", + "from exabyte_api_client.endpoints.workflows import WorkflowEndpoints\n", + "\n", + "job_endpoints = JobEndpoints(*ENDPOINT_ARGS)\n", + "project_endpoints = ProjectEndpoints(*ENDPOINT_ARGS)\n", + "material_endpoints = MaterialEndpoints(*ENDPOINT_ARGS)\n", + "property_endpoints = PropertiesEndpoints(*ENDPOINT_ARGS)\n", + "bank_workflow_endpoints = BankWorkflowEndpoints(*ENDPOINT_ARGS)\n", + "workflow_endpoints = WorkflowEndpoints(*ENDPOINT_ARGS)" + ], + "metadata": { + "id": "DhrPOrsC1oUU" + }, + "id": "DhrPOrsC1oUU", + "execution_count": 10, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "default_material = material_endpoints.list({\"isDefault\": True, \"owner._id\": ACCOUNT_ID})[0]\n", + "default_workflow = workflow_endpoints.list({\"isDefault\": True, \"owner._id\": ACCOUNT_ID})[0]\n", + "\n", + "material_id = default_material[\"_id\"]\n", + "workflow_id = default_workflow[\"_id\"]\n", + "owner_id = default_material[\"owner\"][\"_id\"]\n", + "\n", + "\n", + "material = material_endpoints.create(data)\n" + ], + "metadata": { + "id": "pj4JYE-P1qHq" + }, + "id": "pj4JYE-P1qHq", + "execution_count": 18, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "material[\"lattice\"]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "7E2RA-9i3I78", + "outputId": "fcc99176-d2a1-4bdc-b2ef-5939451518d1" + }, + "id": "7E2RA-9i3I78", + "execution_count": 22, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "{'a': 3.562364,\n", + " 'b': 3.562364,\n", + " 'c': 35.34665,\n", + " 'alpha': 90,\n", + " 'beta': 90,\n", + " 'gamma': 120,\n", + " 'units': {'length': 'angstrom', 'angle': 'degree'},\n", + " 'type': 'HEX',\n", + " 'vectors': {'a': [3.562364, 0, 0],\n", + " 'b': [-1.781182, 3.085098, 0],\n", + " 'c': [0, 0, 35.34665],\n", + " 'alat': 1,\n", + " 'units': 'angstrom'}}" + ] + }, + "metadata": {}, + "execution_count": 22 + } + ] + }, + { + "cell_type": "code", + "source": [ + "config = {\n", + " \"owner\": {\"_id\": owner_id},\n", + " \"_material\": {\"_id\": material[\"_id\"]},\n", + " \"workflow\": {\"_id\": workflow_id},\n", + " \"name\": \"MoTe2 Job\",\n", + "}\n" + ], + "metadata": { + "id": "ya-lbfsa1qDn" + }, + "id": "ya-lbfsa1qDn", + "execution_count": 23, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "job = job_endpoints.create(config)\n", + "job_endpoints.submit(job[\"_id\"])\n" + ], + "metadata": { + "id": "r4kJ54UP1p_2" + }, + "id": "r4kJ54UP1p_2", + "execution_count": 24, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "from utils.generic import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies\n", + "job_id = job[\"_id\"]\n", + "wait_for_jobs_to_finish(job_endpoints, [job_id])\n" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Pnlg7wto1p72", + "outputId": "92b75754-ad96-48c1-eec4-efc73fbda997" + }, + "id": "Pnlg7wto1p72", + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Wait for jobs to finish, poll interval: 10 sec\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:29:10 | 1 | 0 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:29:20 | 1 | 0 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:29:31 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:29:41 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:29:51 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:30:01 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:30:11 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:30:22 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:30:32 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:30:42 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:30:52 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:31:02 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:31:12 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:31:23 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:31:33 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:31:43 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:31:53 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:32:03 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:32:13 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:32:24 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:32:34 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:32:44 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:32:54 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:33:04 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:33:15 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:33:25 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:33:35 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:33:46 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:33:56 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:34:06 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:34:16 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:34:26 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:34:37 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:34:47 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:34:57 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "WcI1O2Av1p3a" + }, + "id": "WcI1O2Av1p3a", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "5DGDkfqu1pzT" + }, + "id": "5DGDkfqu1pzT", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "8R73k5DX1pvp" + }, + "id": "8R73k5DX1pvp", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "sO2L81es1prn" + }, + "id": "sO2L81es1prn", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "VatcYGKF1pn7" + }, + "id": "VatcYGKF1pn7", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Upload to Mat3ra.com\n", + "Finally, we can upload the material to Mat3ra.com using the REST API: follow the explanation in another example notebook [here](../../examples/material/create_material.ipynb). One can replace the content of the `CONFIG` variable with the JSON data above." + ], + "metadata": { + "collapsed": false, + "id": "a4a48479c7ea090f" + }, + "id": "a4a48479c7ea090f" + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + }, + "colab": { + "provenance": [] + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file From 2e2d3b448c050bebbe1ed58737e6798e85ae1402 Mon Sep 17 00:00:00 2001 From: Kamal Choudhary Date: Fri, 2 Feb 2024 12:36:03 -0500 Subject: [PATCH 2/5] Created using Colaboratory --- other/material/run_job_from_jarvis.ipynb | 34 ++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/other/material/run_job_from_jarvis.ipynb b/other/material/run_job_from_jarvis.ipynb index a016c694..7daff20e 100644 --- a/other/material/run_job_from_jarvis.ipynb +++ b/other/material/run_job_from_jarvis.ipynb @@ -373,8 +373,8 @@ "cell_type": "code", "source": [ "# @title Authorization Form\n", - "ACCOUNT_ID = \"7qzeKmx8jH8M73whg\" # @param {type:\"string\"}\n", - "AUTH_TOKEN = \"6jFd5x64XwUOUe9uhbHm5ydsbmB1Hkn7-Wgsjd72Dt0\" # @param {type:\"string\"}\n", + "ACCOUNT_ID = \"\" # @param {type:\"string\"}\n", + "AUTH_TOKEN = \"\" # @param {type:\"string\"}\n", "MATERIALS_PROJECT_API_KEY = \"MATERIALS_PROJECT_API_KEY\" # @param {type:\"string\"}\n", "ORGANIZATION_ID = \"\"\n", "\n", @@ -734,6 +734,36 @@ "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", "+=====================+==================+===============+=================+================+\n", "| 2024-02-02-17:34:57 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:35:07 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:35:18 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:35:28 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:35:38 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:35:48 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-02-02-17:35:58 | 0 | 1 | 0 | 0 |\n", "+---------------------+------------------+---------------+-----------------+----------------+\n" ] } From 1b833bc3614329fb6de9d3838811af7f969e037b Mon Sep 17 00:00:00 2001 From: Kamal Choudhary Date: Sat, 2 Mar 2024 16:28:59 -0500 Subject: [PATCH 3/5] Created using Colaboratory --- ...import_material_from_jarvis_db_entry.ipynb | 882 +++++++++++++++--- 1 file changed, 747 insertions(+), 135 deletions(-) diff --git a/other/material/import_material_from_jarvis_db_entry.ipynb b/other/material/import_material_from_jarvis_db_entry.ipynb index c62f70c5..c4e8e947 100644 --- a/other/material/import_material_from_jarvis_db_entry.ipynb +++ b/other/material/import_material_from_jarvis_db_entry.ipynb @@ -1,137 +1,749 @@ { - "cells": [ - { - "cell_type": "markdown", - "source": [ - "\n", - "\"Open\n", - "" - ], - "metadata": { - "collapsed": false - }, - "id": "3c567b6400249971" + "cells": [ + { + "cell_type": "markdown", + "source": [ + "\n", + "\"Open\n", + "" + ], + "metadata": { + "collapsed": false, + "id": "3c567b6400249971" + }, + "id": "3c567b6400249971" + }, + { + "cell_type": "markdown", + "source": [ + "## Install Packages\n", + "First, install `express-py` which includes `jarvis-tools` as dependency." + ], + "metadata": { + "collapsed": false, + "id": "8b00ab6854f2263b" + }, + "id": "8b00ab6854f2263b" + }, + { + "cell_type": "code", + "execution_count": 1, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m82.6/82.6 kB\u001b[0m \u001b[31m1.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.0/10.0 MB\u001b[0m \u001b[31m41.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.2/2.2 MB\u001b[0m \u001b[31m49.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m105.3/105.3 kB\u001b[0m \u001b[31m10.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m29.4/29.4 MB\u001b[0m \u001b[31m31.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m975.7/975.7 kB\u001b[0m \u001b[31m24.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m17.1/17.1 MB\u001b[0m \u001b[31m69.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m807.7/807.7 kB\u001b[0m \u001b[31m57.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m8.7/8.7 MB\u001b[0m \u001b[31m95.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m63.1/63.1 kB\u001b[0m \u001b[31m8.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.0/10.0 MB\u001b[0m \u001b[31m31.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.0/10.0 MB\u001b[0m \u001b[31m87.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.0/10.0 MB\u001b[0m \u001b[31m13.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.2/7.2 MB\u001b[0m \u001b[31m43.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n", + " Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n", + " Installing backend dependencies ... \u001b[?25l\u001b[?25hdone\n", + " Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.0/10.0 MB\u001b[0m \u001b[31m8.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.0/10.0 MB\u001b[0m \u001b[31m20.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.0/10.0 MB\u001b[0m \u001b[31m12.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m9.7/9.7 MB\u001b[0m \u001b[31m13.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.2/10.2 MB\u001b[0m \u001b[31m10.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.1/10.1 MB\u001b[0m \u001b[31m5.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m9.6/9.6 MB\u001b[0m \u001b[31m12.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m9.6/9.6 MB\u001b[0m \u001b[31m19.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m332.3/332.3 kB\u001b[0m \u001b[31m31.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m561.4/561.4 kB\u001b[0m \u001b[31m46.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m117.8/117.8 kB\u001b[0m \u001b[31m16.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m98.4/98.4 kB\u001b[0m \u001b[31m14.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.7/3.7 MB\u001b[0m \u001b[31m89.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m250.8/250.8 kB\u001b[0m \u001b[31m29.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m526.7/526.7 kB\u001b[0m \u001b[31m47.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m83.0/83.0 kB\u001b[0m \u001b[31m11.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h Building wheel for paginate (setup.py) ... \u001b[?25l\u001b[?25hdone\n", + "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", + "chex 0.1.85 requires numpy>=1.24.1, but you have numpy 1.23.5 which is incompatible.\u001b[0m\u001b[31m\n", + "\u001b[0m" + ] + } + ], + "source": [ + "!pip install -q express-py==2024.1.25.post7" + ], + "metadata": { + "id": "b1288bc79ee2c828", + "outputId": "5d53f995-2900-4d79-e53e-b84943ac6f5f", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "b1288bc79ee2c828" + }, + { + "cell_type": "markdown", + "source": [ + "## Get Materials Data From JARVIS\n", + "Then, let's get the dataset containing 2D materials from JARVIS and wrap it into a pandas dataframe." + ], + "metadata": { + "collapsed": false, + "id": "f418c51a7f794f9f" + }, + "id": "f418c51a7f794f9f" + }, + { + "cell_type": "code", + "execution_count": 2, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Obtaining 2D dataset 1.1k ...\n", + "Reference:https://www.nature.com/articles/s41524-020-00440-1\n", + "Other versions:https://doi.org/10.6084/m9.figshare.6815705\n" + ] + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "100%|██████████| 8.39M/8.39M [00:01<00:00, 7.59MiB/s]\n" + ] + }, + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Loading the zipfile...\n", + "Loading completed.\n" + ] + } + ], + "source": [ + "import pandas as pd\n", + "from jarvis.db.figshare import data, get_jid_data\n", + "\n", + "dft_2d=data('dft_2d')\n", + "df = pd.DataFrame(dft_2d)" + ], + "metadata": { + "id": "b1ee775d1476f884", + "outputId": "05bad3c3-99f5-47f8-eca0-d2abe89cab60", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "b1ee775d1476f884" + }, + { + "cell_type": "markdown", + "source": [ + "## Extract Structure and Convert to ESSE\n", + "Next, we extract an entry from the JARVIS dataset and convert it into ESSE format ready to be uploaded to Mat3ra.com." + ], + "metadata": { + "collapsed": false, + "id": "15fe5f9de299c935" + }, + "id": "15fe5f9de299c935" + }, + { + "cell_type": "code", + "execution_count": 3, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "{\n", + " \"_id\": \"\",\n", + " \"name\": \"material\",\n", + " \"exabyteId\": \"\",\n", + " \"hash\": \"\",\n", + " \"formula\": \"Te2Mo\",\n", + " \"unitCellFormula\": \"Te2 Mo1\",\n", + " \"lattice\": {\n", + " \"type\": \"HEX\",\n", + " \"a\": 3.562364004499092,\n", + " \"b\": 3.562364004499092,\n", + " \"c\": 35.346645,\n", + " \"alpha\": 90.0,\n", + " \"beta\": 90.0,\n", + " \"gamma\": 120.00001186178349,\n", + " \"units\": {\n", + " \"length\": \"angstrom\",\n", + " \"angle\": \"degree\"\n", + " }\n", + " },\n", + " \"basis\": {\n", + " \"units\": \"crystal\",\n", + " \"elements\": [\n", + " {\n", + " \"id\": 1,\n", + " \"value\": \"Te\"\n", + " },\n", + " {\n", + " \"id\": 2,\n", + " \"value\": \"Te\"\n", + " },\n", + " {\n", + " \"id\": 3,\n", + " \"value\": \"Mo\"\n", + " }\n", + " ],\n", + " \"coordinates\": [\n", + " {\n", + " \"id\": 1,\n", + " \"value\": [\n", + " 0.6666669999999999,\n", + " 0.3333330000000001,\n", + " 0.05727934272677686\n", + " ]\n", + " },\n", + " {\n", + " \"id\": 2,\n", + " \"value\": [\n", + " 0.6666669999999999,\n", + " 0.3333330000000001,\n", + " 0.15980865727548643\n", + " ]\n", + " },\n", + " {\n", + " \"id\": 3,\n", + " \"value\": [\n", + " 0.33333299999999993,\n", + " 0.6666670000000001,\n", + " 0.10854400000113165\n", + " ]\n", + " }\n", + " ]\n", + " },\n", + " \"derivedProperties\": [\n", + " {\n", + " \"name\": \"density\",\n", + " \"units\": \"g/cm^3\",\n", + " \"value\": 1.5009769971314555\n", + " },\n", + " {\n", + " \"name\": \"elemental_ratio\",\n", + " \"value\": 0.6666666666666666,\n", + " \"element\": \"Te\"\n", + " },\n", + " {\n", + " \"name\": \"elemental_ratio\",\n", + " \"value\": 0.3333333333333333,\n", + " \"element\": \"Mo\"\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 2,\n", + " \"degree\": 0\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 0.7453559924999299,\n", + " \"degree\": 2\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 0.6933612743506347,\n", + " \"degree\": 3\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 0.6707822056951861,\n", + " \"degree\": 5\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 0.667408235036379,\n", + " \"degree\": 7\n", + " },\n", + " {\n", + " \"name\": \"p-norm\",\n", + " \"value\": 0.6667317422407864,\n", + " \"degree\": 10\n", + " },\n", + " {\n", + " \"spaceGroupSymbol\": \"P-6m2\",\n", + " \"tolerance\": {\n", + " \"value\": 0.3,\n", + " \"units\": \"angstrom\"\n", + " },\n", + " \"name\": \"symmetry\"\n", + " },\n", + " {\n", + " \"name\": \"volume\",\n", + " \"units\": \"angstrom^3\",\n", + " \"value\": 388.46810374859973\n", + " }\n", + " ],\n", + " \"creator\": {\n", + " \"_id\": \"\",\n", + " \"cls\": \"User\",\n", + " \"slug\": \"\"\n", + " },\n", + " \"owner\": {\n", + " \"_id\": \"\",\n", + " \"cls\": \"Account\",\n", + " \"slug\": \"\"\n", + " },\n", + " \"schemaVersion\": \"0.2.0\"\n", + "}\n" + ] + } + ], + "source": [ + "import json\n", + "from express import ExPrESS\n", + "\n", + "## Note: JVASP-670 is an entry for MoTe2\n", + "jarvis_db_entry = json.dumps(json.loads(df[(df['jid']=='JVASP-670')].to_json(orient='records'))[0])\n", + "\n", + "kwargs = {\n", + " \"structure_string\": jarvis_db_entry,\n", + " \"cell_type\": \"original\",\n", + " \"structure_format\": \"jarvis-db-entry\"\n", + "}\n", + "\n", + "handler = ExPrESS(\"structure\", **kwargs)\n", + "data = handler.property(\"material\", **kwargs)\n", + "\n", + "# To preview resulting JSON data\n", + "print(json.dumps(data, indent=4))" + ], + "metadata": { + "id": "c41fb68c6d25fe48", + "outputId": "5b4dde68-58de-4301-8ac1-2cf55c1f1e0a", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "c41fb68c6d25fe48" + }, + { + "cell_type": "markdown", + "source": [ + "## Upload to Mat3ra.com\n", + "Finally, we can upload the material to Mat3ra.com using the REST API: follow the explanation in another example notebook [here](../../examples/material/create_material.ipynb). One can replace the content of the `CONFIG` variable with the JSON data above." + ], + "metadata": { + "collapsed": false, + "id": "a4a48479c7ea090f" + }, + "id": "a4a48479c7ea090f" + }, + { + "cell_type": "code", + "source": [ + "# @title Authorization Form\n", + "ACCOUNT_ID = \"xxxxxxxxxx\" # @param {type:\"string\"}\n", + "AUTH_TOKEN = \"xxxxxxxxxx\" # @param {type:\"string\"}\n", + "ORGANIZATION_ID = \"\"\n", + "\n", + "\n", + "import os\n", + "\n", + "if \"COLAB_JUPYTER_IP\" in os.environ:\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=ACCOUNT_ID,\n", + " AUTH_TOKEN=AUTH_TOKEN,\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=ORGANIZATION_ID,\n", + " )\n", + " )\n", + "\n", + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n" + ], + "metadata": { + "id": "jMqKRCE1Df9W", + "outputId": "a3d60149-a1fe-477a-bb68-34a7dcd4906c", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "jMqKRCE1Df9W", + "execution_count": 4, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Traceback (most recent call last):\n", + " File \"/usr/local/bin/notebook-path\", line 8, in \n", + " sys.exit(print_notebook_path())\n", + " File \"/usr/local/lib/python3.10/dist-packages/utils/notebook.py\", line 46, in print_notebook_path\n", + " print(get_notebook_info()[\"notebook_path\"])\n", + " File \"/usr/local/lib/python3.10/dist-packages/utils/notebook.py\", line 22, in get_notebook_info\n", + " parsed = re.findall(\"(.*)/blob/(.*)/examples/(.*)\", path)[0]\n", + "IndexError: list index out of range\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "Relevant functions from the API client" + ], + "metadata": { + "id": "UlNC2xpSEaQn" + }, + "id": "UlNC2xpSEaQn" + }, + { + "cell_type": "code", + "source": [ + "from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n", + "from utils.generic import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies, dataframe_to_html, display_JSON\n", + "\n", + "import pandas as pd\n", + "from exabyte_api_client.endpoints.jobs import JobEndpoints\n", + "from exabyte_api_client.endpoints.projects import ProjectEndpoints\n", + "from exabyte_api_client.endpoints.materials import MaterialEndpoints\n", + "from exabyte_api_client.endpoints.bank_workflows import BankWorkflowEndpoints\n", + "from exabyte_api_client.endpoints.properties import PropertiesEndpoints\n", + "from exabyte_api_client.endpoints.workflows import WorkflowEndpoints\n", + "\n", + "job_endpoints = JobEndpoints(*ENDPOINT_ARGS)\n", + "project_endpoints = ProjectEndpoints(*ENDPOINT_ARGS)\n", + "material_endpoints = MaterialEndpoints(*ENDPOINT_ARGS)\n", + "property_endpoints = PropertiesEndpoints(*ENDPOINT_ARGS)\n", + "bank_workflow_endpoints = BankWorkflowEndpoints(*ENDPOINT_ARGS)\n", + "workflow_endpoints = WorkflowEndpoints(*ENDPOINT_ARGS)" + ], + "metadata": { + "id": "983PpaMPDgAJ" + }, + "id": "983PpaMPDgAJ", + "execution_count": 5, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Make an example heterostructure" + ], + "metadata": { + "id": "efbVRY9JDu_H" + }, + "id": "efbVRY9JDu_H" + }, + { + "cell_type": "code", + "source": [ + "from jarvis.core.atoms import Atoms\n", + "from jarvis.analysis.interface.zur import make_interface\n", + "from jarvis.db.figshare import data\n", + "from jarvis.io.vasp.inputs import Poscar\n", + "import sys\n", + "\n", + "dft_2d_structs = data('dft_2d')\n", + "\n", + "jid1= 'JVASP-670'\n", + "jid2='JVASP-664'\n", + "for i in dft_2d_structs:\n", + " if i['jid']==jid1:\n", + " atoms1 = Atoms.from_dict(i['atoms'])\n", + "for i in dft_2d_structs:\n", + " if i['jid']==jid2:\n", + " atoms2 = Atoms.from_dict(i['atoms'])\n", + "\n", + "interf = make_interface(film=atoms1, subs=atoms2)\n", + "hetero = interf['interface'].center_around_origin()\n", + "print (jid1,jid2,atoms1.composition.reduced_formula,atoms2.composition.reduced_formula, hetero)\n", + "filename='POSCAR-'+jid1+jid2+'.vasp'\n", + "Poscar(hetero).write_file(filename)\n" + ], + "metadata": { + "id": "9xvUwBQfDgCM", + "outputId": "5ca8474b-03f0-420d-effe-92ec5fa8d2b6", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "9xvUwBQfDgCM", + "execution_count": 6, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Obtaining 2D dataset 1.1k ...\n", + "Reference:https://www.nature.com/articles/s41524-020-00440-1\n", + "Other versions:https://doi.org/10.6084/m9.figshare.6815705\n", + "Loading the zipfile...\n", + "Loading completed.\n", + "mismatch_u,mismatch_v -0.03226692878349979 -0.03226692878349979\n", + "JVASP-670 JVASP-664 Te2Mo MoS2 System\n", + "1.0\n", + "6.37593 -0.0 -0.0\n", + "3.18796 -5.52171 -0.0\n", + "-0.0 -0.0 -25.75734579378708\n", + "Mo S Te \n", + "7 8 6 \n", + "direct\n", + "0.36111136029246144 0.02777693088071573 0.6061329711247329 bottom\n", + "0.5555559999999957 0.11111066666667094 0.3584887699946901 bottom\n", + "0.22222266666666238 -0.2222226666666623 0.3584887699946901 bottom\n", + "-0.11111066666667099 -0.5555559999999956 0.3584887699946901 bottom\n", + "0.36111136029246127 -0.4722230691192842 0.6061329711247329 bottom\n", + "-0.13888863970753865 -0.4722230691192842 0.6061329711247329 bottom\n", + "-0.1388886397075386 0.02777693088071573 0.6061329711247329 bottom\n", + "0.19444431985376934 0.36111153455964207 0.5453107527903425 bottom\n", + "-0.30555568014623086 -0.13888846544035782 0.6669565435968711 bottom\n", + "-0.30555568014623075 0.36111153455964207 0.6669565435968711 bottom\n", + "0.19444431985376934 0.36111153455964207 0.6669565435968711 bottom\n", + "-0.30555568014623086 -0.13888846544035782 0.5453107527903425 bottom\n", + "-0.30555568014623075 0.36111153455964207 0.5453107527903425 top\n", + "0.1944443198537693 -0.13888846544035782 0.5453107527903425 top\n", + "0.1944443198537693 -0.13888846544035782 0.6669565435968711 top\n", + "-0.11111133333333112 0.11111133333333116 0.28813862196335355 top\n", + "-0.4444446666666646 -0.2222220000000021 0.28813862196335355 top\n", + "0.22222200000000225 0.44444466666666443 0.42883891802602647 top\n", + "-0.11111133333333112 0.11111133333333116 0.42883891802602647 top\n", + "-0.4444446666666646 -0.2222220000000021 0.42883891802602647 top\n", + "0.22222200000000225 0.44444466666666443 0.28813862196335355 top\n", + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "2OWzUG3ODssG" + }, + "id": "2OWzUG3ODssG", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "interf.keys()" + ], + "metadata": { + "id": "u_4WMY3WDyvr", + "outputId": "64fe059a-94ab-48d7-d511-c08a63d53476", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "u_4WMY3WDyvr", + "execution_count": 7, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "dict_keys(['mismatch_u', 'mismatch_v', 'mismatch_angle', 'area1', 'area2', 'film_sl', 'matches', 'subs_sl', 'interface'])" + ] + }, + "metadata": {}, + "execution_count": 7 + } + ] + }, + { + "cell_type": "code", + "source": [ + "from jarvis.core.atoms import Atoms\n", + "a=Atoms.from_poscar(\"POSCAR-JVASP-670JVASP-664.vasp\")" + ], + "metadata": { + "id": "Pj0f3m1LDyyP" + }, + "id": "Pj0f3m1LDyyP", + "execution_count": 9, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "import json\n", + "from express import ExPrESS\n", + "from utils.generic import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies\n", + "## Note: JVASP-670 is an entry for MoTe2\n", + "\n", + "\n", + "def atoms_to_job(name='interface-670-664', atoms=[],workflow=[]):\n", + " jarvis_db_entry = json.dumps({\"atoms\":atoms.to_dict()})\n", + " #json.dumps(json.loads(df[(df['jid']=='JVASP-670')].to_json(orient='records'))[0])\n", + "\n", + " kwargs = {\n", + " \"structure_string\": jarvis_db_entry,\n", + " \"cell_type\": \"original\",\n", + " \"structure_format\": \"jarvis-db-entry\"\n", + " }\n", + "\n", + " handler = ExPrESS(\"structure\", **kwargs)\n", + " data = handler.property(\"material\", **kwargs)\n", + " data[\"name\"] = name\n", + " material = material_endpoints.create(data)\n", + " default_workflow = workflow_endpoints.list({\"isDefault\": True, \"owner._id\": ACCOUNT_ID})[0]\n", + " workflow_id = default_workflow[\"_id\"]\n", + " owner_id = material[\"owner\"][\"_id\"]\n", + " config = {\n", + " \"owner\": {\"_id\": owner_id},\n", + " \"_material\": {\"_id\": material[\"_id\"]},\n", + " \"workflow\": {\"_id\": workflow_id},\n", + " \"name\": name,\n", + " }\n", + " job = job_endpoints.create(config)\n", + " job_endpoints.submit(job[\"_id\"])\n", + "\n", + " job_id = job[\"_id\"]\n", + " print(\"job_id\",job_id)\n", + " wait_for_jobs_to_finish(job_endpoints, [job_id])\n", + " return job_id" + ], + "metadata": { + "id": "POEKn0RrDy0L" + }, + "id": "POEKn0RrDy0L", + "execution_count": 10, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "atoms_to_job(atoms=a)" + ], + "metadata": { + "id": "xXZ8npX5Dy2i", + "outputId": "347341aa-4614-49f8-c810-09b22fac22a2", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "xXZ8npX5Dy2i", + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "job_id evFSF5Zgt4v2ZWeEW\n", + "Wait for jobs to finish, poll interval: 10 sec\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-03-02-21:27:20 | 1 | 0 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-03-02-21:27:30 | 1 | 0 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-03-02-21:27:41 | 1 | 0 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-03-02-21:27:51 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-03-02-21:28:01 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-03-02-21:28:12 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-03-02-21:28:22 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-03-02-21:28:32 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-03-02-21:28:43 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n", + "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", + "+=====================+==================+===============+=================+================+\n", + "| 2024-03-02-21:28:53 | 0 | 1 | 0 | 0 |\n", + "+---------------------+------------------+---------------+-----------------+----------------+\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "1MyDBpjLDy49" + }, + "id": "1MyDBpjLDy49", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "5bRINfFtDy7Q" + }, + "id": "5bRINfFtDy7Q", + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "0DQvEeiuDy9m" + }, + "id": "0DQvEeiuDy9m", + "execution_count": null, + "outputs": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + }, + "colab": { + "provenance": [] + } }, - { - "cell_type": "markdown", - "source": [ - "## Install Packages\n", - "First, install `express-py` which includes `jarvis-tools` as dependency." - ], - "metadata": { - "collapsed": false - }, - "id": "8b00ab6854f2263b" - }, - { - "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [ - "!pip install express-py==2024.1.25.post7" - ], - "metadata": { - "collapsed": false - }, - "id": "b1288bc79ee2c828" - }, - { - "cell_type": "markdown", - "source": [ - "## Get Materials Data From JARVIS\n", - "Then, let's get the dataset containing 2D materials from JARVIS and wrap it into a pandas dataframe." - ], - "metadata": { - "collapsed": false - }, - "id": "f418c51a7f794f9f" - }, - { - "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [ - "import pandas as pd\n", - "from jarvis.db.figshare import data, get_jid_data\n", - "\n", - "dft_2d=data('dft_2d')\n", - "df = pd.DataFrame(dft_2d)" - ], - "metadata": { - "collapsed": false - }, - "id": "b1ee775d1476f884" - }, - { - "cell_type": "markdown", - "source": [ - "## Extract Structure and Convert to ESSE\n", - "Next, we extract an entry from the JARVIS dataset and convert it into ESSE format ready to be uploaded to Mat3ra.com." - ], - "metadata": { - "collapsed": false - }, - "id": "15fe5f9de299c935" - }, - { - "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [ - "import json\n", - "from express import ExPrESS\n", - "\n", - "## Note: JVASP-670 is an entry for MoTe2\n", - "jarvis_db_entry = json.dumps(json.loads(df[(df['jid']=='JVASP-670')].to_json(orient='records'))[0])\n", - "\n", - "kwargs = {\n", - " \"structure_string\": jarvis_db_entry,\n", - " \"cell_type\": \"original\",\n", - " \"structure_format\": \"jarvis-db-entry\"\n", - "}\n", - "\n", - "handler = ExPrESS(\"structure\", **kwargs)\n", - "data = handler.property(\"material\", **kwargs)\n", - "\n", - "# To preview resulting JSON data\n", - "print(json.dumps(data, indent=4))" - ], - "metadata": { - "collapsed": false - }, - "id": "c41fb68c6d25fe48" - }, - { - "cell_type": "markdown", - "source": [ - "## Upload to Mat3ra.com\n", - "Finally, we can upload the material to Mat3ra.com using the REST API: follow the explanation in another example notebook [here](../../examples/material/create_material.ipynb). One can replace the content of the `CONFIG` variable with the JSON data above." - ], - "metadata": { - "collapsed": false - }, - "id": "a4a48479c7ea090f" - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 2 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.6" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file From ea2cae6808b8b19bdc2741cb90dac64be6d90445 Mon Sep 17 00:00:00 2001 From: Kamal Choudhary Date: Sat, 2 Mar 2024 16:31:17 -0500 Subject: [PATCH 4/5] Delete other/material/run_job_from_jarvis.ipynb --- other/material/run_job_from_jarvis.ipynb | 859 ----------------------- 1 file changed, 859 deletions(-) delete mode 100644 other/material/run_job_from_jarvis.ipynb diff --git a/other/material/run_job_from_jarvis.ipynb b/other/material/run_job_from_jarvis.ipynb deleted file mode 100644 index 7daff20e..00000000 --- a/other/material/run_job_from_jarvis.ipynb +++ /dev/null @@ -1,859 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "source": [ - "\n", - "\"Open\n", - "" - ], - "metadata": { - "collapsed": false, - "id": "3c567b6400249971" - }, - "id": "3c567b6400249971" - }, - { - "cell_type": "markdown", - "source": [ - "## Install Packages\n", - "First, install `express-py` which includes `jarvis-tools` as dependency." - ], - "metadata": { - "collapsed": false, - "id": "8b00ab6854f2263b" - }, - "id": "8b00ab6854f2263b" - }, - { - "cell_type": "code", - "execution_count": 4, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Requirement already satisfied: express-py==2024.1.25.post7 in /usr/local/lib/python3.10/dist-packages (2024.1.25.post7)\n", - "Requirement already satisfied: munch==2.5.0 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (2.5.0)\n", - "Requirement already satisfied: pymatgen>=2023.8.10 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (2023.9.25)\n", - "Requirement already satisfied: ase>=3.17.0 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (3.22.1)\n", - "Requirement already satisfied: mat3ra-esse>=2024.1.25.post7 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (2024.1.31.post0)\n", - "Requirement already satisfied: rdkit-pypi>=2022.3.5 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (2022.9.5)\n", - "Requirement already satisfied: jarvis-tools>=2023.12.12 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (2023.12.12)\n", - "Requirement already satisfied: numpy==1.23.5 in /usr/local/lib/python3.10/dist-packages (from express-py==2024.1.25.post7) (1.23.5)\n", - "Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from munch==2.5.0->express-py==2024.1.25.post7) (1.16.0)\n", - "Requirement already satisfied: matplotlib>=3.1.0 in /usr/local/lib/python3.10/dist-packages (from ase>=3.17.0->express-py==2024.1.25.post7) (3.7.1)\n", - "Requirement already satisfied: scipy>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from ase>=3.17.0->express-py==2024.1.25.post7) (1.11.4)\n", - "Requirement already satisfied: spglib>=1.14.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.3.0)\n", - "Requirement already satisfied: joblib>=0.14.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (1.3.2)\n", - "Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.31.0)\n", - "Requirement already satisfied: toolz>=0.9.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.12.1)\n", - "Requirement already satisfied: xmltodict>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.13.0)\n", - "Requirement already satisfied: tqdm>=4.41.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (4.66.1)\n", - "Requirement already satisfied: mkdocs-material>=9.0.5 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (9.5.6)\n", - "Requirement already satisfied: markdown>=3.2.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.5.2)\n", - "Requirement already satisfied: exabyte-json-include>=2023.12.23.post0 in /usr/local/lib/python3.10/dist-packages (from mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (2023.12.23.post0)\n", - "Requirement already satisfied: jsonschema>=2.6.0 in /usr/local/lib/python3.10/dist-packages (from mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (4.19.2)\n", - "Requirement already satisfied: monty>=3.0.2 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (2024.1.26)\n", - "Requirement already satisfied: networkx>=2.2 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (3.2.1)\n", - "Requirement already satisfied: palettable>=3.1.1 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (3.3.3)\n", - "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (1.5.3)\n", - "Requirement already satisfied: plotly>=4.5.0 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (5.15.0)\n", - "Requirement already satisfied: pybtex in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (0.24.0)\n", - "Requirement already satisfied: ruamel.yaml>=0.17.0 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (0.18.5)\n", - "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (1.12)\n", - "Requirement already satisfied: tabulate in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (0.9.0)\n", - "Requirement already satisfied: uncertainties>=3.1.4 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (3.1.7)\n", - "Requirement already satisfied: Pillow in /usr/local/lib/python3.10/dist-packages (from rdkit-pypi>=2022.3.5->express-py==2024.1.25.post7) (9.4.0)\n", - "Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (23.2.0)\n", - "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (2023.12.1)\n", - "Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (0.33.0)\n", - "Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (0.17.1)\n", - "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (1.2.0)\n", - "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (0.12.1)\n", - "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (4.47.2)\n", - "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (1.4.5)\n", - "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (23.2)\n", - "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (3.1.1)\n", - "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.1.0->ase>=3.17.0->express-py==2024.1.25.post7) (2.8.2)\n", - "Requirement already satisfied: babel~=2.10 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.14.0)\n", - "Requirement already satisfied: colorama~=0.4 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.4.6)\n", - "Requirement already satisfied: jinja2~=3.0 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.1.3)\n", - "Requirement already satisfied: mkdocs-material-extensions~=1.3 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (1.3.1)\n", - "Requirement already satisfied: mkdocs~=1.5.3 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (1.5.3)\n", - "Requirement already satisfied: paginate~=0.5 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.5.6)\n", - "Requirement already satisfied: pygments~=2.16 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.16.1)\n", - "Requirement already satisfied: pymdown-extensions~=10.2 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (10.7)\n", - "Requirement already satisfied: regex>=2022.4 in /usr/local/lib/python3.10/dist-packages (from mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2023.6.3)\n", - "Requirement already satisfied: tenacity>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from plotly>=4.5.0->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (8.2.3)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.3.2)\n", - "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.6)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.0.7)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2023.11.17)\n", - "Requirement already satisfied: ruamel.yaml.clib>=0.2.7 in /usr/local/lib/python3.10/dist-packages (from ruamel.yaml>=0.17.0->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (0.2.8)\n", - "Requirement already satisfied: future in /usr/local/lib/python3.10/dist-packages (from uncertainties>=3.1.4->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (0.18.3)\n", - "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (2023.4)\n", - "Requirement already satisfied: PyYAML>=3.01 in /usr/local/lib/python3.10/dist-packages (from pybtex->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (6.0.1)\n", - "Requirement already satisfied: latexcodec>=1.0.4 in /usr/local/lib/python3.10/dist-packages (from pybtex->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (2.0.1)\n", - "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (1.3.0)\n", - "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2~=3.0->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.1.4)\n", - "Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (8.1.7)\n", - "Requirement already satisfied: ghp-import>=1.0 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.1.0)\n", - "Requirement already satisfied: mergedeep>=1.3.4 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (1.3.4)\n", - "Requirement already satisfied: pathspec>=0.11.1 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.12.1)\n", - "Requirement already satisfied: platformdirs>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (4.1.0)\n", - "Requirement already satisfied: pyyaml-env-tag>=0.1 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.1)\n", - "Requirement already satisfied: watchdog>=2.0 in /usr/local/lib/python3.10/dist-packages (from mkdocs~=1.5.3->mkdocs-material>=9.0.5->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.0.0)\n" - ] - } - ], - "source": [ - "!pip install express-py==2024.1.25.post7\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "b1288bc79ee2c828", - "outputId": "65f99dbc-c663-4a34-cb23-aefdfbb5ab42" - }, - "id": "b1288bc79ee2c828" - }, - { - "cell_type": "markdown", - "source": [ - "## Get Materials Data From JARVIS\n", - "Then, let's get the dataset containing 2D materials from JARVIS and wrap it into a pandas dataframe." - ], - "metadata": { - "collapsed": false, - "id": "f418c51a7f794f9f" - }, - "id": "f418c51a7f794f9f" - }, - { - "cell_type": "code", - "execution_count": 5, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Obtaining 2D dataset 1.1k ...\n", - "Reference:https://www.nature.com/articles/s41524-020-00440-1\n", - "Other versions:https://doi.org/10.6084/m9.figshare.6815705\n", - "Loading the zipfile...\n", - "Loading completed.\n" - ] - } - ], - "source": [ - "import pandas as pd\n", - "from jarvis.db.figshare import data, get_jid_data\n", - "\n", - "dft_2d=data('dft_2d')\n", - "df = pd.DataFrame(dft_2d)" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "b1ee775d1476f884", - "outputId": "37e962cb-7438-4066-dc9e-6b033173397c" - }, - "id": "b1ee775d1476f884" - }, - { - "cell_type": "markdown", - "source": [ - "## Extract Structure and Convert to ESSE\n", - "Next, we extract an entry from the JARVIS dataset and convert it into ESSE format ready to be uploaded to Mat3ra.com." - ], - "metadata": { - "collapsed": false, - "id": "15fe5f9de299c935" - }, - "id": "15fe5f9de299c935" - }, - { - "cell_type": "code", - "execution_count": 6, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "{\n", - " \"_id\": \"\",\n", - " \"name\": \"material\",\n", - " \"exabyteId\": \"\",\n", - " \"hash\": \"\",\n", - " \"formula\": \"Te2Mo\",\n", - " \"unitCellFormula\": \"Te2 Mo1\",\n", - " \"lattice\": {\n", - " \"type\": \"HEX\",\n", - " \"a\": 3.562364004499092,\n", - " \"b\": 3.562364004499092,\n", - " \"c\": 35.346645,\n", - " \"alpha\": 90.0,\n", - " \"beta\": 90.0,\n", - " \"gamma\": 120.00001186178349,\n", - " \"units\": {\n", - " \"length\": \"angstrom\",\n", - " \"angle\": \"degree\"\n", - " }\n", - " },\n", - " \"basis\": {\n", - " \"units\": \"crystal\",\n", - " \"elements\": [\n", - " {\n", - " \"id\": 1,\n", - " \"value\": \"Te\"\n", - " },\n", - " {\n", - " \"id\": 2,\n", - " \"value\": \"Te\"\n", - " },\n", - " {\n", - " \"id\": 3,\n", - " \"value\": \"Mo\"\n", - " }\n", - " ],\n", - " \"coordinates\": [\n", - " {\n", - " \"id\": 1,\n", - " \"value\": [\n", - " 0.6666669999999999,\n", - " 0.3333330000000001,\n", - " 0.05727934272677686\n", - " ]\n", - " },\n", - " {\n", - " \"id\": 2,\n", - " \"value\": [\n", - " 0.6666669999999999,\n", - " 0.3333330000000001,\n", - " 0.15980865727548643\n", - " ]\n", - " },\n", - " {\n", - " \"id\": 3,\n", - " \"value\": [\n", - " 0.33333299999999993,\n", - " 0.6666670000000001,\n", - " 0.10854400000113165\n", - " ]\n", - " }\n", - " ]\n", - " },\n", - " \"derivedProperties\": [\n", - " {\n", - " \"name\": \"density\",\n", - " \"units\": \"g/cm^3\",\n", - " \"value\": 1.5009769971314555\n", - " },\n", - " {\n", - " \"name\": \"elemental_ratio\",\n", - " \"value\": 0.6666666666666666,\n", - " \"element\": \"Te\"\n", - " },\n", - " {\n", - " \"name\": \"elemental_ratio\",\n", - " \"value\": 0.3333333333333333,\n", - " \"element\": \"Mo\"\n", - " },\n", - " {\n", - " \"name\": \"p-norm\",\n", - " \"value\": 2,\n", - " \"degree\": 0\n", - " },\n", - " {\n", - " \"name\": \"p-norm\",\n", - " \"value\": 0.7453559924999299,\n", - " \"degree\": 2\n", - " },\n", - " {\n", - " \"name\": \"p-norm\",\n", - " \"value\": 0.6933612743506347,\n", - " \"degree\": 3\n", - " },\n", - " {\n", - " \"name\": \"p-norm\",\n", - " \"value\": 0.6707822056951861,\n", - " \"degree\": 5\n", - " },\n", - " {\n", - " \"name\": \"p-norm\",\n", - " \"value\": 0.667408235036379,\n", - " \"degree\": 7\n", - " },\n", - " {\n", - " \"name\": \"p-norm\",\n", - " \"value\": 0.6667317422407864,\n", - " \"degree\": 10\n", - " },\n", - " {\n", - " \"spaceGroupSymbol\": \"P-6m2\",\n", - " \"tolerance\": {\n", - " \"value\": 0.3,\n", - " \"units\": \"angstrom\"\n", - " },\n", - " \"name\": \"symmetry\"\n", - " },\n", - " {\n", - " \"name\": \"volume\",\n", - " \"units\": \"angstrom^3\",\n", - " \"value\": 388.46810374859973\n", - " }\n", - " ],\n", - " \"creator\": {\n", - " \"_id\": \"\",\n", - " \"cls\": \"User\",\n", - " \"slug\": \"\"\n", - " },\n", - " \"owner\": {\n", - " \"_id\": \"\",\n", - " \"cls\": \"Account\",\n", - " \"slug\": \"\"\n", - " },\n", - " \"schemaVersion\": \"0.2.0\"\n", - "}\n" - ] - } - ], - "source": [ - "import json\n", - "from express import ExPrESS\n", - "\n", - "## Note: JVASP-670 is an entry for MoTe2\n", - "jarvis_db_entry = json.dumps(json.loads(df[(df['jid']=='JVASP-670')].to_json(orient='records'))[0])\n", - "\n", - "kwargs = {\n", - " \"structure_string\": jarvis_db_entry,\n", - " \"cell_type\": \"original\",\n", - " \"structure_format\": \"jarvis-db-entry\"\n", - "}\n", - "\n", - "handler = ExPrESS(\"structure\", **kwargs)\n", - "data = handler.property(\"material\", **kwargs)\n", - "\n", - "# To preview resulting JSON data\n", - "print(json.dumps(data, indent=4))" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "c41fb68c6d25fe48", - "outputId": "2e609d57-b063-48cb-de10-c2a6c0a6ce6e" - }, - "id": "c41fb68c6d25fe48" - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "TTfqDI6722cG" - }, - "id": "TTfqDI6722cG", - "execution_count": 17, - "outputs": [] - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "esZRmwMR22WV" - }, - "id": "esZRmwMR22WV", - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# @title Authorization Form\n", - "ACCOUNT_ID = \"\" # @param {type:\"string\"}\n", - "AUTH_TOKEN = \"\" # @param {type:\"string\"}\n", - "MATERIALS_PROJECT_API_KEY = \"MATERIALS_PROJECT_API_KEY\" # @param {type:\"string\"}\n", - "ORGANIZATION_ID = \"\"\n", - "\n", - "\n", - "import os\n", - "\n", - "if \"COLAB_JUPYTER_IP\" in os.environ:\n", - " os.environ.update(\n", - " dict(\n", - " ACCOUNT_ID=ACCOUNT_ID,\n", - " AUTH_TOKEN=AUTH_TOKEN,\n", - " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", - " ORGANIZATION_ID=ORGANIZATION_ID,\n", - " )\n", - " )\n", - "\n", - " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Lf8xXwCW1grk", - "outputId": "af553eb9-4681-4059-f177-4ad23ef218c3" - }, - "id": "Lf8xXwCW1grk", - "execution_count": 7, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Traceback (most recent call last):\n", - " File \"/usr/local/bin/notebook-path\", line 8, in \n", - " sys.exit(print_notebook_path())\n", - " File \"/usr/local/lib/python3.10/dist-packages/utils/notebook.py\", line 46, in print_notebook_path\n", - " print(get_notebook_info()[\"notebook_path\"])\n", - " File \"/usr/local/lib/python3.10/dist-packages/utils/notebook.py\", line 22, in get_notebook_info\n", - " parsed = re.findall(\"(.*)/blob/(.*)/examples/(.*)\", path)[0]\n", - "IndexError: list index out of range\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [ - "from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n", - "from utils.generic import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies, dataframe_to_html, display_JSON\n", - "\n", - "import pandas as pd\n", - "\n", - "# Relevant functions from the API client\n", - "from exabyte_api_client.endpoints.jobs import JobEndpoints\n", - "from exabyte_api_client.endpoints.projects import ProjectEndpoints\n", - "from exabyte_api_client.endpoints.materials import MaterialEndpoints\n", - "from exabyte_api_client.endpoints.bank_workflows import BankWorkflowEndpoints\n", - "from exabyte_api_client.endpoints.properties import PropertiesEndpoints\n", - "from exabyte_api_client.endpoints.workflows import WorkflowEndpoints\n", - "\n", - "job_endpoints = JobEndpoints(*ENDPOINT_ARGS)\n", - "project_endpoints = ProjectEndpoints(*ENDPOINT_ARGS)\n", - "material_endpoints = MaterialEndpoints(*ENDPOINT_ARGS)\n", - "property_endpoints = PropertiesEndpoints(*ENDPOINT_ARGS)\n", - "bank_workflow_endpoints = BankWorkflowEndpoints(*ENDPOINT_ARGS)\n", - "workflow_endpoints = WorkflowEndpoints(*ENDPOINT_ARGS)" - ], - "metadata": { - "id": "DhrPOrsC1oUU" - }, - "id": "DhrPOrsC1oUU", - "execution_count": 10, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "default_material = material_endpoints.list({\"isDefault\": True, \"owner._id\": ACCOUNT_ID})[0]\n", - "default_workflow = workflow_endpoints.list({\"isDefault\": True, \"owner._id\": ACCOUNT_ID})[0]\n", - "\n", - "material_id = default_material[\"_id\"]\n", - "workflow_id = default_workflow[\"_id\"]\n", - "owner_id = default_material[\"owner\"][\"_id\"]\n", - "\n", - "\n", - "material = material_endpoints.create(data)\n" - ], - "metadata": { - "id": "pj4JYE-P1qHq" - }, - "id": "pj4JYE-P1qHq", - "execution_count": 18, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "material[\"lattice\"]" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "7E2RA-9i3I78", - "outputId": "fcc99176-d2a1-4bdc-b2ef-5939451518d1" - }, - "id": "7E2RA-9i3I78", - "execution_count": 22, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "{'a': 3.562364,\n", - " 'b': 3.562364,\n", - " 'c': 35.34665,\n", - " 'alpha': 90,\n", - " 'beta': 90,\n", - " 'gamma': 120,\n", - " 'units': {'length': 'angstrom', 'angle': 'degree'},\n", - " 'type': 'HEX',\n", - " 'vectors': {'a': [3.562364, 0, 0],\n", - " 'b': [-1.781182, 3.085098, 0],\n", - " 'c': [0, 0, 35.34665],\n", - " 'alat': 1,\n", - " 'units': 'angstrom'}}" - ] - }, - "metadata": {}, - "execution_count": 22 - } - ] - }, - { - "cell_type": "code", - "source": [ - "config = {\n", - " \"owner\": {\"_id\": owner_id},\n", - " \"_material\": {\"_id\": material[\"_id\"]},\n", - " \"workflow\": {\"_id\": workflow_id},\n", - " \"name\": \"MoTe2 Job\",\n", - "}\n" - ], - "metadata": { - "id": "ya-lbfsa1qDn" - }, - "id": "ya-lbfsa1qDn", - "execution_count": 23, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "job = job_endpoints.create(config)\n", - "job_endpoints.submit(job[\"_id\"])\n" - ], - "metadata": { - "id": "r4kJ54UP1p_2" - }, - "id": "r4kJ54UP1p_2", - "execution_count": 24, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "from utils.generic import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies\n", - "job_id = job[\"_id\"]\n", - "wait_for_jobs_to_finish(job_endpoints, [job_id])\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Pnlg7wto1p72", - "outputId": "92b75754-ad96-48c1-eec4-efc73fbda997" - }, - "id": "Pnlg7wto1p72", - "execution_count": null, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Wait for jobs to finish, poll interval: 10 sec\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:29:10 | 1 | 0 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:29:20 | 1 | 0 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:29:31 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:29:41 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:29:51 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:30:01 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:30:11 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:30:22 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:30:32 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:30:42 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:30:52 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:31:02 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:31:12 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:31:23 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:31:33 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:31:43 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:31:53 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:32:03 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:32:13 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:32:24 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:32:34 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:32:44 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:32:54 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:33:04 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:33:15 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:33:25 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:33:35 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:33:46 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:33:56 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:34:06 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:34:16 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:34:26 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:34:37 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:34:47 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:34:57 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:35:07 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:35:18 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:35:28 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:35:38 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:35:48 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n", - "| TIME | SUBMITTED-JOBS | ACTIVE-JOBS | FINISHED-JOBS | ERRORED-JOBS |\n", - "+=====================+==================+===============+=================+================+\n", - "| 2024-02-02-17:35:58 | 0 | 1 | 0 | 0 |\n", - "+---------------------+------------------+---------------+-----------------+----------------+\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "WcI1O2Av1p3a" - }, - "id": "WcI1O2Av1p3a", - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "5DGDkfqu1pzT" - }, - "id": "5DGDkfqu1pzT", - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "8R73k5DX1pvp" - }, - "id": "8R73k5DX1pvp", - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "sO2L81es1prn" - }, - "id": "sO2L81es1prn", - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "VatcYGKF1pn7" - }, - "id": "VatcYGKF1pn7", - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "## Upload to Mat3ra.com\n", - "Finally, we can upload the material to Mat3ra.com using the REST API: follow the explanation in another example notebook [here](../../examples/material/create_material.ipynb). One can replace the content of the `CONFIG` variable with the JSON data above." - ], - "metadata": { - "collapsed": false, - "id": "a4a48479c7ea090f" - }, - "id": "a4a48479c7ea090f" - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 2 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.6" - }, - "colab": { - "provenance": [] - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} \ No newline at end of file From 94783d1c37d3d8d527029ab6f4be8a713d65efea Mon Sep 17 00:00:00 2001 From: Kamal Choudhary Date: Fri, 9 Aug 2024 12:18:54 -0400 Subject: [PATCH 5/5] Created using Colab --- ...un_job_using_material_from_jarvis_db.ipynb | 1239 +++++++++++++++++ 1 file changed, 1239 insertions(+) create mode 100644 other/jarvis/run_job_using_material_from_jarvis_db.ipynb diff --git a/other/jarvis/run_job_using_material_from_jarvis_db.ipynb b/other/jarvis/run_job_using_material_from_jarvis_db.ipynb new file mode 100644 index 00000000..467d0f9c --- /dev/null +++ b/other/jarvis/run_job_using_material_from_jarvis_db.ipynb @@ -0,0 +1,1239 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "\n", + "\"Open\n", + "" + ], + "metadata": { + "collapsed": false, + "id": "3c567b6400249971" + }, + "id": "3c567b6400249971" + }, + { + "cell_type": "markdown", + "source": [ + "## Install Packages\n", + "First, install `express-py` which includes `jarvis-tools` as dependency." + ], + "metadata": { + "collapsed": false, + "id": "8b00ab6854f2263b" + }, + "id": "8b00ab6854f2263b" + }, + { + "cell_type": "code", + "execution_count": 1, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Collecting express-py==2024.1.25.post7\n", + " Downloading express_py-2024.1.25.post7-py3-none-any.whl.metadata (9.1 kB)\n", + "Collecting munch==2.5.0 (from express-py==2024.1.25.post7)\n", + " Downloading munch-2.5.0-py2.py3-none-any.whl.metadata (5.8 kB)\n", + "Collecting pymatgen>=2023.8.10 (from express-py==2024.1.25.post7)\n", + " Downloading pymatgen-2024.8.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (13 kB)\n", + "Collecting ase>=3.17.0 (from express-py==2024.1.25.post7)\n", + " Downloading ase-3.23.0-py3-none-any.whl.metadata (3.8 kB)\n", + "Collecting mat3ra-esse>=2024.1.25.post7 (from express-py==2024.1.25.post7)\n", + " Downloading mat3ra_esse-2024.6.4.post1-py3-none-any.whl.metadata (8.9 kB)\n", + "Collecting rdkit-pypi>=2022.3.5 (from express-py==2024.1.25.post7)\n", + " Downloading rdkit_pypi-2022.9.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.9 kB)\n", + "Collecting jarvis-tools>=2023.12.12 (from express-py==2024.1.25.post7)\n", + " Downloading jarvis_tools-2024.5.10-py2.py3-none-any.whl.metadata (3.5 kB)\n", + "Collecting numpy==1.23.5 (from express-py==2024.1.25.post7)\n", + " Downloading numpy-1.23.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.3 kB)\n", + "Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from munch==2.5.0->express-py==2024.1.25.post7) (1.16.0)\n", + "Requirement already satisfied: scipy>=1.6.0 in /usr/local/lib/python3.10/dist-packages (from ase>=3.17.0->express-py==2024.1.25.post7) (1.13.1)\n", + "Requirement already satisfied: matplotlib>=3.3.4 in /usr/local/lib/python3.10/dist-packages (from ase>=3.17.0->express-py==2024.1.25.post7) (3.7.1)\n", + "Collecting spglib>=1.14.1 (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7)\n", + " Downloading spglib-2.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.2 kB)\n", + "Requirement already satisfied: joblib>=0.14.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (1.4.2)\n", + "Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.32.3)\n", + "Requirement already satisfied: toolz>=0.9.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (0.12.1)\n", + "Collecting xmltodict>=0.11.0 (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7)\n", + " Downloading xmltodict-0.13.0-py2.py3-none-any.whl.metadata (7.7 kB)\n", + "Requirement already satisfied: tqdm>=4.41.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (4.66.5)\n", + "Requirement already satisfied: scikit-learn in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (1.3.2)\n", + "Requirement already satisfied: inflect in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (7.3.1)\n", + "Collecting exabyte-json-include>=2023.12.23.post0 (from mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7)\n", + " Downloading exabyte_json_include-2023.12.23.post0-py3-none-any.whl.metadata (3.1 kB)\n", + "Requirement already satisfied: jsonschema>=2.6.0 in /usr/local/lib/python3.10/dist-packages (from mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (4.23.0)\n", + "Collecting matplotlib>=3.3.4 (from ase>=3.17.0->express-py==2024.1.25.post7)\n", + " Downloading matplotlib-3.9.1.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)\n", + "Collecting monty>=2024.7.29 (from pymatgen>=2023.8.10->express-py==2024.1.25.post7)\n", + " Downloading monty-2024.7.30-py3-none-any.whl.metadata (3.2 kB)\n", + "Requirement already satisfied: networkx>=2.2 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (3.3)\n", + "Collecting palettable>=3.3.3 (from pymatgen>=2023.8.10->express-py==2024.1.25.post7)\n", + " Downloading palettable-3.3.3-py2.py3-none-any.whl.metadata (3.3 kB)\n", + "Requirement already satisfied: pandas>=2 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (2.1.4)\n", + "Requirement already satisfied: plotly>=4.5.0 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (5.15.0)\n", + "Collecting pybtex>=0.24.0 (from pymatgen>=2023.8.10->express-py==2024.1.25.post7)\n", + " Downloading pybtex-0.24.0-py2.py3-none-any.whl.metadata (2.0 kB)\n", + "Collecting ruamel.yaml>=0.17.0 (from pymatgen>=2023.8.10->express-py==2024.1.25.post7)\n", + " Downloading ruamel.yaml-0.18.6-py3-none-any.whl.metadata (23 kB)\n", + "Requirement already satisfied: sympy>=1.2 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (1.13.1)\n", + "Requirement already satisfied: tabulate>=0.9 in /usr/local/lib/python3.10/dist-packages (from pymatgen>=2023.8.10->express-py==2024.1.25.post7) (0.9.0)\n", + "Collecting uncertainties>=3.1.4 (from pymatgen>=2023.8.10->express-py==2024.1.25.post7)\n", + " Downloading uncertainties-3.2.2-py3-none-any.whl.metadata (6.9 kB)\n", + "INFO: pip is looking at multiple versions of pymatgen to determine which version is compatible with other requirements. This could take a while.\n", + "Collecting pymatgen>=2023.8.10 (from express-py==2024.1.25.post7)\n", + " Downloading pymatgen-2024.7.18-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (13 kB)\n", + " Downloading pymatgen-2024.6.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (13 kB)\n", + " Downloading pymatgen-2024.6.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (13 kB)\n", + " Downloading pymatgen-2024.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (13 kB)\n", + " Downloading pymatgen-2024.4.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (13 kB)\n", + " Downloading pymatgen-2024.4.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (13 kB)\n", + " Downloading pymatgen-2024.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", + "INFO: pip is still looking at multiple versions of pymatgen to determine which version is compatible with other requirements. This could take a while.\n", + " Downloading pymatgen-2024.2.23-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", + " Downloading pymatgen-2024.2.20-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", + " Downloading pymatgen-2024.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", + " Downloading pymatgen-2024.1.27.tar.gz (7.2 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.2/7.2 MB\u001b[0m \u001b[31m5.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n", + " Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n", + " Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", + " Downloading pymatgen-2024.1.26-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", + "INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.\n", + " Downloading pymatgen-2023.12.18-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (13 kB)\n", + " Downloading pymatgen-2023.11.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", + " Downloading pymatgen-2023.11.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (13 kB)\n", + " Downloading pymatgen-2023.10.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", + " Downloading pymatgen-2023.10.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", + " Downloading pymatgen-2023.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", + " Downloading pymatgen-2023.9.25-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)\n", + "Requirement already satisfied: Pillow in /usr/local/lib/python3.10/dist-packages (from rdkit-pypi>=2022.3.5->express-py==2024.1.25.post7) (9.4.0)\n", + "Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (24.1.0)\n", + "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (2023.12.1)\n", + "Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (0.35.1)\n", + "Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=2.6.0->mat3ra-esse>=2024.1.25.post7->express-py==2024.1.25.post7) (0.19.1)\n", + "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.4->ase>=3.17.0->express-py==2024.1.25.post7) (1.2.1)\n", + "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.4->ase>=3.17.0->express-py==2024.1.25.post7) (0.12.1)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.4->ase>=3.17.0->express-py==2024.1.25.post7) (4.53.1)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.4->ase>=3.17.0->express-py==2024.1.25.post7) (1.4.5)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.4->ase>=3.17.0->express-py==2024.1.25.post7) (24.1)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.4->ase>=3.17.0->express-py==2024.1.25.post7) (3.1.2)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.3.4->ase>=3.17.0->express-py==2024.1.25.post7) (2.8.2)\n", + "Requirement already satisfied: tenacity>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from plotly>=4.5.0->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (9.0.0)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.3.2)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.7)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2.0.7)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (2024.7.4)\n", + "Collecting ruamel.yaml.clib>=0.2.7 (from ruamel.yaml>=0.17.0->pymatgen>=2023.8.10->express-py==2024.1.25.post7)\n", + " Downloading ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.metadata (2.2 kB)\n", + "Requirement already satisfied: more-itertools>=8.5.0 in /usr/local/lib/python3.10/dist-packages (from inflect->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (10.3.0)\n", + "Requirement already satisfied: typeguard>=4.0.1 in /usr/local/lib/python3.10/dist-packages (from inflect->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (4.3.0)\n", + "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=2->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (2024.1)\n", + "Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=2->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (2024.1)\n", + "Requirement already satisfied: PyYAML>=3.01 in /usr/local/lib/python3.10/dist-packages (from pybtex>=0.24.0->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (6.0.1)\n", + "Collecting latexcodec>=1.0.4 (from pybtex>=0.24.0->pymatgen>=2023.8.10->express-py==2024.1.25.post7)\n", + " Downloading latexcodec-3.0.0-py3-none-any.whl.metadata (4.9 kB)\n", + "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (3.5.0)\n", + "Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from sympy>=1.2->pymatgen>=2023.8.10->express-py==2024.1.25.post7) (1.3.0)\n", + "Requirement already satisfied: typing-extensions>=4.10.0 in /usr/local/lib/python3.10/dist-packages (from typeguard>=4.0.1->inflect->jarvis-tools>=2023.12.12->express-py==2024.1.25.post7) (4.12.2)\n", + "Downloading express_py-2024.1.25.post7-py3-none-any.whl (82 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m82.6/82.6 kB\u001b[0m \u001b[31m5.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading munch-2.5.0-py2.py3-none-any.whl (10 kB)\n", + "Downloading numpy-1.23.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m17.1/17.1 MB\u001b[0m \u001b[31m78.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading ase-3.23.0-py3-none-any.whl (2.9 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.9/2.9 MB\u001b[0m \u001b[31m23.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading jarvis_tools-2024.5.10-py2.py3-none-any.whl (4.2 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m4.2/4.2 MB\u001b[0m \u001b[31m73.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading mat3ra_esse-2024.6.4.post1-py3-none-any.whl (488 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m488.6/488.6 kB\u001b[0m \u001b[31m25.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading pymatgen-2023.9.25-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m9.6/9.6 MB\u001b[0m \u001b[31m10.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading rdkit_pypi-2022.9.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (29.4 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m29.4/29.4 MB\u001b[0m \u001b[31m17.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading exabyte_json_include-2023.12.23.post0-py3-none-any.whl (5.3 kB)\n", + "Downloading monty-2024.7.30-py3-none-any.whl (48 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m48.9/48.9 kB\u001b[0m \u001b[31m2.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading palettable-3.3.3-py2.py3-none-any.whl (332 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m332.3/332.3 kB\u001b[0m \u001b[31m17.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading ruamel.yaml-0.18.6-py3-none-any.whl (117 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m117.8/117.8 kB\u001b[0m \u001b[31m7.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading spglib-2.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.1/1.1 MB\u001b[0m \u001b[31m13.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading uncertainties-3.2.2-py3-none-any.whl (58 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m3.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading xmltodict-0.13.0-py2.py3-none-any.whl (10.0 kB)\n", + "Downloading pybtex-0.24.0-py2.py3-none-any.whl (561 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m561.4/561.4 kB\u001b[0m \u001b[31m25.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading latexcodec-3.0.0-py3-none-any.whl (18 kB)\n", + "Downloading ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (526 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m526.7/526.7 kB\u001b[0m \u001b[31m26.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hInstalling collected packages: xmltodict, uncertainties, ruamel.yaml.clib, palettable, numpy, munch, monty, latexcodec, exabyte-json-include, spglib, ruamel.yaml, rdkit-pypi, pybtex, pymatgen, mat3ra-esse, jarvis-tools, ase, express-py\n", + " Attempting uninstall: numpy\n", + " Found existing installation: numpy 1.26.4\n", + " Uninstalling numpy-1.26.4:\n", + " Successfully uninstalled numpy-1.26.4\n", + "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", + "xgboost 2.1.1 requires nvidia-nccl-cu12; platform_system == \"Linux\" and platform_machine != \"aarch64\", which is not installed.\n", + "albucore 0.0.13 requires numpy<2,>=1.24.4, but you have numpy 1.23.5 which is incompatible.\n", + "albumentations 1.4.12 requires numpy>=1.24.4, but you have numpy 1.23.5 which is incompatible.\n", + "chex 0.1.86 requires numpy>=1.24.1, but you have numpy 1.23.5 which is incompatible.\n", + "pandas-stubs 2.1.4.231227 requires numpy>=1.26.0; python_version < \"3.13\", but you have numpy 1.23.5 which is incompatible.\u001b[0m\u001b[31m\n", + "\u001b[0mSuccessfully installed ase-3.23.0 exabyte-json-include-2023.12.23.post0 express-py-2024.1.25.post7 jarvis-tools-2024.5.10 latexcodec-3.0.0 mat3ra-esse-2024.6.4.post1 monty-2024.7.30 munch-2.5.0 numpy-1.23.5 palettable-3.3.3 pybtex-0.24.0 pymatgen-2023.9.25 rdkit-pypi-2022.9.5 ruamel.yaml-0.18.6 ruamel.yaml.clib-0.2.8 spglib-2.5.0 uncertainties-3.2.2 xmltodict-0.13.0\n" + ] + }, + { + "output_type": "display_data", + "data": { + "application/vnd.colab-display-data+json": { + "pip_warning": { + "packages": [ + "numpy" + ] + }, + "id": "c347a50fa91f480bbfb607464fbcc7ae" + } + }, + "metadata": {} + } + ], + "source": [ + "!pip install express-py==2024.1.25.post7" + ], + "metadata": { + "id": "b1288bc79ee2c828", + "outputId": "6d4b3123-4223-4ff8-e98f-c6a3129ec31d", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + } + }, + "id": "b1288bc79ee2c828" + }, + { + "cell_type": "code", + "source": [ + "pip install intermat" + ], + "metadata": { + "id": "rmuCwrRU2kAY", + "outputId": "ca340a89-d157-4160-9df6-71a8815c79cf", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "rmuCwrRU2kAY", + "execution_count": 1, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Collecting intermat\n", + " Using cached intermat-2024.3.24-py2.py3-none-any.whl.metadata (30 kB)\n", + "Requirement already satisfied: numpy>=1.22.0 in /usr/local/lib/python3.10/dist-packages (from intermat) (1.23.5)\n", + "Requirement already satisfied: scipy>=1.6.3 in /usr/local/lib/python3.10/dist-packages (from intermat) (1.13.1)\n", + "Requirement already satisfied: jarvis-tools>=2021.07.19 in /usr/local/lib/python3.10/dist-packages (from intermat) (2024.5.10)\n", + "Collecting pydantic-settings (from intermat)\n", + " Downloading pydantic_settings-2.4.0-py3-none-any.whl.metadata (3.5 kB)\n", + "Requirement already satisfied: matplotlib>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2021.07.19->intermat) (3.7.1)\n", + "Requirement already satisfied: spglib>=1.14.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2021.07.19->intermat) (2.5.0)\n", + "Requirement already satisfied: joblib>=0.14.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2021.07.19->intermat) (1.4.2)\n", + "Requirement already satisfied: requests>=2.23.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2021.07.19->intermat) (2.32.3)\n", + "Requirement already satisfied: toolz>=0.9.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2021.07.19->intermat) (0.12.1)\n", + "Requirement already satisfied: xmltodict>=0.11.0 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2021.07.19->intermat) (0.13.0)\n", + "Requirement already satisfied: tqdm>=4.41.1 in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2021.07.19->intermat) (4.66.5)\n", + "Requirement already satisfied: scikit-learn in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2021.07.19->intermat) (1.3.2)\n", + "Requirement already satisfied: inflect in /usr/local/lib/python3.10/dist-packages (from jarvis-tools>=2021.07.19->intermat) (7.3.1)\n", + "Requirement already satisfied: pydantic>=2.7.0 in /usr/local/lib/python3.10/dist-packages (from pydantic-settings->intermat) (2.8.2)\n", + "Collecting python-dotenv>=0.21.0 (from pydantic-settings->intermat)\n", + " Downloading python_dotenv-1.0.1-py3-none-any.whl.metadata (23 kB)\n", + "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.0.0->jarvis-tools>=2021.07.19->intermat) (1.2.1)\n", + "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.0.0->jarvis-tools>=2021.07.19->intermat) (0.12.1)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.0.0->jarvis-tools>=2021.07.19->intermat) (4.53.1)\n", + "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.0.0->jarvis-tools>=2021.07.19->intermat) (1.4.5)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.0.0->jarvis-tools>=2021.07.19->intermat) (24.1)\n", + "Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.0.0->jarvis-tools>=2021.07.19->intermat) (9.4.0)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.0.0->jarvis-tools>=2021.07.19->intermat) (3.1.2)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.0.0->jarvis-tools>=2021.07.19->intermat) (2.8.2)\n", + "Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic>=2.7.0->pydantic-settings->intermat) (0.7.0)\n", + "Requirement already satisfied: pydantic-core==2.20.1 in /usr/local/lib/python3.10/dist-packages (from pydantic>=2.7.0->pydantic-settings->intermat) (2.20.1)\n", + "Requirement already satisfied: typing-extensions>=4.6.1 in /usr/local/lib/python3.10/dist-packages (from pydantic>=2.7.0->pydantic-settings->intermat) (4.12.2)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2021.07.19->intermat) (3.3.2)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2021.07.19->intermat) (3.7)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2021.07.19->intermat) (2.0.7)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.23.0->jarvis-tools>=2021.07.19->intermat) (2024.7.4)\n", + "Requirement already satisfied: more-itertools>=8.5.0 in /usr/local/lib/python3.10/dist-packages (from inflect->jarvis-tools>=2021.07.19->intermat) (10.3.0)\n", + "Requirement already satisfied: typeguard>=4.0.1 in /usr/local/lib/python3.10/dist-packages (from inflect->jarvis-tools>=2021.07.19->intermat) (4.3.0)\n", + "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn->jarvis-tools>=2021.07.19->intermat) (3.5.0)\n", + "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.7->matplotlib>=3.0.0->jarvis-tools>=2021.07.19->intermat) (1.16.0)\n", + "Downloading intermat-2024.3.24-py2.py3-none-any.whl (49 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.1/49.1 kB\u001b[0m \u001b[31m2.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading pydantic_settings-2.4.0-py3-none-any.whl (23 kB)\n", + "Downloading python_dotenv-1.0.1-py3-none-any.whl (19 kB)\n", + "Installing collected packages: python-dotenv, pydantic-settings, intermat\n", + "Successfully installed intermat-2024.3.24 pydantic-settings-2.4.0 python-dotenv-1.0.1\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "from jarvis.db.jsonutils import dumpjson,loadjson\n", + "from jarvis.db.jsonutils import dumpjson\n", + "import plotly.graph_objects as go\n", + "\n", + "config = {'calculator_method': 'ewald',\n", + " 'disp_intvl': 0.1,\n", + " 'film_index': '1_1_0',\n", + " 'film_jid': 'JVASP-1002',\n", + " 'substrate_index': '1_1_0',\n", + " 'substrate_jid': 'JVASP-1174'}\n", + "\n", + "dumpjson(data=config,filename='config_example2.json')\n", + "!run_intermat.py --config_file config_example2.json >out2\n", + "\n", + "res=loadjson('intermat_results.json')" + ], + "metadata": { + "id": "P6zHf-Sl3rBi", + "outputId": "fc423ce2-78a9-4514-f4df-fdbcff80261a", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "P6zHf-Sl3rBi", + "execution_count": 2, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "100% 40.8M/40.8M [00:00<00:00, 59.2MiB/s]\n", + "/usr/local/lib/python3.10/dist-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['number']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", + " warnings.warn(\n", + "/usr/local/lib/python3.10/dist-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['international']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", + " warnings.warn(\n", + "/usr/local/lib/python3.10/dist-packages/intermat/generate.py:52: RuntimeWarning: invalid value encountered in double_scalars\n", + " strain_x = (\n", + "/usr/local/lib/python3.10/dist-packages/intermat/generate.py:55: RuntimeWarning: invalid value encountered in double_scalars\n", + " strain_y = (\n", + "100% 100/100 [00:20<00:00, 4.99it/s]\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "%matplotlib inline\n", + "import matplotlib.pyplot as plt\n", + "plt.contourf(res['wads'],cmap='plasma')\n", + "plt.axis('off')\n" + ], + "metadata": { + "id": "wtXpDYge3-fB", + "outputId": "f4163b89-e31f-4b0e-81ae-2a7c64eefb60", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 424 + } + }, + "id": "wtXpDYge3-fB", + "execution_count": 3, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "(0.0, 9.0, 0.0, 9.0)" + ] + }, + "metadata": {}, + "execution_count": 3 + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgMAAAGFCAYAAABg2vAPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAQN0lEQVR4nO3du7IsZQEF4ObUgQyRhADESDShisD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LfLiZ+euNjYjzHA4QS6Did+RuRiowxjgCYIdHlO/iRysbHOW09PT0+1DwIAqOdV7QMAAOoyBgAgnDEAAOGMAQAIZwwAQDhjAADCGQMAEM4YAIBwxgAAhPs/aTr/bV7piyQAAAAASUVORK5CYII=\n" + }, + "metadata": {} + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(res.keys())" + ], + "metadata": { + "id": "XyD6CziN4SjN", + "outputId": "89861441-3e9b-4939-dd57-834486a6a676", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "XyD6CziN4SjN", + "execution_count": 4, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "dict_keys(['systems', 'time_taken', 'wads'])\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "from jarvis.core.atoms import Atoms\n", + "\n", + "intf = Atoms.from_dict(res['systems'])\n", + "print (intf)" + ], + "metadata": { + "id": "ugq7lJ804VlP", + "outputId": "3bb8bd09-476b-47c5-ade4-6a076113d699", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "ugq7lJ804VlP", + "execution_count": 6, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "System\n", + "1.0\n", + "-0.0 5.73163 -0.0\n", + "8.10575 -0.0 -0.0\n", + "-0.0 -0.0 -26.34364366645526\n", + "As Ga Si \n", + "12 12 24 \n", + "direct\n", + "0.12500000000000017 0.033333436916792386 0.8511499074085056 bottom\n", + "0.12500000000000017 0.5333333678611532 0.6973034974115482 bottom\n", + "0.12500000000000017 0.033333298805513695 0.5434570874145908 bottom\n", + "0.12500000000000017 0.5333332297498745 0.5434570874145905 bottom\n", + "0.12500000000000017 0.033333298805513695 0.6973034974115482 bottom\n", + "0.12500000000000017 0.5333333678611529 0.8511499074085056 bottom\n", + "0.6249999999999999 -0.21666666666666684 0.6203802924130692 bottom\n", + "0.6249999999999999 0.28333340238897264 0.7742267024100271 bottom\n", + "0.6249999999999999 -0.2166665285553881 0.9280731124069845 bottom\n", + "0.6249999999999999 0.28333340238897264 0.9280731124069845 bottom\n", + "0.6249999999999999 -0.21666666666666684 0.7742267024100271 bottom\n", + "0.6249999999999999 0.2833332642776941 0.6203802924130692 bottom\n", + "0.37499999999999994 0.28333340238897264 0.8511499074085056 bottom\n", + "0.37499999999999994 -0.21666666666666684 0.6973034974115482 bottom\n", + "0.37499999999999994 0.2833332642776941 0.5434570874145908 bottom\n", + "0.37499999999999994 0.7833331952220548 0.5434570874145905 bottom\n", + "0.875 0.033333298805513695 0.7742267024100271 bottom\n", + "0.875 0.5333332297498745 0.6203802924130692 bottom\n", + "0.875 0.033333436916792164 0.9280731124069845 bottom\n", + "0.875 0.5333333678611529 0.7742267024100271 bottom\n", + "0.875 0.033333298805513695 0.6203802924130692 bottom\n", + "0.37499999999999994 -0.21666666666666684 0.8511499074085056 bottom\n", + "0.37499999999999994 0.2833332642776941 0.6973034974115482 bottom\n", + "0.875 0.5333333678611532 0.9280731124069845 bottom\n", + "-0.3750000000000001 0.5416666666666665 0.3010994243760031 top\n", + "-0.3750000000000001 0.0416669207054052 0.4485575215231648 top\n", + "-0.12499999999999999 0.2916662856085588 0.1536413272288415 top\n", + "-0.12499999999999999 -0.20833346035270264 0.3010994243760031 top\n", + "0.12500000000000003 0.2916667936860361 0.2273703758024223 top\n", + "0.12500000000000003 -0.20833346035270264 0.07991227865526063 top\n", + "-0.3750000000000001 0.04166641262792811 0.1536413272288415 top\n", + "0.12500000000000003 -0.20833295227522575 0.374828472949584 top\n", + "0.375 0.04166641262792811 0.07991227865526063 top\n", + "-0.12499999999999999 0.2916667936860361 0.44855752152316475 top\n", + "-0.12499999999999999 -0.20833295227522575 0.44855752152316475 top\n", + "-0.3750000000000001 0.04166692070540543 0.30109942437600307 top\n", + "-0.12499999999999999 -0.20833346035270264 0.1536413272288415 top\n", + "-0.3750000000000001 -0.458332825255856 0.44855752152316475 top\n", + "-0.3750000000000001 -0.4583333333333334 0.1536413272288415 top\n", + "0.375 -0.4583333333333334 0.3748284729495839 top\n", + "0.375 0.04166641262792811 0.2273703758024223 top\n", + "0.375 0.5416661585891899 0.07991227865526063 top\n", + "0.12500000000000003 0.2916667936860363 0.3748284729495839 top\n", + "0.12500000000000003 -0.20833346035270264 0.2273703758024223 top\n", + "0.12500000000000003 0.2916662856085588 0.07991227865526063 top\n", + "0.375 -0.4583333333333334 0.2273703758024223 top\n", + "-0.12499999999999999 0.2916667936860361 0.3010994243760031 top\n", + "0.375 0.0416669207054052 0.3748284729495839 top\n", + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "pos_subs=\"\"\"GaAs\n", + "1.0\n", + "3.509895098013499 -6.584084e-10 2.026439508259945\n", + "1.169965032050413 3.3091606691404545 2.026439508259945\n", + "-1.8622597e-09 -1.3168164e-09 4.052878022970947\n", + "Ga As\n", + "1 1\n", + "Cartesian\n", + "0.0 0.0 0.0\n", + "1.1699675 0.82729 2.02644\n", + "\"\"\"\n", + "\n", + "pos_film=\"\"\"Si2\n", + "1.0\n", + "3.3641499856336465 -2.5027128e-09 1.94229273881412\n", + "1.121382991333525 3.1717517190189715 1.9422927388141193\n", + "-2.5909987e-09 -1.8321133e-09 3.884586486670313\n", + "Si\n", + "2\n", + "Cartesian\n", + "3.92483875 2.77528125 6.7980237500000005\n", + "0.56069125 0.39646875 0.9711462500000001\n", + "\"\"\"\n", + "with open('pos_film','w') as f:\n", + " f.write(pos_film)\n", + "\n", + "with open('pos_subs','w') as f:\n", + " f.write(pos_subs)" + ], + "metadata": { + "id": "SD-aFiTF4n_F" + }, + "id": "SD-aFiTF4n_F", + "execution_count": 7, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "from jarvis.db.jsonutils import dumpjson,loadjson\n", + "from jarvis.db.jsonutils import dumpjson\n", + "import plotly.graph_objects as go\n", + "\n", + "config = {'calculator_method': 'ewald',\n", + " 'disp_intvl': 0.1,\n", + " 'film_file_path': 'pos_film',\n", + " 'substrate_file_path': 'pos_subs',\n", + " 'film_index': '1_1_0',\n", + " 'substrate_index': '1_1_0'}\n", + "\n", + "dumpjson(data=config,filename='config_example2.json')\n", + "!run_intermat.py --config_file config_example2.json >out2\n", + "\n", + "res=loadjson('intermat_results.json')" + ], + "metadata": { + "id": "iiZy09iU4n8d", + "outputId": "926105ff-b0d0-4d76-8212-ba7c2c108aee", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "iiZy09iU4n8d", + "execution_count": 10, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "/usr/local/lib/python3.10/dist-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['number']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", + " warnings.warn(\n", + "/usr/local/lib/python3.10/dist-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['international']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead\n", + " warnings.warn(\n", + "/usr/local/lib/python3.10/dist-packages/intermat/generate.py:52: RuntimeWarning: invalid value encountered in double_scalars\n", + " strain_x = (\n", + "/usr/local/lib/python3.10/dist-packages/intermat/generate.py:55: RuntimeWarning: invalid value encountered in double_scalars\n", + " strain_y = (\n", + "100% 100/100 [00:32<00:00, 3.05it/s]\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "%matplotlib inline\n", + "import matplotlib.pyplot as plt\n", + "plt.contourf(res['wads'],cmap='plasma')\n", + "plt.axis('off')\n" + ], + "metadata": { + "id": "Gbk5MPBw7o1z", + "outputId": "24d0fafa-12c1-42aa-b180-ecc9f298cf19", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 424 + } + }, + "id": "Gbk5MPBw7o1z", + "execution_count": 11, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "(0.0, 9.0, 0.0, 9.0)" + ] + }, + "metadata": {}, + "execution_count": 11 + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
" + ], + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgMAAAGFCAYAAAB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iSN7kQYa5dx4Bw7m/OYyzkjECf7Gvu46tPxrRpDAhnH649TwJNS3RJPy6fK10yhtljQFjHItDUoEfG42JjDNU/M0AbBJrSnPhzudjojzHATQLNXE783ONio33GALMJNCdO/mzlYqMtxgCbCPT4nPg5gouNuowBihLo/jn50woXG8cxBtidQLfLiZ+euNjYjzHA4QS6Did+RuRiowxjgCYIdHlO/iRysbHOW09PT0+1DwIAqOdV7QMAAOoyBgAgnDEAAOGMAQAIZwwAQDhjAADCGQMAEM4YAIBwxgAAhPs/aTr/bV7piyQAAAAASUVORK5CYII=\n" + }, + "metadata": {} + } + ] + }, + { + "cell_type": "code", + "source": [ + "from jarvis.core.atoms import Atoms\n", + "\n", + "intf = Atoms.from_dict(res['systems'])\n", + "print (intf)" + ], + "metadata": { + "id": "WZ8LRJbK4n6G", + "outputId": "c9535f8e-d0a5-43e4-a219-8820191e2da5", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "id": "WZ8LRJbK4n6G", + "execution_count": 12, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "System\n", + "1.0\n", + "-0.0 5.73163 -0.0\n", + "8.10575 -0.0 -0.0\n", + "-0.0 -0.0 -26.34364366645526\n", + "As Ga Si \n", + "12 12 24 \n", + "direct\n", + "0.12500000000000017 0.033333436916792386 0.8511499074085056 bottom\n", + "0.12500000000000017 0.5333333678611532 0.6973034974115482 bottom\n", + "0.12500000000000017 0.033333298805513695 0.5434570874145908 bottom\n", + "0.12500000000000017 0.5333332297498745 0.5434570874145905 bottom\n", + "0.12500000000000017 0.033333298805513695 0.6973034974115482 bottom\n", + "0.12500000000000017 0.5333333678611529 0.8511499074085056 bottom\n", + "0.6249999999999999 -0.21666666666666684 0.6203802924130692 bottom\n", + "0.6249999999999999 0.28333340238897264 0.7742267024100271 bottom\n", + "0.6249999999999999 -0.2166665285553881 0.9280731124069845 bottom\n", + "0.6249999999999999 0.28333340238897264 0.9280731124069845 bottom\n", + "0.6249999999999999 -0.21666666666666684 0.7742267024100271 bottom\n", + "0.6249999999999999 0.2833332642776941 0.6203802924130692 bottom\n", + "0.37499999999999994 0.28333340238897264 0.8511499074085056 bottom\n", + "0.37499999999999994 -0.21666666666666684 0.6973034974115482 bottom\n", + "0.37499999999999994 0.2833332642776941 0.5434570874145908 bottom\n", + "0.37499999999999994 0.7833331952220548 0.5434570874145905 bottom\n", + "0.875 0.033333298805513695 0.7742267024100271 bottom\n", + "0.875 0.5333332297498745 0.6203802924130692 bottom\n", + "0.875 0.033333436916792164 0.9280731124069845 bottom\n", + "0.875 0.5333333678611529 0.7742267024100271 bottom\n", + "0.875 0.033333298805513695 0.6203802924130692 bottom\n", + "0.37499999999999994 -0.21666666666666684 0.8511499074085056 bottom\n", + "0.37499999999999994 0.2833332642776941 0.6973034974115482 bottom\n", + "0.875 0.5333333678611532 0.9280731124069845 bottom\n", + "-0.3750000000000001 0.5416666666666665 0.3010994243760031 top\n", + "-0.3750000000000001 0.0416669207054052 0.4485575215231648 top\n", + "-0.12499999999999999 0.2916662856085588 0.1536413272288415 top\n", + "-0.12499999999999999 -0.20833346035270264 0.3010994243760031 top\n", + "0.12500000000000003 0.2916667936860361 0.2273703758024223 top\n", + "0.12500000000000003 -0.20833346035270264 0.07991227865526063 top\n", + "-0.3750000000000001 0.04166641262792811 0.1536413272288415 top\n", + "0.12500000000000003 -0.20833295227522575 0.374828472949584 top\n", + "0.375 0.04166641262792811 0.07991227865526063 top\n", + "-0.12499999999999999 0.2916667936860361 0.44855752152316475 top\n", + "-0.12499999999999999 -0.20833295227522575 0.44855752152316475 top\n", + "-0.3750000000000001 0.04166692070540543 0.30109942437600307 top\n", + "-0.12499999999999999 -0.20833346035270264 0.1536413272288415 top\n", + "-0.3750000000000001 -0.458332825255856 0.44855752152316475 top\n", + "-0.3750000000000001 -0.4583333333333334 0.1536413272288415 top\n", + "0.375 -0.4583333333333334 0.3748284729495839 top\n", + "0.375 0.04166641262792811 0.2273703758024223 top\n", + "0.375 0.5416661585891899 0.07991227865526063 top\n", + "0.12500000000000003 0.2916667936860363 0.3748284729495839 top\n", + "0.12500000000000003 -0.20833346035270264 0.2273703758024223 top\n", + "0.12500000000000003 0.2916662856085588 0.07991227865526063 top\n", + "0.375 -0.4583333333333334 0.2273703758024223 top\n", + "-0.12499999999999999 0.2916667936860361 0.3010994243760031 top\n", + "0.375 0.0416669207054052 0.3748284729495839 top\n", + "\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Get Materials Data From JARVIS\n", + "Then, let\"s get the dataset containing 2D materials from JARVIS and wrap it into a pandas dataframe." + ], + "metadata": { + "collapsed": false, + "id": "f418c51a7f794f9f" + }, + "id": "f418c51a7f794f9f" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "import pandas as pd\n", + "from jarvis.db.figshare import data, get_jid_data\n", + "\n", + "dft_2d = data(\"dft_2d\")\n", + "df = pd.DataFrame(dft_2d)" + ], + "metadata": { + "id": "b1ee775d1476f884" + }, + "id": "b1ee775d1476f884" + }, + { + "cell_type": "markdown", + "source": [ + "## Create a simple heterostructure\n", + "\n", + "We use two material ids and place them one above another." + ], + "metadata": { + "collapsed": false, + "id": "9035ff20f1483b33" + }, + "id": "9035ff20f1483b33" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "from jarvis.core.atoms import Atoms\n", + "from jarvis.analysis.interface.zur import make_interface\n", + "\n", + "## Note: JVASP-670 is an entry for MoTe2\n", + "jid1 = \"JVASP-670\"\n", + "jid2 =\"JVASP-664\"\n", + "\n", + "for i in dft_2d:\n", + " if i[\"jid\"] == jid1:\n", + " atoms1 = Atoms.from_dict(i[\"atoms\"])\n", + "for i in dft_2d:\n", + " if i[\"jid\"] == jid2:\n", + " atoms2 = Atoms.from_dict(i[\"atoms\"])\n", + "\n", + "interface_atoms_dict = make_interface(film=atoms1, subs=atoms2)\n", + "heterostructure_atoms = interface_atoms_dict[\"interface\"].center_around_origin()\n", + "\n", + "print (jid1,jid2,atoms1.composition.reduced_formula,atoms2.composition.reduced_formula, heterostructure_atoms)" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "1b3e7d016f30b61" + }, + "id": "1b3e7d016f30b61" + }, + { + "cell_type": "markdown", + "source": [ + "## Extract the film and substrate" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + }, + "id": "4d59e226b39bbf41" + }, + "id": "4d59e226b39bbf41" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "# Using the fractional coordinate Z level of 0.5 to separate top/bottom\n", + "# See also https://github.com/usnistgov/jarvis/issues/311\n", + "heterostructure_atoms_copy = Atoms.from_dict(heterostructure_atoms.to_dict())\n", + "indices_to_remove = []\n", + "for index, coord in enumerate(heterostructure_atoms_copy.coords):\n", + " print(coord, index)\n", + " if coord[2] < 0.5:\n", + " indices_to_remove.append(index)\n", + "for i, ind in enumerate(indices_to_remove):\n", + " heterostructure_atoms_copy = heterostructure_atoms_copy.remove_site_by_index(ind - i)\n", + " print(\"removed\", ind, heterostructure_atoms_copy.props)\n", + "substrate_atoms = Atoms.from_dict(heterostructure_atoms_copy.to_dict())\n", + "\n", + "heterostructure_atoms_copy = Atoms.from_dict(heterostructure_atoms.to_dict())\n", + "indices_to_remove = []\n", + "for index, coord in enumerate(heterostructure_atoms_copy.coords):\n", + " print(coord, index)\n", + " if coord[2] > 0.5:\n", + " indices_to_remove.append(index)\n", + "for i, ind in enumerate(indices_to_remove):\n", + " heterostructure_atoms_copy = heterostructure_atoms_copy.remove_site_by_index(ind - i)\n", + " print(\"removed\", ind, heterostructure_atoms_copy.props)\n", + "film_atoms = Atoms.from_dict(heterostructure_atoms_copy.to_dict())" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "c60f1cdeca83df6a" + }, + "id": "c60f1cdeca83df6a" + }, + { + "cell_type": "markdown", + "source": [ + "## Extract Structure and Convert to ESSE\n", + "Next, we extract an entry from the JARVIS dataset and convert it into ESSE format ready to be uploaded to Mat3ra.com." + ], + "metadata": { + "collapsed": false, + "id": "15fe5f9de299c935" + }, + "id": "15fe5f9de299c935" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "import json\n", + "from express import ExPrESS\n", + "\n", + "def jarvis_atoms_to_esse(atoms):\n", + " # JARVIS Atoms return poscar as representation\n", + " # https://github.com/usnistgov/jarvis/blob/master/jarvis/core/atoms.py#L1333\n", + " poscar = atoms.__repr__()\n", + " kwargs = {\n", + " \"structure_string\": poscar,\n", + " \"cell_type\": \"original\",\n", + " \"structure_format\": \"poscar\"\n", + " }\n", + " handler = ExPrESS(\"structure\", **kwargs)\n", + " material = handler.property(\"material\", **kwargs)\n", + " return material\n", + "\n", + "material_film = jarvis_atoms_to_esse(film_atoms)\n", + "material_substrate = jarvis_atoms_to_esse(substrate_atoms)\n", + "material_heterostructure = jarvis_atoms_to_esse(heterostructure_atoms)\n", + "\n", + "# To preview resulting JSON data\n", + "print(json.dumps(material_heterostructure, indent=4))" + ], + "metadata": { + "id": "c41fb68c6d25fe48" + }, + "id": "c41fb68c6d25fe48" + }, + { + "cell_type": "markdown", + "source": [ + "## Setup the API credentials\n", + "Finally, we can upload the material to Mat3ra.com using the REST API: follow the explanation in another example notebook [here](../../examples/material/create_material.ipynb). One can replace the content of the `CONFIG` variable with the JSON data above." + ], + "metadata": { + "collapsed": false, + "id": "a4a48479c7ea090f" + }, + "id": "a4a48479c7ea090f" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "# @title Authorization Form\n", + "ACCOUNT_ID = \"\" # @param {type:\"string\"}\n", + "AUTH_TOKEN = \"\" # @param {type:\"string\"}\n", + "MATERIALS_PROJECT_API_KEY = \"MATERIALS_PROJECT_API_KEY\" # @param {type:\"string\"}\n", + "ORGANIZATION_ID = \"\"\n", + "\n", + "\n", + "import os\n", + "\n", + "if \"COLAB_JUPYTER_IP\" in os.environ:\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=ACCOUNT_ID,\n", + " AUTH_TOKEN=AUTH_TOKEN,\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=ORGANIZATION_ID,\n", + " )\n", + " )\n", + "\n", + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "5b2ae68afcacc16" + }, + "id": "5b2ae68afcacc16" + }, + { + "cell_type": "markdown", + "source": [ + "## Initialize the API Endpoints" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + }, + "id": "deac6f9f10d31b19" + }, + "id": "deac6f9f10d31b19" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n", + "from utils.generic import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies, dataframe_to_html, display_JSON\n", + "\n", + "# Relevant functions from the API client\n", + "from exabyte_api_client.endpoints.jobs import JobEndpoints\n", + "from exabyte_api_client.endpoints.projects import ProjectEndpoints\n", + "from exabyte_api_client.endpoints.materials import MaterialEndpoints\n", + "from exabyte_api_client.endpoints.bank_workflows import BankWorkflowEndpoints\n", + "from exabyte_api_client.endpoints.properties import PropertiesEndpoints\n", + "\n", + "job_endpoints = JobEndpoints(*ENDPOINT_ARGS)\n", + "project_endpoints = ProjectEndpoints(*ENDPOINT_ARGS)\n", + "material_endpoints = MaterialEndpoints(*ENDPOINT_ARGS)\n", + "property_endpoints = PropertiesEndpoints(*ENDPOINT_ARGS)\n", + "bank_workflow_endpoints = BankWorkflowEndpoints(*ENDPOINT_ARGS)" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "979e35d5e828f794" + }, + "id": "979e35d5e828f794" + }, + { + "cell_type": "markdown", + "source": [ + "## Create Material in the platform" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + }, + "id": "6ea47ba011947ad5" + }, + "id": "6ea47ba011947ad5" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "material_heterostructure[\"name\"] = f\"Heterostructure - {jid1} with {jid2}\"\n", + "material_heterostructure_in_the_platform = material_endpoints.create(material_heterostructure)\n", + "\n", + "material_film[\"name\"] = f\"Film - {jid1}\"\n", + "material_film_in_the_platform = material_endpoints.create(material_film)\n", + "\n", + "material_substrate[\"name\"] = f\"Substrate - {jid2}\"\n", + "material_substrate_in_the_platform = material_endpoints.create(material_substrate)" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "84b4ae0786b716cc" + }, + "id": "84b4ae0786b716cc" + }, + { + "cell_type": "markdown", + "source": [ + "## Create a workflow if it does not exist yet\n", + "\n", + "Here we utilize the id of the Valence Band bank workflow from \"curators\" account `kXJ9j9piJTddX9FHz` and import it if it does not exist in the account collection." + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + }, + "id": "ca5e8436bab6f5bd" + }, + "id": "ca5e8436bab6f5bd" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "BANK_ID = \"kXJ9j9piJTddX9FHz\"\n", + "workflow_in_the_platform = bank_workflow_endpoints.copy(BANK_ID, ACCOUNT_ID)" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "443484aaa75ac2ff" + }, + "id": "443484aaa75ac2ff" + }, + { + "cell_type": "markdown", + "source": [ + "## Create and Run a Job\n", + "\n", + "Create Job config" + ], + "metadata": { + "collapsed": false, + "id": "da418324b250a490" + }, + "id": "da418324b250a490" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "PPN = \"4\"\n", + "QUEUE = \"D\"\n", + "NODES = \"1\"\n", + "TIME_LIMIT = \"01:00:00\"\n", + "# Using MSFT Azure cluster with a bit larger memory bandwidth in \"D\" queue\n", + "CLUSTER = \"master-production-20160630-cluster-007.exabyte.io\"\n", + "\n", + "compute = job_endpoints.get_compute(CLUSTER, PPN, NODES, QUEUE, TIME_LIMIT)\n", + "\n", + "config = {\n", + " \"owner\": {\"_id\": ACCOUNT_ID},\n", + " \"_material\": {\n", + " \"_id\": material_heterostructure_in_the_platform[\"_id\"]\n", + " },\n", + " \"_materials\": [\n", + " {\"_id\": material_heterostructure_in_the_platform[\"_id\"]},\n", + " {\"_id\": material_substrate_in_the_platform[\"_id\"]},\n", + " {\"_id\": material_film_in_the_platform[\"_id\"]},\n", + " ],\n", + " \"workflow\": {\"_id\": workflow_in_the_platform[\"_id\"]},\n", + " \"name\": f\"Valence Band - {material_heterostructure['name']}\",\n", + " \"compute\": compute,\n", + "}" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "b4354c90697ee8de" + }, + "id": "b4354c90697ee8de" + }, + { + "cell_type": "markdown", + "source": [ + "Then create a job" + ], + "metadata": { + "collapsed": false, + "id": "c907fce6c3a3f59e" + }, + "id": "c907fce6c3a3f59e" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "job = job_endpoints.create(config)" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "d6537b79de46978a" + }, + "id": "d6537b79de46978a" + }, + { + "cell_type": "markdown", + "source": [ + "then run it" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%% md\n" + }, + "id": "f4b7b12d8cd5019e" + }, + "id": "f4b7b12d8cd5019e" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "job_endpoints.submit(job[\"_id\"])" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "cc878e6674215ecc" + }, + "id": "cc878e6674215ecc" + }, + { + "cell_type": "markdown", + "source": [ + "and wait for it to finish" + ], + "metadata": { + "collapsed": false, + "id": "2ef0dfa179949972" + }, + "id": "2ef0dfa179949972" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "from utils.generic import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies\n", + "job_id = job[\"_id\"]\n", + "wait_for_jobs_to_finish(job_endpoints, [job_id])" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "436d477f7245ea02" + }, + "id": "436d477f7245ea02" + }, + { + "cell_type": "markdown", + "source": [ + "Then get job files:" + ], + "metadata": { + "collapsed": false, + "id": "2a2cc84332f6d98b" + }, + "id": "2a2cc84332f6d98b" + }, + { + "cell_type": "code", + "execution_count": null, + "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)\n", + "\n", + "for file in files:\n", + " if file[\"name\"] == \"pw_scf.out\":\n", + " output_file_metadata = file\n", + "\n", + "import urllib\n", + "\n", + "server_response = urllib.request.urlopen(output_file_metadata[\"signedUrl\"])\n", + "output_file = server_response.read().decode(encoding=\"UTF-8\")\n", + "\n", + "with open(output_file_metadata[\"name\"], \"w\") as file_descriptor:\n", + " file_descriptor.write(output_file)" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "3199c5b7ecf347ef" + }, + "id": "3199c5b7ecf347ef" + }, + { + "cell_type": "markdown", + "source": [ + "and get job properties using the index of a subworkflow in workflow and the index of unit in subworkflow (0, 0) below" + ], + "metadata": { + "collapsed": false, + "id": "d155c1096b7499f5" + }, + "id": "d155c1096b7499f5" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "pressure = get_property_by_subworkflow_and_unit_indicies(property_endpoints, \"pressure\", job, 0, 0)\n", + "print(pressure[\"data\"][\"value\"])" + ], + "metadata": { + "pycharm": { + "name": "#%%\n" + }, + "id": "651c91cebd378528" + }, + "id": "651c91cebd378528" + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + }, + "colab": { + "provenance": [] + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file