{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "No module named 'deepmd'\n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import os\n", "# from mp_api.client import MPRester\n", "from dask.distributed import Client\n", "from dask_jobqueue import SLURMCluster\n", "from prefect import task, flow\n", "from prefect.task_runners import ThreadPoolTaskRunner\n", "from prefect_dask import DaskTaskRunner\n", "from pymatgen.core.structure import Structure\n", "from dotenv import load_dotenv\n", "from ase import Atoms\n", "from ase.io import write, read\n", "from pathlib import Path\n", "import pandas as pd\n", "from prefect.futures import wait\n", "\n", "from mlip_arena.tasks.eos.run import fit as EOS\n", "from mlip_arena.models import MLIPEnum\n", "\n", "load_dotenv()\n", "\n", "# MP_API_KEY = os.environ.get(\"MP_API_KEY\", None)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "MP Database version: 2023.11.1\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "bb6c1969c89840888c556f8fa59b4a67", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Retrieving SummaryDoc documents: 0%| | 0/5135 [00:0018:53:47.335 | INFO | prefect.engine - Created flow run 'vengeful-malkoha' for flow 'fit-all'\n", "\n" ], "text/plain": [ "18:53:47.335 | \u001b[36mINFO\u001b[0m | prefect.engine - Created flow run\u001b[35m 'vengeful-malkoha'\u001b[0m for flow\u001b[1;35m 'fit-all'\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
18:53:47.341 | INFO    | prefect.engine - View at https://app.prefect.cloud/account/f7d40474-9362-4bfa-8950-ee6a43ec00f3/workspace/d4bb0913-5f5e-49f7-bfc5-06509088baeb/runs/flow-run/909d2bc4-695f-4eeb-8b7c-7660397a0692\n",
       "
\n" ], "text/plain": [ "18:53:47.341 | \u001b[36mINFO\u001b[0m | prefect.engine - View at \u001b[94mhttps://app.prefect.cloud/account/f7d40474-9362-4bfa-8950-ee6a43ec00f3/workspace/d4bb0913-5f5e-49f7-bfc5-06509088baeb/runs/flow-run/909d2bc4-695f-4eeb-8b7c-7660397a0692\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
18:53:47.654 | INFO    | prefect.task_runner.dask - Connecting to existing Dask cluster SLURMCluster(df8c3d55, 'tcp://128.55.64.49:36289', workers=0, threads=0, memory=0 B)\n",
       "
\n" ], "text/plain": [ "18:53:47.654 | \u001b[36mINFO\u001b[0m | prefect.task_runner.dask - Connecting to existing Dask cluster SLURMCluster(df8c3d55, 'tcp://128.55.64.49:36289', workers=0, threads=0, memory=0 B)\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fit_all(atoms_list)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```\n", "Note that, because the DaskTaskRunner uses multiprocessing, calls to flows in scripts must be guarded with if __name__ == \"__main__\": or you will encounter warnings and errors.\n", "```" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "tags": [] }, "outputs": [], "source": [ "# import os\n", "# import tempfile\n", "# import shutil\n", "# from contextlib import contextmanager\n", "\n", "# @contextmanager\n", "# def twd():\n", " \n", "# pwd = os.getcwd()\n", "# temp_dir = tempfile.mkdtemp()\n", " \n", "# try:\n", "# os.chdir(temp_dir)\n", "# yield\n", "# finally:\n", "# os.chdir(pwd)\n", "# shutil.rmtree(temp_dir)\n", "\n", "# with twd():\n", "\n", "# fit_all(atoms_list)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "tags": [] }, "outputs": [], "source": [ "import pandas as pd\n", "\n", "df = pd.read_parquet('mace-mp/MACE-MP(M).parquet')" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
formulamethodvolumesenergiesK
1Ac2O3MACE-MP(M)[82.36010147441682, 85.41047560309894, 88.4608...[-39.47541427612305, -39.65580749511719, -39.7...95.755459
2Ac6In2MACE-MP(M)[278.3036976131417, 288.61124196918433, 298.91...[-31.21324348449707, -31.40914535522461, -31.5...33.370214
3Ac6Tl2MACE-MP(M)[278.30267000598286, 288.6101763025008, 298.91...[-29.572534561157227, -29.833026885986328, -30...29.065081
4Ac3SnMACE-MP(M)[135.293532345587, 140.30440391394214, 145.315...[-17.135194778442383, -17.228239059448242, -17...30.622045
5AcAgMACE-MP(M)[55.376437498321394, 57.4274166649259, 59.4783...[-7.274301528930664, -7.346108913421631, -7.39...40.212164
6Ac4MACE-MP(M)[166.09086069175856, 172.2423740507126, 178.39...[-16.326059341430664, -16.406923294067383, -16...25.409891
7Ac16S24MACE-MP(M)[1006.5670668063424, 1043.84732853991, 1081.12...[-249.4179229736328, -250.7970733642578, -251....61.734158
\n", "
" ], "text/plain": [ " formula method volumes \\\n", "1 Ac2O3 MACE-MP(M) [82.36010147441682, 85.41047560309894, 88.4608... \n", "2 Ac6In2 MACE-MP(M) [278.3036976131417, 288.61124196918433, 298.91... \n", "3 Ac6Tl2 MACE-MP(M) [278.30267000598286, 288.6101763025008, 298.91... \n", "4 Ac3Sn MACE-MP(M) [135.293532345587, 140.30440391394214, 145.315... \n", "5 AcAg MACE-MP(M) [55.376437498321394, 57.4274166649259, 59.4783... \n", "6 Ac4 MACE-MP(M) [166.09086069175856, 172.2423740507126, 178.39... \n", "7 Ac16S24 MACE-MP(M) [1006.5670668063424, 1043.84732853991, 1081.12... \n", "\n", " energies K \n", "1 [-39.47541427612305, -39.65580749511719, -39.7... 95.755459 \n", "2 [-31.21324348449707, -31.40914535522461, -31.5... 33.370214 \n", "3 [-29.572534561157227, -29.833026885986328, -30... 29.065081 \n", "4 [-17.135194778442383, -17.228239059448242, -17... 30.622045 \n", "5 [-7.274301528930664, -7.346108913421631, -7.39... 40.212164 \n", "6 [-16.326059341430664, -16.406923294067383, -16... 25.409891 \n", "7 [-249.4179229736328, -250.7970733642578, -251.... 61.734158 " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "mlip-arena", "language": "python", "name": "mlip-arena" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.10" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }