diff --git a/README.md b/README.md index de998104..9e229eb6 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Below, we list the contents of this repository, in roughly the order that a user | [Examples/Workflow](examples/workflow/) | [Quantum Espresso Workflow and Job](examples/workflow/qe_scf_calculation.ipynb) | Create Quantum Espresso workflow starting from QE input file; create and submit job; after the job is finished, download output file, and finally perform postprocessing analysis. | [Examples/Material](examples/material/) | [Get Materials by Formula](examples/material/get_materials_by_formula.ipynb) | Shows how [queries](https://docs.mat3ra.com/rest-api/query-structure/) can be made to search for materials stored on your account by their formula. In this example, we search for a system containing Si. | [Examples/Material](examples/material/) | [Create Material](examples/material/create_material.ipynb) | Gives an overview of how materials can be generated in [JSON format](https://docs.mat3ra.com/materials/data/) and uploaded to your user account. In this example, we create an FCC Si crystal and upload it. -| [Examples/Material](examples/material/) | [Import Materials from Materials Project](examples/material/import_materials_from_materialsproject.ipynb) | Demonstrates how materials can be imported from [Materials Project](https://materialsproject.org/about), if their Materials Project ID is known. In this example, we import monoclinic and hexagonal SiGe cells. +| [Examples/Material](examples/material/) | [Import Materials from Materials Project](other/materialsproject/import_materials_from_materialsproject.ipynb) | Demonstrates how materials can be imported from [Materials Project](https://materialsproject.org/about), if their Materials Project ID is known. In this example, we import monoclinic and hexagonal SiGe cells. | [Examples/Material](examples/material/) | [Import Materials from Poscar](examples/material/upload_materials_from_file_poscar.ipynb) | Provides an example of how materials can be imported directly from Poscar files (a common chemical file format best-known [for its use in VASP](https://www.vasp.at/wiki/index.php/Input)). In this example, we import the unit cell of SiGe. | [Examples/Job](examples/job/) | [Create and Submit Job](examples/job/create_and_submit_job.ipynb) | Shows how to use the Mat3ra API to [create jobs](https://docs.mat3ra.com/jobs/data/) and run them on our cluster. In this example, we run a DFT calculation to get the total energy of an FCC Si unit cell using Quantum Espresso. | [Examples/Job](examples/job/) | [Get File from Job](examples/job/get-file-from-job.ipynb) | Uses the Mat3ra API to query for a list of files produced by a job, describes the metadata assigned to each file, and ends by demonstrating how to download any remote file generated by a job to the local disk. diff --git a/other/materials_designer/config.yml b/config.yml similarity index 96% rename from other/materials_designer/config.yml rename to config.yml index 2aebc396..50a51ee4 100644 --- a/other/materials_designer/config.yml +++ b/config.yml @@ -6,6 +6,7 @@ # The default packages are installed for all the notebooks. default: packages_common: + - pandas==1.5.3 - ase==3.22.1 packages_python: - pymatgen==2023.9.10 @@ -21,10 +22,10 @@ default: - tabulate==0.9.0 - sympy==1.12 - uncertainties==3.1.6 + - jinja2 notebooks: - name: create_interface_with_min_strain_zsl.ipynb packages_common: - - pandas==1.5.3 - ipywidgets - plotly==5.18 - nbformat>=4.2.0 @@ -32,7 +33,6 @@ notebooks: packages_pyodide: - name: import_material_from_jarvis_db_entry.ipynb packages_common: - - pandas==1.5.3 - express-py==2024.2.2.post2 - mat3ra-esse - jarvis-tools @@ -44,7 +44,6 @@ notebooks: - https://files.mat3ra.com:44318/uploads/watchdog-2.3.1-py3-none-any.whl - name: import_materials_from_files.ipynb packages_common: - - pandas==1.5.3 - express-py==2024.2.2.post2 - mat3ra-esse - munch diff --git a/examples/job/create_and_submit_job.ipynb b/examples/job/create_and_submit_job.ipynb index 7a9d8535..c23581f0 100644 --- a/examples/job/create_and_submit_job.ipynb +++ b/examples/job/create_and_submit_job.ipynb @@ -66,6 +66,7 @@ "ORGANIZATION_ID = \"ORGANIZATION_ID\" # @param {type:\"string\"}\n", "\n", "import os\n", + "import sys\n", "\n", "if \"COLAB_JUPYTER_IP\" in os.environ:\n", " os.environ.update(\n", @@ -77,7 +78,27 @@ " )\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" + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n", + "\n", + "if sys.platform == \"emscripten\":\n", + " apiConfig = data_from_host.get(\"apiConfig\")\n", + " os.environ.update(data_from_host.get(\"environ\", {}))\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=apiConfig.get(\"accountId\"),\n", + " AUTH_TOKEN=apiConfig.get(\"authToken\"),\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=apiConfig.get(\"organizationId\") or \"\",\n", + " )\n", + " )\n", + "\n", + " import micropip\n", + "\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"exabyte-api-client\")\n", + " from utils.jupyterlite import install_packages\n", + "\n", + " await install_packages(\"\", \"../../config.yml\")" ] }, { diff --git a/examples/job/get-file-from-job.ipynb b/examples/job/get-file-from-job.ipynb index c808e8ae..dcc5e80f 100644 --- a/examples/job/get-file-from-job.ipynb +++ b/examples/job/get-file-from-job.ipynb @@ -88,6 +88,7 @@ "ORGANIZATION_ID = \"ORGANIZATION_ID\" # @param {type:\"string\"}\n", "\n", "import os\n", + "import sys\n", "\n", "if \"COLAB_JUPYTER_IP\" in os.environ:\n", " os.environ.update(\n", @@ -99,7 +100,27 @@ " )\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" + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n", + "\n", + "if sys.platform == \"emscripten\":\n", + " apiConfig = data_from_host.get(\"apiConfig\")\n", + " os.environ.update(data_from_host.get(\"environ\", {}))\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=apiConfig.get(\"accountId\"),\n", + " AUTH_TOKEN=apiConfig.get(\"authToken\"),\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=apiConfig.get(\"organizationId\") or \"\",\n", + " )\n", + " )\n", + "\n", + " import micropip\n", + "\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"exabyte-api-client\")\n", + " from utils.jupyterlite import install_packages\n", + "\n", + " await install_packages(\"\", \"../../config.yml\")" ] }, { diff --git a/examples/job/ml-train-model-predict-properties.ipynb b/examples/job/ml-train-model-predict-properties.ipynb index 720123c3..022ec1ee 100644 --- a/examples/job/ml-train-model-predict-properties.ipynb +++ b/examples/job/ml-train-model-predict-properties.ipynb @@ -88,6 +88,7 @@ "ORGANIZATION_ID = \"ORGANIZATION_ID\" # @param {type:\"string\"}\n", "\n", "import os\n", + "import sys\n", "\n", "if \"COLAB_JUPYTER_IP\" in os.environ:\n", " os.environ.update(\n", @@ -99,7 +100,27 @@ " )\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" + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n", + "\n", + "if sys.platform == \"emscripten\":\n", + " apiConfig = data_from_host.get(\"apiConfig\")\n", + " os.environ.update(data_from_host.get(\"environ\", {}))\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=apiConfig.get(\"accountId\"),\n", + " AUTH_TOKEN=apiConfig.get(\"authToken\"),\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=apiConfig.get(\"organizationId\") or \"\",\n", + " )\n", + " )\n", + "\n", + " import micropip\n", + "\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"exabyte-api-client\")\n", + " from utils.jupyterlite import install_packages\n", + "\n", + " await install_packages(\"\", \"../../config.yml\")" ] }, { diff --git a/examples/job/run-simulations-and-extract-properties.ipynb b/examples/job/run-simulations-and-extract-properties.ipynb index 7d14ddae..d162191c 100644 --- a/examples/job/run-simulations-and-extract-properties.ipynb +++ b/examples/job/run-simulations-and-extract-properties.ipynb @@ -95,6 +95,7 @@ "ORGANIZATION_ID = \"ORGANIZATION_ID\" # @param {type:\"string\"}\n", "\n", "import os\n", + "import sys\n", "\n", "if \"COLAB_JUPYTER_IP\" in os.environ:\n", " os.environ.update(\n", @@ -106,7 +107,27 @@ " )\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" + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n", + "\n", + "if sys.platform == \"emscripten\":\n", + " apiConfig = data_from_host.get(\"apiConfig\")\n", + " os.environ.update(data_from_host.get(\"environ\", {}))\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=apiConfig.get(\"accountId\"),\n", + " AUTH_TOKEN=apiConfig.get(\"authToken\"),\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=apiConfig.get(\"organizationId\") or \"\",\n", + " )\n", + " )\n", + "\n", + " import micropip\n", + "\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"exabyte-api-client\")\n", + " from utils.jupyterlite import install_packages\n", + "\n", + " await install_packages(\"\", \"../../config.yml\")" ] }, { diff --git a/examples/material/create_material.ipynb b/examples/material/create_material.ipynb index a7c2a9e2..bae57ad7 100644 --- a/examples/material/create_material.ipynb +++ b/examples/material/create_material.ipynb @@ -61,6 +61,7 @@ "ORGANIZATION_ID = \"ORGANIZATION_ID\" # @param {type:\"string\"}\n", "\n", "import os\n", + "import sys\n", "\n", "if \"COLAB_JUPYTER_IP\" in os.environ:\n", " os.environ.update(\n", @@ -72,7 +73,27 @@ " )\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" + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n", + "\n", + "if sys.platform == \"emscripten\":\n", + " apiConfig = data_from_host.get(\"apiConfig\")\n", + " os.environ.update(data_from_host.get(\"environ\", {}))\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=apiConfig.get(\"accountId\"),\n", + " AUTH_TOKEN=apiConfig.get(\"authToken\"),\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=apiConfig.get(\"organizationId\") or \"\",\n", + " )\n", + " )\n", + "\n", + " import micropip\n", + "\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"exabyte-api-client\")\n", + " from utils.jupyterlite import install_packages\n", + "\n", + " await install_packages(\"\", \"../../config.yml\")" ] }, { diff --git a/examples/material/get_materials_by_formula.ipynb b/examples/material/get_materials_by_formula.ipynb index b2a80275..2125b821 100644 --- a/examples/material/get_materials_by_formula.ipynb +++ b/examples/material/get_materials_by_formula.ipynb @@ -62,6 +62,7 @@ "ORGANIZATION_ID = \"ORGANIZATION_ID\" # @param {type:\"string\"}\n", "\n", "import os\n", + "import sys\n", "\n", "if \"COLAB_JUPYTER_IP\" in os.environ:\n", " os.environ.update(\n", @@ -73,7 +74,27 @@ " )\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" + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n", + "\n", + "if sys.platform == \"emscripten\":\n", + " apiConfig = data_from_host.get(\"apiConfig\")\n", + " os.environ.update(data_from_host.get(\"environ\", {}))\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=apiConfig.get(\"accountId\"),\n", + " AUTH_TOKEN=apiConfig.get(\"authToken\"),\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=apiConfig.get(\"organizationId\") or \"\",\n", + " )\n", + " )\n", + "\n", + " import micropip\n", + "\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"exabyte-api-client\")\n", + " from utils.jupyterlite import install_packages\n", + "\n", + " await install_packages(\"\", \"../../config.yml\")" ] }, { diff --git a/examples/material/upload_materials_from_file_poscar.ipynb b/examples/material/upload_materials_from_file_poscar.ipynb index b4c1bdb8..563dcf3f 100644 --- a/examples/material/upload_materials_from_file_poscar.ipynb +++ b/examples/material/upload_materials_from_file_poscar.ipynb @@ -62,6 +62,7 @@ "ORGANIZATION_ID = \"ORGANIZATION_ID\" # @param {type:\"string\"}\n", "\n", "import os\n", + "import sys\n", "\n", "if \"COLAB_JUPYTER_IP\" in os.environ:\n", " os.environ.update(\n", @@ -76,7 +77,27 @@ " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; export IS_USING_GIT_LFS=true; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n", " from examples.utils.notebook import get_notebook_info\n", "\n", - " os.chdir(os.path.join(\"api-examples\", os.path.dirname(get_notebook_info()[\"notebook_path\"])))" + " os.chdir(os.path.join(\"api-examples\", os.path.dirname(get_notebook_info()[\"notebook_path\"])))\n", + "\n", + "if sys.platform == \"emscripten\":\n", + " apiConfig = data_from_host.get(\"apiConfig\")\n", + " os.environ.update(data_from_host.get(\"environ\", {}))\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=apiConfig.get(\"accountId\"),\n", + " AUTH_TOKEN=apiConfig.get(\"authToken\"),\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=apiConfig.get(\"organizationId\") or \"\",\n", + " )\n", + " )\n", + "\n", + " import micropip\n", + "\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"exabyte-api-client\")\n", + " from utils.jupyterlite import install_packages\n", + "\n", + " await install_packages(\"\", \"../../config.yml\")" ] }, { diff --git a/examples/system/get_authentication_params.ipynb b/examples/system/get_authentication_params.ipynb index e8b49cff..ca6a7ba0 100644 --- a/examples/system/get_authentication_params.ipynb +++ b/examples/system/get_authentication_params.ipynb @@ -59,9 +59,29 @@ "PASSWORD = getpass(\"Please enter password: \")\n", "\n", "import os\n", + "import sys\n", "\n", "if \"COLAB_JUPYTER_IP\" in os.environ:\n", - " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash" + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n", + "\n", + "if sys.platform == \"emscripten\":\n", + " apiConfig = data_from_host.get(\"apiConfig\")\n", + " os.environ.update(data_from_host.get(\"environ\", {}))\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=apiConfig.get(\"accountId\"),\n", + " AUTH_TOKEN=apiConfig.get(\"authToken\"),\n", + " ORGANIZATION_ID=apiConfig.get(\"organizationId\") or \"\",\n", + " )\n", + " )\n", + "\n", + " import micropip\n", + "\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"exabyte-api-client\")\n", + " from utils.jupyterlite import install_packages\n", + "\n", + " await install_packages(\"\", \"../../config.yml\")" ] }, { diff --git a/examples/workflow/get_workflows.ipynb b/examples/workflow/get_workflows.ipynb index 637150bb..b52e41b8 100644 --- a/examples/workflow/get_workflows.ipynb +++ b/examples/workflow/get_workflows.ipynb @@ -66,6 +66,7 @@ "ORGANIZATION_ID = \"ORGANIZATION_ID\" # @param {type:\"string\"}\n", "\n", "import os\n", + "import sys\n", "\n", "if \"COLAB_JUPYTER_IP\" in os.environ:\n", " os.environ.update(\n", @@ -77,7 +78,27 @@ " )\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" + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n", + "\n", + "if sys.platform == \"emscripten\":\n", + " apiConfig = data_from_host.get(\"apiConfig\")\n", + " os.environ.update(data_from_host.get(\"environ\", {}))\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=apiConfig.get(\"accountId\"),\n", + " AUTH_TOKEN=apiConfig.get(\"authToken\"),\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=apiConfig.get(\"organizationId\") or \"\",\n", + " )\n", + " )\n", + "\n", + " import micropip\n", + "\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"exabyte-api-client\")\n", + " from utils.jupyterlite import install_packages\n", + "\n", + " await install_packages(\"\", \"../../config.yml\")" ] }, { diff --git a/examples/workflow/qe_scf_calculation.ipynb b/examples/workflow/qe_scf_calculation.ipynb index d6edd70b..c4966141 100644 --- a/examples/workflow/qe_scf_calculation.ipynb +++ b/examples/workflow/qe_scf_calculation.ipynb @@ -61,6 +61,7 @@ "ORGANIZATION_ID = \"ORGANIZATION_ID\" # @param {type:\"string\"}\n", "\n", "import os\n", + "import sys\n", "\n", "if \"COLAB_JUPYTER_IP\" in os.environ:\n", " os.environ.update(\n", @@ -72,7 +73,27 @@ " )\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" + " !GIT_BRANCH=\"dev\"; export GIT_BRANCH; curl -s \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash\n", + "\n", + "if sys.platform == \"emscripten\":\n", + " apiConfig = data_from_host.get(\"apiConfig\")\n", + " os.environ.update(data_from_host.get(\"environ\", {}))\n", + " os.environ.update(\n", + " dict(\n", + " ACCOUNT_ID=apiConfig.get(\"accountId\"),\n", + " AUTH_TOKEN=apiConfig.get(\"authToken\"),\n", + " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", + " ORGANIZATION_ID=apiConfig.get(\"organizationId\") or \"\",\n", + " )\n", + " )\n", + "\n", + " import micropip\n", + "\n", + " await micropip.install(\"mat3ra-api-examples\", deps=False)\n", + " await micropip.install(\"exabyte-api-client\")\n", + " from utils.jupyterlite import install_packages\n", + "\n", + " await install_packages(\"\", \"../../config.yml\")" ] }, { diff --git a/other/__init__.py b/other/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/other/materials_designer/__init__.py b/other/materials_designer/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/other/materials_designer/create_interface_with_min_strain_zsl.ipynb b/other/materials_designer/create_interface_with_min_strain_zsl.ipynb index c02b225b..f79109e0 100644 --- a/other/materials_designer/create_interface_with_min_strain_zsl.ipynb +++ b/other/materials_designer/create_interface_with_min_strain_zsl.ipynb @@ -116,9 +116,12 @@ "metadata": {}, "outputs": [], "source": [ - "from jupyterlite.utils import install_packages\n", - "\n", - "await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")" + "import sys\n", + "if sys.platform == \"emscripten\":\n", + " import micropip\n", + " await micropip.install('mat3ra-api-examples', deps=False)\n", + "from utils.jupyterlite import install_packages\n", + "await install_packages(\"create_interface_with_min_strain_zsl.ipynb\",\"../../config.yml\")" ] }, { @@ -132,7 +135,7 @@ "cell_type": "code", "outputs": [], "source": [ - "from jupyterlite.utils import get_data\n", + "from utils.jupyterlite import get_data\n", "from pymatgen.analysis.structure_analyzer import SpacegroupAnalyzer\n", "from src.utils import to_pymatgen\n", "\n", @@ -431,7 +434,7 @@ "outputs": [], "source": [ "from src.utils import from_pymatgen\n", - "from jupyterlite.utils import set_data\n", + "from utils.jupyterlite import set_data\n", "\n", "materials = list(map(lambda interface_config: from_pymatgen(interface_config[\"interface\"]), selected_interfaces))\n", "\n", diff --git a/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb b/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb index 8f8f5474..ab11390a 100644 --- a/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb +++ b/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb @@ -122,9 +122,12 @@ "metadata": {}, "outputs": [], "source": [ - "from jupyterlite.utils import install_packages\n", - "\n", - "await install_packages(\"create_interface_with_min_strain_zsl.ipynb\")" + "import sys\n", + "if sys.platform == \"emscripten\":\n", + " import micropip\n", + " await micropip.install('mat3ra-api-examples', deps=False)\n", + "from utils.jupyterlite import install_packages\n", + "await install_packages(\"create_interface_with_min_strain_zsl.ipynb\",\"../../config.yml\")" ] }, { @@ -140,7 +143,7 @@ "cell_type": "code", "outputs": [], "source": [ - "from jupyterlite.utils import get_data\n", + "from utils.jupyterlite import get_data\n", "from pymatgen.analysis.structure_analyzer import SpacegroupAnalyzer\n", "from src.utils import to_pymatgen\n", "\n", @@ -689,7 +692,7 @@ "metadata": {}, "outputs": [], "source": [ - "from jupyterlite.utils import set_data\n", + "from utils.jupyterlite import set_data\n", "from src.utils import from_pymatgen\n", "\n", "esse_final_interface = from_pymatgen(ase_to_pymatgen(ase_final_interface))\n", diff --git a/other/materials_designer/import_material_from_jarvis_db_entry.ipynb b/other/materials_designer/import_material_from_jarvis_db_entry.ipynb index 52c72dae..4fca8f10 100644 --- a/other/materials_designer/import_material_from_jarvis_db_entry.ipynb +++ b/other/materials_designer/import_material_from_jarvis_db_entry.ipynb @@ -1,283 +1,280 @@ { - "cells": [ - { - "cell_type": "markdown", - "id": "826fcc4c", - "metadata": {}, - "source": [ - "# Import 2D material from JARVIS database\n", - "\n", - "Import a structure from the NIST JARVIS database by its ID. Use data at JARVIS-DFT to find the ID of the structure you are interested in.\n", - "\n", - "