From e6f41677a628685d6e6aa1fb2986f782938bfb8b Mon Sep 17 00:00:00 2001 From: Fabian Zills <46721498+PythonFZ@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:56:31 +0100 Subject: [PATCH] fix make file, add README, add CI check (#25) * add contrib info * run pre-commit hooks * remove make.bat * update structure relax * update notebook * glob and update notebook --- .github/workflows/pre-comit.yaml | 14 + docs/Makefile | 6 +- docs/make.bat | 35 - docs/source/build_graph.rst | 3 +- docs/source/notebooks/combine.ipynb | 195 ++++++ .../notebooks/structure_relaxation.ipynb | 615 +----------------- mlipx/recipes/README.md | 6 + 7 files changed, 237 insertions(+), 637 deletions(-) create mode 100644 .github/workflows/pre-comit.yaml delete mode 100644 docs/make.bat create mode 100644 docs/source/notebooks/combine.ipynb create mode 100644 mlipx/recipes/README.md diff --git a/.github/workflows/pre-comit.yaml b/.github/workflows/pre-comit.yaml new file mode 100644 index 0000000..2b11178 --- /dev/null +++ b/.github/workflows/pre-comit.yaml @@ -0,0 +1,14 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1 diff --git a/docs/Makefile b/docs/Makefile index d0c3cbf..fb91e93 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -6,15 +6,15 @@ SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build SOURCEDIR = source -BUILDDIR = build +BUILDDIR = ../build # Put it first so that "make" without argument is like "make help". help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @cd "$(SOURCEDIR)" && $(SPHINXBUILD) -M help "." "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @cd "$(SOURCEDIR)" && $(SPHINXBUILD) -M $@ "." "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index dc1312a..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/source/build_graph.rst b/docs/source/build_graph.rst index 970b374..a1ba52f 100644 --- a/docs/source/build_graph.rst +++ b/docs/source/build_graph.rst @@ -8,5 +8,6 @@ You will learn how to include :term:`MLIP` that can not be interfaced with the : With your own custom Nodes you can build more comprehensive test cases or go even beyond :term:`MLIP` testing and build workflows for other scenarios, such as :term:`MLIP` training with :code:`mlipx` and :term:`IPSuite`. .. toctree:: + :glob: - notebooks/structure_relaxation.ipynb + notebooks/* diff --git a/docs/source/notebooks/combine.ipynb b/docs/source/notebooks/combine.ipynb new file mode 100644 index 0000000..39101b8 --- /dev/null +++ b/docs/source/notebooks/combine.ipynb @@ -0,0 +1,195 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/basf/mlipx/blob/main/docs/source/notebooks/combine.ipynb)\n", + "\n", + "# Combine Multiple Nodes\n", + "\n", + "The `mlipx` command line interface provides you with recipes for specific tasks.\n", + "In this notebook, we will write a script to include different aspects from different recipes into a single workflow." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Only install the packages if they are not already installed\n", + "!pip show mlipx > /dev/null 2>&1 || pip install mlipx\n", + "!pip show rdkit2ase > /dev/null 2>&1 || pip install rdkit2ase" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# We will create a GIT and DVC repository in a temporary directory\n", + "import os\n", + "import tempfile\n", + "\n", + "temp_dir = tempfile.TemporaryDirectory()\n", + "os.chdir(temp_dir.name)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Like all `mlipx` Nodes we will use a GIT and DVC repository to run experiments.\n", + "To make our custom code available, we structure our project like\n", + "\n", + "```\n", + "relaxation/\n", + " ├── .git/\n", + " ├── .dvc/\n", + " ├── src/__init__.py\n", + " ├── src/relaxation.py\n", + " ├── models.py\n", + " └── main.py\n", + "```\n", + "\n", + "to allow us to import our code `from src.relaxation import Relax`.\n", + "Alternatively, you can package your code and import it like any other Python package." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!git init\n", + "!dvc init --quiet" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let us configure now configure a workflow, creating a structure from `SMILES`, relax it, run molecular dynamics and compute the homonuclear diatomics." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import mlipx\n", + "\n", + "project = mlipx.Project()\n", + "\n", + "emt = mlipx.GenericASECalculator(\n", + " module=\"ase.calculators.emt\",\n", + " class_name=\"EMT\",\n", + ")\n", + "\n", + "with project.group(\"initialize\"):\n", + " confs = mlipx.Smiles2Conformers(smiles=\"CCCC\", num_confs=1)\n", + "\n", + "with project.group(\"structure-optimization\"):\n", + " struct_optim = mlipx.StructureOptimization(\n", + " data=confs.frames, data_id=-1, optimizer=\"LBFGS\", model=emt\n", + " )\n", + "\n", + "thermostat = mlipx.LangevinConfig(\n", + " timestep=0.5,\n", + " temperature=300,\n", + " friction=0.001,\n", + ")\n", + "\n", + "with project.group(\"molecular-dynamics\"):\n", + " md = mlipx.MolecularDynamics(\n", + " data=struct_optim.frames,\n", + " data_id=-1,\n", + " model=emt,\n", + " thermostat=thermostat,\n", + " steps=1000,\n", + " )\n", + "\n", + "with project.group(\"homonuclear-diatomics\"):\n", + " ev = mlipx.HomonuclearDiatomics(\n", + " data=confs.frames,\n", + " model=emt,\n", + " n_points=100,\n", + " min_distance=0.75,\n", + " max_distance=2.0,\n", + " elements=[],\n", + " )\n", + "\n", + "project.repro()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Once the graph has been executed, we can look at the resulting structures." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "struct_optim.figures[\"energy_vs_steps\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "md.figures[\"energy\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(ev.figures.keys())\n", + "ev.figures[\"C-C bond\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "temp_dir.cleanup()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "mlipx", + "language": "python", + "name": "python3" + }, + "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" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/source/notebooks/structure_relaxation.ipynb b/docs/source/notebooks/structure_relaxation.ipynb index d3899dc..0ec02e7 100644 --- a/docs/source/notebooks/structure_relaxation.ipynb +++ b/docs/source/notebooks/structure_relaxation.ipynb @@ -12,6 +12,17 @@ "We will write a Node to perform a geometry relaxation similar to `mlipx.StructureOptimization`." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Only install the packages if they are not already installed\n", + "!pip show mlipx > /dev/null 2>&1 || pip install mlipx\n", + "!pip show rdkit2ase > /dev/null 2>&1 || pip install rdkit2ase" + ] + }, { "cell_type": "code", "execution_count": null, @@ -51,22 +62,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Initialized empty Git repository in /tmp/tmpd5ehmvex/.git/\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m" - ] - } - ], + "outputs": [], "source": [ "!git init\n", "!dvc init --quiet\n", @@ -119,15 +115,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing src/relaxation.py\n" - ] - } - ], + "outputs": [], "source": [ "%%writefile src/relaxation.py\n", "import zntrack\n", @@ -172,7 +160,6 @@ "metadata": {}, "outputs": [], "source": [ - "import zntrack\n", "from src.relaxation import Relax\n", "\n", "import mlipx" @@ -182,24 +169,9 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2024-10-28 13:38:39,442 - INFO: Saving params.yaml\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "100%|██████████| 2/2 [00:00<00:00, 467.44it/s]\n" - ] - } - ], + "outputs": [], "source": [ - "project = zntrack.Project()\n", + "project = mlipx.Project()\n", "\n", "emt = mlipx.GenericASECalculator(\n", " module=\"ase.calculators.emt\",\n", @@ -224,538 +196,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Running stage 'Smiles2Conformers':\n", - "> zntrack run mlipx.nodes.smiles.Smiles2Conformers --name Smiles2Conformers\n", - "Generating lock file 'dvc.lock'\n", - "Updating lock file 'dvc.lock'\n", - "\n", - "Running stage 'Relax':\n", - "> zntrack run src.relaxation.Relax --name Relax\n", - " Step Time Energy fmax\n", - "BFGS: 0 13:38:43 4.725117 4.227687\n", - "BFGS: 1 13:38:43 3.694942 2.695542\n", - "BFGS: 2 13:38:43 3.002297 1.492195\n", - "BFGS: 3 13:38:43 2.821368 1.084164\n", - "BFGS: 4 13:38:43 2.664348 1.026548\n", - "BFGS: 5 13:38:43 2.491416 0.799464\n", - "BFGS: 6 13:38:43 2.425102 0.284223\n", - "BFGS: 7 13:38:43 2.421374 0.196049\n", - "BFGS: 8 13:38:43 2.419329 0.177517\n", - "BFGS: 9 13:38:43 2.415170 0.194933\n", - "BFGS: 10 13:38:43 2.410946 0.242349\n", - "BFGS: 11 13:38:43 2.406163 0.232391\n", - "BFGS: 12 13:38:43 2.403577 0.115007\n", - "BFGS: 13 13:38:43 2.402778 0.057253\n", - "BFGS: 14 13:38:43 2.402583 0.065016\n", - "BFGS: 15 13:38:43 2.401260 0.147949\n", - "BFGS: 16 13:38:43 2.398498 0.279139\n", - "BFGS: 17 13:38:43 2.378735 0.737580\n", - "BFGS: 18 13:38:43 2.380205 0.877512\n", - "BFGS: 19 13:38:43 2.348892 0.503973\n", - "BFGS: 20 13:38:43 2.323320 0.520981\n", - "BFGS: 21 13:38:43 2.313069 0.402042\n", - "BFGS: 22 13:38:43 2.294836 0.230962\n", - "BFGS: 23 13:38:43 2.291210 0.227835\n", - "BFGS: 24 13:38:43 2.284115 0.213283\n", - "BFGS: 25 13:38:43 2.280263 0.218707\n", - "BFGS: 26 13:38:43 2.274327 0.261648\n", - "BFGS: 27 13:38:43 2.268316 0.361847\n", - "BFGS: 28 13:38:43 2.261435 0.315858\n", - "BFGS: 29 13:38:43 2.253036 0.300994\n", - "BFGS: 30 13:38:43 2.245306 0.321630\n", - "BFGS: 31 13:38:43 2.237248 0.358873\n", - "BFGS: 32 13:38:43 2.232141 0.223020\n", - "BFGS: 33 13:38:43 2.229193 0.183689\n", - "BFGS: 34 13:38:43 2.227868 0.157261\n", - "BFGS: 35 13:38:43 2.225771 0.192717\n", - "BFGS: 36 13:38:43 2.223700 0.199884\n", - "BFGS: 37 13:38:43 2.218819 0.266859\n", - "BFGS: 38 13:38:43 2.210714 0.326772\n", - "BFGS: 39 13:38:43 2.199444 0.333409\n", - "BFGS: 40 13:38:43 2.186320 0.280863\n", - "BFGS: 41 13:38:43 2.172070 0.342304\n", - "BFGS: 42 13:38:43 2.168701 0.562109\n", - "BFGS: 43 13:38:43 2.155074 0.347180\n", - "BFGS: 44 13:38:43 2.146478 0.245006\n", - "BFGS: 45 13:38:43 2.133870 0.288382\n", - "BFGS: 46 13:38:43 2.117095 0.357367\n", - "BFGS: 47 13:38:43 2.101575 0.431372\n", - "BFGS: 48 13:38:43 2.122170 0.886201\n", - "BFGS: 49 13:38:43 2.129481 1.058271\n", - "BFGS: 50 13:38:43 2.073756 0.526688\n", - "BFGS: 51 13:38:43 2.051344 0.268197\n", - "BFGS: 52 13:38:43 2.036213 0.471074\n", - "BFGS: 53 13:38:43 2.019547 0.466804\n", - "BFGS: 54 13:38:43 2.004126 0.536906\n", - "BFGS: 55 13:38:43 1.987509 0.560456\n", - "BFGS: 56 13:38:43 1.956487 0.418393\n", - "BFGS: 57 13:38:43 1.943242 0.650321\n", - "BFGS: 58 13:38:43 1.919339 0.585651\n", - "BFGS: 59 13:38:43 1.905361 0.235665\n", - "BFGS: 60 13:38:43 1.896997 0.271426\n", - "BFGS: 61 13:38:43 1.885432 0.248190\n", - "BFGS: 62 13:38:43 1.866871 0.382276\n", - "BFGS: 63 13:38:43 1.856055 0.400087\n", - "BFGS: 64 13:38:43 1.832461 0.391844\n", - "BFGS: 65 13:38:43 1.815816 0.366825\n", - "BFGS: 66 13:38:43 1.802358 0.327608\n", - "BFGS: 67 13:38:43 1.791704 0.242829\n", - "BFGS: 68 13:38:43 1.783335 0.209467\n", - "BFGS: 69 13:38:43 1.774918 0.148135\n", - "BFGS: 70 13:38:43 1.772515 0.215079\n", - "BFGS: 71 13:38:43 1.769623 0.164073\n", - "BFGS: 72 13:38:43 1.764062 0.215598\n", - "BFGS: 73 13:38:43 1.759529 0.290727\n", - "BFGS: 74 13:38:43 1.752074 0.303563\n", - "BFGS: 75 13:38:43 1.746294 0.200410\n", - "BFGS: 76 13:38:43 1.742540 0.093905\n", - "BFGS: 77 13:38:43 1.741257 0.112988\n", - "BFGS: 78 13:38:43 1.738577 0.136323\n", - "BFGS: 79 13:38:43 1.736298 0.119328\n", - "BFGS: 80 13:38:43 1.734030 0.100904\n", - "BFGS: 81 13:38:43 1.732070 0.137126\n", - "BFGS: 82 13:38:43 1.729569 0.160198\n", - "BFGS: 83 13:38:43 1.726852 0.140680\n", - "BFGS: 84 13:38:43 1.724789 0.086710\n", - "BFGS: 85 13:38:43 1.723742 0.061117\n", - "BFGS: 86 13:38:43 1.723251 0.052437\n", - "BFGS: 87 13:38:43 1.722732 0.066371\n", - "BFGS: 88 13:38:43 1.721778 0.092714\n", - "BFGS: 89 13:38:43 1.720078 0.126901\n", - "BFGS: 90 13:38:43 1.717481 0.150226\n", - "BFGS: 91 13:38:43 1.714608 0.109191\n", - "BFGS: 92 13:38:43 1.712612 0.124408\n", - "BFGS: 93 13:38:43 1.711350 0.103008\n", - "BFGS: 94 13:38:43 1.710429 0.101003\n", - "BFGS: 95 13:38:43 1.708828 0.122014\n", - "BFGS: 96 13:38:43 1.706636 0.133457\n", - "BFGS: 97 13:38:43 1.703891 0.132581\n", - "BFGS: 98 13:38:43 1.701509 0.114276\n", - "BFGS: 99 13:38:43 1.699488 0.129073\n", - "BFGS: 100 13:38:43 1.697334 0.161162\n", - "BFGS: 101 13:38:43 1.695463 0.158220\n", - "BFGS: 102 13:38:43 1.693282 0.217868\n", - "BFGS: 103 13:38:43 1.691509 0.268464\n", - "BFGS: 104 13:38:43 1.686521 0.189007\n", - "BFGS: 105 13:38:43 1.680133 0.166614\n", - "BFGS: 106 13:38:43 1.673217 0.194815\n", - "BFGS: 107 13:38:43 1.666183 0.254211\n", - "BFGS: 108 13:38:43 1.659230 0.292576\n", - "BFGS: 109 13:38:43 1.654636 0.158884\n", - "BFGS: 110 13:38:43 1.651747 0.156786\n", - "BFGS: 111 13:38:43 1.650783 0.129378\n", - "BFGS: 112 13:38:43 1.650146 0.122956\n", - "BFGS: 113 13:38:43 1.648736 0.101245\n", - "BFGS: 114 13:38:43 1.647928 0.107069\n", - "BFGS: 115 13:38:43 1.647001 0.126242\n", - "BFGS: 116 13:38:43 1.646007 0.144261\n", - "BFGS: 117 13:38:43 1.643958 0.165426\n", - "BFGS: 118 13:38:43 1.641321 0.164851\n", - "BFGS: 119 13:38:43 1.637879 0.156255\n", - "BFGS: 120 13:38:43 1.633374 0.194803\n", - "BFGS: 121 13:38:43 1.629418 0.213135\n", - "BFGS: 122 13:38:43 1.627339 0.160681\n", - "BFGS: 123 13:38:43 1.624665 0.191569\n", - "BFGS: 124 13:38:43 1.622380 0.156281\n", - "BFGS: 125 13:38:43 1.619502 0.150505\n", - "BFGS: 126 13:38:43 1.617384 0.169761\n", - "BFGS: 127 13:38:43 1.615905 0.196103\n", - "BFGS: 128 13:38:43 1.614038 0.179407\n", - "BFGS: 129 13:38:43 1.606964 0.172890\n", - "BFGS: 130 13:38:43 1.601598 0.219353\n", - "BFGS: 131 13:38:43 1.593777 0.192466\n", - "BFGS: 132 13:38:43 1.586870 0.175876\n", - "BFGS: 133 13:38:43 1.583041 0.128828\n", - "BFGS: 134 13:38:43 1.580630 0.161564\n", - "BFGS: 135 13:38:43 1.578271 0.132883\n", - "BFGS: 136 13:38:43 1.576168 0.139059\n", - "BFGS: 137 13:38:43 1.573610 0.117773\n", - "BFGS: 138 13:38:43 1.571279 0.115214\n", - "BFGS: 139 13:38:43 1.569795 0.103417\n", - "BFGS: 140 13:38:43 1.569402 0.136525\n", - "BFGS: 141 13:38:43 1.568380 0.114184\n", - "BFGS: 142 13:38:43 1.567596 0.095197\n", - "BFGS: 143 13:38:43 1.566177 0.079528\n", - "BFGS: 144 13:38:43 1.564860 0.082447\n", - "BFGS: 145 13:38:43 1.562999 0.086525\n", - "BFGS: 146 13:38:43 1.560769 0.084997\n", - "BFGS: 147 13:38:43 1.558323 0.091181\n", - "BFGS: 148 13:38:43 1.556924 0.101024\n", - "BFGS: 149 13:38:43 1.556291 0.087018\n", - "BFGS: 150 13:38:43 1.556029 0.073652\n", - "BFGS: 151 13:38:43 1.555761 0.056067\n", - "BFGS: 152 13:38:43 1.555338 0.052817\n", - "BFGS: 153 13:38:43 1.554571 0.063894\n", - "BFGS: 154 13:38:43 1.553366 0.073414\n", - "BFGS: 155 13:38:43 1.551914 0.079677\n", - "BFGS: 156 13:38:43 1.550709 0.061870\n", - "BFGS: 157 13:38:43 1.550133 0.059681\n", - "BFGS: 158 13:38:43 1.549973 0.056713\n", - "BFGS: 159 13:38:43 1.549878 0.053717\n", - "BFGS: 160 13:38:43 1.549759 0.049286\n", - " Step Time Energy fmax\n", - "BFGS: 0 13:38:43 4.863829 4.377487\n", - "BFGS: 1 13:38:43 3.745519 2.825854\n", - "BFGS: 2 13:38:43 2.962344 1.682816\n", - "BFGS: 3 13:38:43 2.775076 1.151560\n", - "BFGS: 4 13:38:43 2.626445 1.038554\n", - "BFGS: 5 13:38:43 2.448829 0.864834\n", - "BFGS: 6 13:38:43 2.397042 0.302056\n", - "BFGS: 7 13:38:43 2.393553 0.210197\n", - "BFGS: 8 13:38:43 2.390659 0.163556\n", - "BFGS: 9 13:38:43 2.388722 0.192981\n", - "BFGS: 10 13:38:43 2.383387 0.246296\n", - "BFGS: 11 13:38:43 2.379477 0.213246\n", - "BFGS: 12 13:38:43 2.376634 0.108819\n", - "BFGS: 13 13:38:43 2.375599 0.073717\n", - "BFGS: 14 13:38:43 2.374975 0.077739\n", - "BFGS: 15 13:38:43 2.371975 0.179202\n", - "BFGS: 16 13:38:43 2.365853 0.345928\n", - "BFGS: 17 13:38:43 2.347659 0.773122\n", - "BFGS: 18 13:38:43 2.329142 1.234781\n", - "BFGS: 19 13:38:43 2.291967 1.046209\n", - "BFGS: 20 13:38:43 2.262404 0.958612\n", - "BFGS: 21 13:38:43 2.415011 2.574935\n", - "BFGS: 22 13:38:43 2.215776 0.359339\n", - "BFGS: 23 13:38:43 2.193000 0.192849\n", - "BFGS: 24 13:38:43 2.186816 0.352728\n", - "BFGS: 25 13:38:43 2.180997 0.218550\n", - "BFGS: 26 13:38:43 2.174931 0.180307\n", - "BFGS: 27 13:38:43 2.150410 0.274855\n", - "BFGS: 28 13:38:43 2.138356 0.419796\n", - "BFGS: 29 13:38:43 2.129634 0.367211\n", - "BFGS: 30 13:38:43 2.111174 0.263046\n", - "BFGS: 31 13:38:43 2.103506 0.226076\n", - "BFGS: 32 13:38:43 2.097173 0.215126\n", - "BFGS: 33 13:38:43 2.092460 0.244072\n", - "BFGS: 34 13:38:43 2.087039 0.202181\n", - "BFGS: 35 13:38:43 2.075928 0.324669\n", - "BFGS: 36 13:38:43 2.067221 0.269609\n", - "BFGS: 37 13:38:43 2.051252 0.353514\n", - "BFGS: 38 13:38:43 2.027585 0.445806\n", - "BFGS: 39 13:38:43 2.008280 0.598722\n", - "BFGS: 40 13:38:43 1.961580 0.417804\n", - "BFGS: 41 13:38:43 1.944614 0.394004\n", - "BFGS: 42 13:38:43 1.924725 0.253109\n", - "BFGS: 43 13:38:43 1.920099 0.198841\n", - "BFGS: 44 13:38:43 1.918268 0.241993\n", - "BFGS: 45 13:38:43 1.914354 0.174659\n", - "BFGS: 46 13:38:43 1.911788 0.161663\n", - "BFGS: 47 13:38:43 1.906467 0.178799\n", - "BFGS: 48 13:38:43 1.898212 0.325512\n", - "BFGS: 49 13:38:43 1.885054 0.527431\n", - "BFGS: 50 13:38:43 1.868616 0.682255\n", - "BFGS: 51 13:38:43 1.841695 0.544759\n", - "BFGS: 52 13:38:43 1.813763 0.525703\n", - "BFGS: 53 13:38:43 1.799056 0.473126\n", - "BFGS: 54 13:38:43 1.781063 0.525293\n", - "BFGS: 55 13:38:43 1.764592 0.266127\n", - "BFGS: 56 13:38:43 1.750609 0.323475\n", - "BFGS: 57 13:38:43 1.745152 0.335245\n", - "BFGS: 58 13:38:43 1.726975 0.339827\n", - "BFGS: 59 13:38:43 1.709596 0.376426\n", - "BFGS: 60 13:38:43 1.692585 0.353800\n", - "BFGS: 61 13:38:43 1.676940 0.341398\n", - "BFGS: 62 13:38:43 1.672960 0.262012\n", - "BFGS: 63 13:38:43 1.668287 0.213742\n", - "BFGS: 64 13:38:43 1.665161 0.145218\n", - "BFGS: 65 13:38:43 1.660452 0.161112\n", - "BFGS: 66 13:38:43 1.657238 0.147420\n", - "BFGS: 67 13:38:43 1.653048 0.132315\n", - "BFGS: 68 13:38:43 1.650069 0.139980\n", - "BFGS: 69 13:38:43 1.646817 0.150858\n", - "BFGS: 70 13:38:43 1.642135 0.176816\n", - "BFGS: 71 13:38:43 1.636404 0.157046\n", - "BFGS: 72 13:38:43 1.631170 0.137340\n", - "BFGS: 73 13:38:43 1.628987 0.099676\n", - "BFGS: 74 13:38:43 1.627594 0.053519\n", - "BFGS: 75 13:38:43 1.626377 0.056140\n", - "BFGS: 76 13:38:43 1.625338 0.074615\n", - "BFGS: 77 13:38:43 1.623987 0.079913\n", - "BFGS: 78 13:38:43 1.621962 0.112052\n", - "BFGS: 79 13:38:43 1.618721 0.121740\n", - "BFGS: 80 13:38:43 1.615162 0.115872\n", - "BFGS: 81 13:38:43 1.611525 0.108332\n", - "BFGS: 82 13:38:43 1.608020 0.081256\n", - "BFGS: 83 13:38:43 1.605671 0.091837\n", - "BFGS: 84 13:38:43 1.602657 0.119617\n", - "BFGS: 85 13:38:43 1.600495 0.150240\n", - "BFGS: 86 13:38:43 1.598336 0.164488\n", - "BFGS: 87 13:38:43 1.595104 0.125392\n", - "BFGS: 88 13:38:43 1.588333 0.122593\n", - "BFGS: 89 13:38:43 1.584991 0.101195\n", - "BFGS: 90 13:38:43 1.583049 0.072323\n", - "BFGS: 91 13:38:43 1.582088 0.068534\n", - "BFGS: 92 13:38:43 1.581474 0.051615\n", - "BFGS: 93 13:38:43 1.580657 0.064426\n", - "BFGS: 94 13:38:43 1.579108 0.081100\n", - "BFGS: 95 13:38:43 1.576870 0.109052\n", - "BFGS: 96 13:38:43 1.573895 0.168741\n", - "BFGS: 97 13:38:43 1.570935 0.178279\n", - "BFGS: 98 13:38:43 1.568717 0.125766\n", - "BFGS: 99 13:38:43 1.567354 0.085076\n", - "BFGS: 100 13:38:43 1.566254 0.070979\n", - "BFGS: 101 13:38:43 1.564905 0.059354\n", - "BFGS: 102 13:38:43 1.564296 0.050069\n", - "BFGS: 103 13:38:43 1.563867 0.049061\n", - " Step Time Energy fmax\n", - "BFGS: 0 13:38:43 4.858089 4.335648\n", - "BFGS: 1 13:38:43 3.749587 2.765649\n", - "BFGS: 2 13:38:43 2.982136 1.576276\n", - "BFGS: 3 13:38:43 2.797083 1.046888\n", - "BFGS: 4 13:38:43 2.636838 0.963173\n", - "BFGS: 5 13:38:43 2.460467 0.850502\n", - "BFGS: 6 13:38:43 2.394027 0.275174\n", - "BFGS: 7 13:38:43 2.390947 0.157671\n", - "BFGS: 8 13:38:43 2.389399 0.128709\n", - "BFGS: 9 13:38:43 2.387495 0.153889\n", - "BFGS: 10 13:38:43 2.384853 0.182608\n", - "BFGS: 11 13:38:43 2.381565 0.179324\n", - "BFGS: 12 13:38:43 2.379334 0.125502\n", - "BFGS: 13 13:38:43 2.378086 0.073321\n", - "BFGS: 14 13:38:43 2.377497 0.075002\n", - "BFGS: 15 13:38:43 2.375103 0.148997\n", - "BFGS: 16 13:38:43 2.369195 0.281896\n", - "BFGS: 17 13:38:43 2.351976 0.675103\n", - "BFGS: 18 13:38:43 2.328524 1.060058\n", - "BFGS: 19 13:38:43 2.323226 0.888091\n", - "BFGS: 20 13:38:43 2.252269 1.005198\n", - "BFGS: 21 13:38:43 2.218799 0.322806\n", - "BFGS: 22 13:38:43 2.206764 0.286473\n", - "BFGS: 23 13:38:43 2.197523 0.367481\n", - "BFGS: 24 13:38:43 2.188781 0.371597\n", - "BFGS: 25 13:38:43 2.163317 0.685412\n", - "BFGS: 26 13:38:43 2.146480 0.675713\n", - "BFGS: 27 13:38:43 2.107178 0.428717\n", - "BFGS: 28 13:38:43 2.099233 0.316360\n", - "BFGS: 29 13:38:43 2.088093 0.355159\n", - "BFGS: 30 13:38:43 2.083547 0.250284\n", - "BFGS: 31 13:38:43 2.076155 0.222963\n", - "BFGS: 32 13:38:43 2.067822 0.304942\n", - "BFGS: 33 13:38:43 2.050532 0.332312\n", - "BFGS: 34 13:38:43 2.029539 0.380079\n", - "BFGS: 35 13:38:43 2.009535 0.431791\n", - "BFGS: 36 13:38:43 1.988627 0.600405\n", - "BFGS: 37 13:38:43 2.045107 1.246242\n", - "BFGS: 38 13:38:43 1.953165 0.524486\n", - "BFGS: 39 13:38:43 1.932351 0.473826\n", - "BFGS: 40 13:38:43 1.910252 0.325409\n", - "BFGS: 41 13:38:43 1.882118 0.494928\n", - "BFGS: 42 13:38:43 1.869072 0.361455\n", - "BFGS: 43 13:38:43 1.859207 0.243166\n", - "BFGS: 44 13:38:43 1.849129 0.246025\n", - "BFGS: 45 13:38:43 1.841171 0.284218\n", - "BFGS: 46 13:38:43 1.821756 0.339375\n", - "BFGS: 47 13:38:43 1.801423 0.430395\n", - "BFGS: 48 13:38:43 1.778609 0.656457\n", - "BFGS: 49 13:38:43 1.750094 0.552666\n", - "BFGS: 50 13:38:43 1.726564 0.260947\n", - "BFGS: 51 13:38:43 1.718442 0.222488\n", - "BFGS: 52 13:38:43 1.715206 0.261016\n", - "BFGS: 53 13:38:43 1.712081 0.212315\n", - "BFGS: 54 13:38:43 1.701720 0.264618\n", - "BFGS: 55 13:38:43 1.696334 0.285572\n", - "BFGS: 56 13:38:43 1.685067 0.309440\n", - "BFGS: 57 13:38:43 1.676213 0.213871\n", - "BFGS: 58 13:38:43 1.669709 0.149207\n", - "BFGS: 59 13:38:43 1.665968 0.167947\n", - "BFGS: 60 13:38:43 1.659264 0.203160\n", - "BFGS: 61 13:38:43 1.653040 0.275987\n", - "BFGS: 62 13:38:43 1.653300 0.262897\n", - "BFGS: 63 13:38:43 1.641568 0.261546\n", - "BFGS: 64 13:38:43 1.635742 0.229899\n", - "BFGS: 65 13:38:43 1.627258 0.253775\n", - "BFGS: 66 13:38:43 1.622796 0.249145\n", - "BFGS: 67 13:38:43 1.618816 0.184597\n", - "BFGS: 68 13:38:43 1.614494 0.184635\n", - "BFGS: 69 13:38:43 1.611618 0.141596\n", - "BFGS: 70 13:38:43 1.607902 0.160904\n", - "BFGS: 71 13:38:44 1.605236 0.168705\n", - "BFGS: 72 13:38:44 1.600801 0.176485\n", - "BFGS: 73 13:38:44 1.597036 0.151800\n", - "BFGS: 74 13:38:44 1.594103 0.114967\n", - "BFGS: 75 13:38:44 1.592226 0.073493\n", - "BFGS: 76 13:38:44 1.591398 0.069285\n", - "BFGS: 77 13:38:44 1.590510 0.081245\n", - "BFGS: 78 13:38:44 1.589109 0.095935\n", - "BFGS: 79 13:38:44 1.586753 0.136719\n", - "BFGS: 80 13:38:44 1.583699 0.154692\n", - "BFGS: 81 13:38:44 1.579869 0.132375\n", - "BFGS: 82 13:38:44 1.577646 0.091822\n", - "BFGS: 83 13:38:44 1.576423 0.121624\n", - "BFGS: 84 13:38:44 1.574710 0.157886\n", - "BFGS: 85 13:38:44 1.571932 0.189553\n", - "BFGS: 86 13:38:44 1.567807 0.200386\n", - "BFGS: 87 13:38:44 1.563567 0.171314\n", - "BFGS: 88 13:38:44 1.559720 0.118519\n", - "BFGS: 89 13:38:44 1.557412 0.104015\n", - "BFGS: 90 13:38:44 1.556491 0.065432\n", - "BFGS: 91 13:38:44 1.556001 0.045550\n", - " Step Time Energy fmax\n", - "BFGS: 0 13:38:44 4.768698 4.185514\n", - "BFGS: 1 13:38:44 3.722642 2.699616\n", - "BFGS: 2 13:38:44 3.048208 1.538464\n", - "BFGS: 3 13:38:44 2.855874 0.955794\n", - "BFGS: 4 13:38:44 2.696093 1.020375\n", - "BFGS: 5 13:38:44 2.531380 0.786448\n", - "BFGS: 6 13:38:44 2.437769 0.298652\n", - "BFGS: 7 13:38:44 2.432050 0.227671\n", - "BFGS: 8 13:38:44 2.430144 0.217614\n", - "BFGS: 9 13:38:44 2.410831 0.485928\n", - "BFGS: 10 13:38:44 2.405505 0.375454\n", - "BFGS: 11 13:38:44 2.400145 0.077391\n", - "BFGS: 12 13:38:44 2.399701 0.072525\n", - "BFGS: 13 13:38:44 2.397654 0.108801\n", - "BFGS: 14 13:38:44 2.394053 0.188057\n", - "BFGS: 15 13:38:44 2.324246 0.631374\n", - "BFGS: 16 13:38:44 2.405959 1.597398\n", - "BFGS: 17 13:38:44 2.269428 0.884951\n", - "BFGS: 18 13:38:44 2.265855 0.424486\n", - "BFGS: 19 13:38:44 2.204423 0.269210\n", - "BFGS: 20 13:38:44 2.209288 0.738368\n", - "BFGS: 21 13:38:44 2.183706 0.265330\n", - "BFGS: 22 13:38:44 2.178761 0.257445\n", - "BFGS: 23 13:38:44 2.168601 0.214130\n", - "BFGS: 24 13:38:44 2.165327 0.235065\n", - "BFGS: 25 13:38:44 2.160761 0.252898\n", - "BFGS: 26 13:38:44 2.157043 0.244883\n", - "BFGS: 27 13:38:44 2.151391 0.218995\n", - "BFGS: 28 13:38:44 2.142600 0.315073\n", - "BFGS: 29 13:38:44 2.129068 0.415578\n", - "BFGS: 30 13:38:44 2.111928 0.491123\n", - "BFGS: 31 13:38:44 2.095707 0.554883\n", - "BFGS: 32 13:38:44 2.081420 0.552266\n", - "BFGS: 33 13:38:44 2.076566 0.474505\n", - "BFGS: 34 13:38:44 2.056015 0.343448\n", - "BFGS: 35 13:38:44 2.050330 0.182202\n", - "BFGS: 36 13:38:44 2.047648 0.100826\n", - "BFGS: 37 13:38:44 2.046736 0.085317\n", - "BFGS: 38 13:38:44 2.045471 0.087620\n", - "BFGS: 39 13:38:44 2.044154 0.098674\n", - "BFGS: 40 13:38:44 2.042170 0.123872\n", - "BFGS: 41 13:38:44 2.038936 0.164348\n", - "BFGS: 42 13:38:44 2.033268 0.250121\n", - "BFGS: 43 13:38:44 2.024254 0.289357\n", - "BFGS: 44 13:38:44 2.014195 0.266321\n", - "BFGS: 45 13:38:44 2.005743 0.261141\n", - "BFGS: 46 13:38:44 1.997709 0.287033\n", - "BFGS: 47 13:38:44 1.988849 0.260170\n", - "BFGS: 48 13:38:44 1.979270 0.295508\n", - "BFGS: 49 13:38:44 1.967445 0.484438\n", - "BFGS: 50 13:38:44 1.954131 0.492208\n", - "BFGS: 51 13:38:44 1.933393 0.507867\n", - "BFGS: 52 13:38:44 1.895347 0.738733\n", - "BFGS: 53 13:38:44 2.049615 1.502595\n", - "BFGS: 54 13:38:44 1.846475 0.303221\n", - "BFGS: 55 13:38:44 1.834956 0.342025\n", - "BFGS: 56 13:38:44 1.825091 0.214128\n", - "BFGS: 57 13:38:44 1.818399 0.155947\n", - "BFGS: 58 13:38:44 1.814371 0.127990\n", - "BFGS: 59 13:38:44 1.811452 0.117402\n", - "BFGS: 60 13:38:44 1.810132 0.103187\n", - "BFGS: 61 13:38:44 1.808152 0.116252\n", - "BFGS: 62 13:38:44 1.804522 0.200942\n", - "BFGS: 63 13:38:44 1.798032 0.294110\n", - "BFGS: 64 13:38:44 1.789354 0.290753\n", - "BFGS: 65 13:38:44 1.782388 0.202341\n", - "BFGS: 66 13:38:44 1.778723 0.116026\n", - "BFGS: 67 13:38:44 1.777083 0.089189\n", - "BFGS: 68 13:38:44 1.775979 0.104448\n", - "BFGS: 69 13:38:44 1.774978 0.095565\n", - "BFGS: 70 13:38:44 1.773226 0.088408\n", - "BFGS: 71 13:38:44 1.771155 0.132743\n", - "BFGS: 72 13:38:44 1.765901 0.229474\n", - "BFGS: 73 13:38:44 1.762534 0.341966\n", - "BFGS: 74 13:38:44 1.753794 0.287104\n", - "BFGS: 75 13:38:44 1.743797 0.203549\n", - "BFGS: 76 13:38:44 1.742016 0.335041\n", - "BFGS: 77 13:38:44 1.734797 0.184035\n", - "BFGS: 78 13:38:44 1.731605 0.153149\n", - "BFGS: 79 13:38:44 1.725814 0.186165\n", - "BFGS: 80 13:38:44 1.719423 0.211917\n", - "BFGS: 81 13:38:44 1.711774 0.245457\n", - "BFGS: 82 13:38:44 1.701617 0.284534\n", - "BFGS: 83 13:38:44 1.688452 0.264537\n", - "BFGS: 84 13:38:44 1.679644 0.247977\n", - "BFGS: 85 13:38:44 1.669691 0.298816\n", - "BFGS: 86 13:38:44 1.663640 0.162919\n", - "BFGS: 87 13:38:44 1.659322 0.135506\n", - "BFGS: 88 13:38:44 1.655114 0.138181\n", - "BFGS: 89 13:38:44 1.651175 0.152389\n", - "BFGS: 90 13:38:44 1.645363 0.147398\n", - "BFGS: 91 13:38:44 1.640514 0.124246\n", - "BFGS: 92 13:38:44 1.635880 0.102612\n", - "BFGS: 93 13:38:44 1.631784 0.074018\n", - "BFGS: 94 13:38:44 1.628417 0.080716\n", - "BFGS: 95 13:38:44 1.626898 0.102626\n", - "BFGS: 96 13:38:44 1.625750 0.108286\n", - "BFGS: 97 13:38:44 1.624152 0.087747\n", - "BFGS: 98 13:38:44 1.622570 0.097223\n", - "BFGS: 99 13:38:44 1.619966 0.144380\n", - "BFGS: 100 13:38:44 1.616123 0.168694\n", - "BFGS: 101 13:38:44 1.611692 0.197019\n", - "BFGS: 102 13:38:44 1.608222 0.156846\n", - "BFGS: 103 13:38:44 1.606038 0.107041\n", - "BFGS: 104 13:38:44 1.604623 0.127130\n", - "BFGS: 105 13:38:44 1.603084 0.128855\n", - "BFGS: 106 13:38:44 1.600280 0.175082\n", - "BFGS: 107 13:38:44 1.594542 0.228911\n", - "BFGS: 108 13:38:44 1.588654 0.302846\n", - "BFGS: 109 13:38:44 1.581044 0.340313\n", - "BFGS: 110 13:38:44 1.574247 0.155956\n", - "BFGS: 111 13:38:44 1.571176 0.137782\n", - "BFGS: 112 13:38:44 1.569703 0.119500\n", - "BFGS: 113 13:38:44 1.568763 0.088242\n", - "BFGS: 114 13:38:44 1.567914 0.086683\n", - "BFGS: 115 13:38:44 1.565823 0.099817\n", - "BFGS: 116 13:38:44 1.563672 0.099189\n", - "BFGS: 117 13:38:44 1.561168 0.093598\n", - "BFGS: 118 13:38:44 1.559328 0.112995\n", - "BFGS: 119 13:38:44 1.557967 0.078492\n", - "BFGS: 120 13:38:44 1.556911 0.055488\n", - "BFGS: 121 13:38:44 1.556042 0.067389\n", - "BFGS: 122 13:38:44 1.555222 0.067313\n", - "BFGS: 123 13:38:44 1.554427 0.074465\n", - "BFGS: 124 13:38:44 1.553717 0.062147\n", - "BFGS: 125 13:38:44 1.552969 0.069002\n", - "BFGS: 126 13:38:44 1.551897 0.079615\n", - "BFGS: 127 13:38:44 1.550178 0.091397\n", - "BFGS: 128 13:38:44 1.547871 0.107277\n", - "BFGS: 129 13:38:44 1.545932 0.052441\n", - "BFGS: 130 13:38:44 1.545224 0.046052\n", - " Step Time Energy fmax\n", - "BFGS: 0 13:38:44 4.709773 4.111828\n", - "BFGS: 1 13:38:44 3.700755 2.742187\n", - "BFGS: 2 13:38:44 3.003616 1.500037\n", - "BFGS: 3 13:38:44 2.827804 0.984416\n", - "BFGS: 4 13:38:44 2.666645 0.947305\n", - "BFGS: 5 13:38:44 2.493413 0.835510\n", - "BFGS: 6 13:38:44 2.424834 0.285378\n", - "BFGS: 7 13:38:44 2.420892 0.185677\n", - "BFGS: 8 13:38:44 2.419362 0.165797\n", - "BFGS: 9 13:38:44 2.415388 0.182351\n", - "BFGS: 10 13:38:44 2.412008 0.181795\n", - "BFGS: 11 13:38:44 2.408302 0.164027\n", - "BFGS: 12 13:38:44 2.406635 0.080239\n", - "BFGS: 13 13:38:44 2.406234 0.047315\n", - "Updating lock file 'dvc.lock'\n", - "\n", - "To track the changes with git, run:\n", - "\n", - "\tgit add nodes/Relax/.gitignore dvc.lock nodes/Smiles2Conformers/.gitignore\n", - "\n", - "To enable auto staging, run:\n", - "\n", - "\tdvc config core.autostage true\n", - "Use `dvc push` to send your updates to remote storage.\n" - ] - } - ], + "outputs": [], "source": [ "project.repro(build=False)" ] @@ -771,22 +212,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[Atoms(symbols='C4H10', pbc=False, calculator=SinglePointCalculator(...)),\n", - " Atoms(symbols='C4H10', pbc=False, calculator=SinglePointCalculator(...)),\n", - " Atoms(symbols='C4H10', pbc=False, calculator=SinglePointCalculator(...)),\n", - " Atoms(symbols='C4H10', pbc=False, calculator=SinglePointCalculator(...)),\n", - " Atoms(symbols='C4H10', pbc=False, calculator=SinglePointCalculator(...))]" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "relax.frames" ] @@ -799,13 +225,6 @@ "source": [ "temp_dir.cleanup()" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/mlipx/recipes/README.md b/mlipx/recipes/README.md new file mode 100644 index 0000000..b95b6e9 --- /dev/null +++ b/mlipx/recipes/README.md @@ -0,0 +1,6 @@ +# Jinja2 Templating + +We use `recipe.py.jinja2` templates for generating the `main.py` and `models.py` file from the CLI. +For new Nodes, once you added them to `mlipx/nodes/.py` and updated the `mlipx/__init__.pyi` you might want to create a new template and update the CLI in `main.py`. + +If you want to introduce a new model, you might want to adapt `models.py.jinja2` and the `main.py` as well.