{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Analyze a BigDFT run from a Logfile class" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This small tutorial will show how to inspect the result of a BigDFT calculation from the `Logfile` class.\n", "An instance of this class is returned after the execution of a calculator. \n", "Technically, such instance is constructed from the `yaml` file which is associated to the logfile of the actual run of the `bigdft` core executable." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For this reason, it is possible to inspect already existing runs by manually instantiating the class from a `yaml` logfile.\n", "In order to do that we can load the Logfiles module:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "from BigDFT import Logfiles as L\n", "from os.path import join\n", "datadir = 'testfiles'" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Executing: wget https://raw.githubusercontent.com/BigDFT-group/resources/main/datalake/Logfilesbasics.tar.gz -O lfs.info\n", "--2025-01-17 17:45:22-- https://raw.githubusercontent.com/BigDFT-group/resources/main/datalake/Logfilesbasics.tar.gz\n", "Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8001::154, 2606:50c0:8002::154, 2606:50c0:8000::154, ...\n", "Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8001::154|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 132 [text/plain]\n", "Saving to: ‘lfs.info’\n", "\n", " 0K 100% 12.4M=0s\n", "\n", "2025-01-17 17:45:22 (12.4 MB/s) - ‘lfs.info’ saved [132/132]\n", "\n", "\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ " % Total % Received % Xferd Average Speed Time Time Time Current\n", " Dload Upload Total Spent Left Speed\n", "100 902 100 747 100 155 2891 599 --:--:-- --:--:-- --:--:-- 3496\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Executing: wget https://github-cloud.githubusercontent.com/alambic/media/547350918/aa/e1/aae1517fb137fb3ae7c6cacfb84a07a3e85ca12687afc3906dfa797abe665a76?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA5BA2674WPWWEFGQ5%2F20250117%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250117T174522Z&X-Amz-Expires=3600&X-Amz-Signature=c376af550f0f201242e1f7a93f021e06a9be79a87c186000815bf6cb6e869600&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=596478275&token=1 -O ./Logfilesbasics.tar.gz\n", "--2025-01-17 17:45:22-- https://github-cloud.githubusercontent.com/alambic/media/547350918/aa/e1/aae1517fb137fb3ae7c6cacfb84a07a3e85ca12687afc3906dfa797abe665a76?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA5BA2674WPWWEFGQ5%2F20250117%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250117T174522Z&X-Amz-Expires=3600&X-Amz-Signature=c376af550f0f201242e1f7a93f021e06a9be79a87c186000815bf6cb6e869600&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=596478275&token=1\n", "Resolving github-cloud.githubusercontent.com (github-cloud.githubusercontent.com)... 185.199.110.154, 185.199.108.154, 185.199.111.154, ...\n", "Connecting to github-cloud.githubusercontent.com (github-cloud.githubusercontent.com)|185.199.110.154|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 1074180 (1.0M) [application/x-gzip]\n", "Saving to: ‘./Logfilesbasics.tar.gz’\n", "\n", " 0K .......... .......... .......... .......... .......... 4% 3.64M 0s\n", " 50K .......... .......... .......... .......... .......... 9% 5.80M 0s\n", " 100K .......... .......... .......... .......... .......... 14% 18.1M 0s\n", " 150K .......... .......... .......... .......... .......... 19% 20.6M 0s\n", " 200K .......... .......... .......... .......... .......... 23% 33.4M 0s\n", " 250K .......... .......... .......... .......... .......... 28% 8.09M 0s\n", " 300K .......... .......... .......... .......... .......... 33% 32.2M 0s\n", " 350K .......... .......... .......... .......... .......... 38% 59.4M 0s\n", " 400K .......... .......... .......... .......... .......... 42% 30.8M 0s\n", " 450K .......... .......... .......... .......... .......... 47% 31.8M 0s\n", " 500K .......... .......... .......... .......... .......... 52% 5.08M 0s\n", " 550K .......... .......... .......... .......... .......... 57% 71.7M 0s\n", " 600K .......... .......... .......... .......... .......... 61% 157M 0s\n", " 650K .......... .......... .......... .......... .......... 66% 178M 0s\n", " 700K .......... .......... .......... .......... .......... 71% 12.3M 0s\n", " 750K .......... .......... .......... .......... .......... 76% 7.05M 0s\n", " 800K .......... .......... .......... .......... .......... 81% 93.8M 0s\n", " 850K .......... .......... .......... .......... .......... 85% 164M 0s\n", " 900K .......... .......... .......... .......... .......... 90% 161M 0s\n", " 950K .......... .......... .......... .......... .......... 95% 19.2M 0s\n", " 1000K .......... .......... .......... .......... ......... 100% 137M=0.07s\n", "\n", "2025-01-17 17:45:23 (15.6 MB/s) - ‘./Logfilesbasics.tar.gz’ saved [1074180/1074180]\n", "\n", "\n" ] }, { "data": { "text/plain": [ "['log-mpro.yaml',\n", " 'GEOPT-all_sqnmbiomode.out.ref.yaml',\n", " 'log-K.yaml',\n", " 'log-HBDMI.yaml']" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from futile.Utils import data_path, untar_archive\n", "archive='Logfilesbasics.tar.gz'\n", "data_path(archive)\n", "untar_archive(archive,dest=datadir)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us now load a file into a instance of a Logfile class. Imagine that our logfile corresponds to a single-point run, and it is present in a file named name `log-HBDMI.yaml`:\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "HBDMI = L.Logfile(join(datadir,'log-HBDMI.yaml'))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "From this instance it is also possible to visualize the system associated" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "from BigDFT import Systems as S\n", "\n", "sys = S.system_from_log(HBDMI,fragmentation='atomic')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "application/3dmoljs_load.v0": "
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.