|
51 | 51 | "outputs": [], |
52 | 52 | "source": [ |
53 | 53 | "from pathlib import Path\n", |
| 54 | + "\n", |
| 55 | + "from pexpect.replwrap import python\n", |
| 56 | + "\n", |
54 | 57 | "from lobsterpy.cohp.analyze import Analysis\n", |
55 | 58 | "from lobsterpy.cohp.describe import Description\n", |
56 | 59 | "import warnings\n", |
|
92 | 95 | "source": [ |
93 | 96 | "# Initialize Analysis object\n", |
94 | 97 | "analyse = Analysis(\n", |
95 | | - " path_to_poscar=directory / \"POSCAR.gz\",\n", |
| 98 | + " path_to_poscar=directory / \"CONTCAR.gz\",\n", |
96 | 99 | " path_to_icohplist=directory / \"ICOHPLIST.lobster.gz\",\n", |
97 | 100 | " path_to_cohpcar=directory / \"COHPCAR.lobster.gz\",\n", |
98 | 101 | " path_to_charge=directory / \"CHARGE.lobster.gz\",\n", |
|
195 | 198 | "\n", |
196 | 199 | "```python\n", |
197 | 200 | "analyse = Analysis(\n", |
198 | | - " path_to_poscar=directory / \"POSCAR.gz\",\n", |
| 201 | + " path_to_poscar=directory / \"CONTCAR.gz\",\n", |
199 | 202 | " path_to_icohplist=directory / \"ICOBILIST.lobster.gz\",\n", |
200 | 203 | " path_to_cohpcar=directory / \"COBICAR.lobster.gz\",\n", |
201 | 204 | " path_to_charge=directory / \"CHARGE.lobster.gz\",\n", |
|
232 | 235 | "outputs": [], |
233 | 236 | "source": [ |
234 | 237 | "analyse = Analysis(\n", |
235 | | - " path_to_poscar=directory / \"POSCAR.gz\",\n", |
| 238 | + " path_to_poscar=directory / \"CONTCAR.gz\",\n", |
236 | 239 | " path_to_icohplist=directory / \"ICOHPLIST.lobster.gz\",\n", |
237 | 240 | " path_to_cohpcar=directory / \"COHPCAR.lobster.gz\",\n", |
238 | 241 | " path_to_charge=directory / \"CHARGE.lobster.gz\",\n", |
|
358 | 361 | "source": [ |
359 | 362 | "# Get calculation quality summary dict\n", |
360 | 363 | "calc_quality_K3Sb = Analysis.get_lobster_calc_quality_summary(\n", |
361 | | - " path_to_poscar=directory / \"POSCAR.gz\",\n", |
| 364 | + " path_to_poscar=directory / \"CONTCAR.gz\",\n", |
362 | 365 | " path_to_charge=directory / \"CHARGE.lobster.gz\",\n", |
363 | 366 | " path_to_lobsterin=directory / \"lobsterin.gz\",\n", |
364 | 367 | " path_to_lobsterout=directory / \"lobsterout.gz\",\n", |
|
557 | 560 | "# Load Lobster DOS\n", |
558 | 561 | "directory = Path(\".\") / \"..\" / \"..\" / \"tests\" / \"test_data\" / \"NaCl_comp_range\"\n", |
559 | 562 | "dos = Doscar(doscar=directory / 'DOSCAR.lobster.gz',\n", |
560 | | - " structure_file=directory / 'POSCAR.gz')" |
| 563 | + " structure_file=directory / 'CONTCAR.gz')" |
561 | 564 | ] |
562 | 565 | }, |
563 | 566 | { |
|
569 | 572 | "# Load Lobster DOS (Change this cell block type to Code when executing locally)\n", |
570 | 573 | "directory = Path(\"LobsterPy\") / \"tests\" / \"test_data\" / \"NaCl_comp_range\"\n", |
571 | 574 | "dos = Doscar(doscar=directory / 'DOSCAR.lobster.gz',\n", |
572 | | - " structure_file=directory / 'POSCAR.gz')\n", |
| 575 | + " structure_file=directory / 'CONTCAR.gz')\n", |
573 | 576 | "```" |
574 | 577 | ] |
575 | 578 | }, |
|
585 | 588 | "cell_type": "code", |
586 | 589 | "execution_count": null, |
587 | 590 | "id": "a271f2f0", |
588 | | - "metadata": { |
589 | | - "scrolled": false |
590 | | - }, |
| 591 | + "metadata": {}, |
591 | 592 | "outputs": [], |
592 | 593 | "source": [ |
593 | 594 | "style.use('default') # Complete reset the matplotlib figure style\n", |
|
658 | 659 | "outputs": [], |
659 | 660 | "source": [ |
660 | 661 | "graph_NaCl_all = LobsterGraph(\n", |
661 | | - " path_to_poscar=directory / \"POSCAR.gz\",\n", |
| 662 | + " path_to_poscar=directory / \"CONTCAR.gz\",\n", |
662 | 663 | " path_to_charge=directory / \"CHARGE.lobster.gz\",\n", |
663 | 664 | " path_to_cohpcar=directory / \"COHPCAR.lobster.gz\",\n", |
664 | 665 | " path_to_icohplist=directory / \"ICOHPLIST.lobster.gz\",\n", |
|
679 | 680 | "```python\n", |
680 | 681 | "#### (Change this cell block type to Code or copy it from here when executing locally)\n", |
681 | 682 | "graph_NaCl_all = LobsterGraph(\n", |
682 | | - " path_to_poscar=directory / \"POSCAR.gz\",\n", |
| 683 | + " path_to_poscar=directory / \"CONTCAR.gz\",\n", |
683 | 684 | " path_to_charge=directory / \"CHARGE.lobster.gz\",\n", |
684 | 685 | " path_to_cohpcar=directory / \"COHPCAR.lobster.gz\",\n", |
685 | 686 | " path_to_icohplist=directory / \"ICOHPLIST.lobster.gz\",\n", |
|
746 | 747 | "metadata": {}, |
747 | 748 | "outputs": [], |
748 | 749 | "source": [ |
749 | | - "from lobsterpy.featurize.batch import (BatchCoxxFingerprint, BatchDosFeaturizer,\n", |
| 750 | + "from lobsterpy.featurize.batch import (BatchCoxxFingerprint, BatchIcoxxlistFeaturizer, BatchDosFeaturizer,\n", |
750 | 751 | " BatchSummaryFeaturizer, BatchStructureGraphs)" |
751 | 752 | ] |
752 | 753 | }, |
|
834 | 835 | "fp_cohp_bonding.get_similarity_matrix_df()" |
835 | 836 | ] |
836 | 837 | }, |
| 838 | + { |
| 839 | + "metadata": {}, |
| 840 | + "cell_type": "markdown", |
| 841 | + "source": "### BatchIcoxxlistFeaturizer", |
| 842 | + "id": "a5220531c2082185" |
| 843 | + }, |
| 844 | + { |
| 845 | + "metadata": {}, |
| 846 | + "cell_type": "markdown", |
| 847 | + "source": [ |
| 848 | + "`BatchIcoxxlistFeaturizer` provides a convenient way to extract BWDF as features from the LOBSTER calculation directory. The extracted features consist of the following:\n", |
| 849 | + "\n", |
| 850 | + "1. BWDF mean, standard deviation , skewness, kurtosis, weighted mean, and weighted standard deviation\n", |
| 851 | + "2. Complete BWDF as columns in the dataframe\n", |
| 852 | + "3. BWDF values sorted by bond distances as columns in the dataframe\n", |
| 853 | + "4. Bond distances sorted by BWDF values as columns in the dataframe" |
| 854 | + ], |
| 855 | + "id": "9de31478633c9afc" |
| 856 | + }, |
| 857 | + { |
| 858 | + "metadata": {}, |
| 859 | + "cell_type": "code", |
| 860 | + "outputs": [], |
| 861 | + "execution_count": null, |
| 862 | + "source": [ |
| 863 | + "# Initialize the batch ICOXXLIST featurizer\n", |
| 864 | + "batch_icohp = BatchIcoxxlistFeaturizer(path_to_lobster_calcs=directory / \"..\" / \"Featurizer_test_data\" / \"Lobster_calcs\", # path to parent lobster calcs\n", |
| 865 | + " normalization=\"formula_units\", # will normalize the BWDF values by formula units\n", |
| 866 | + " max_length=6, # maximum bond length for BWDF computation\n", |
| 867 | + " bin_width=0.1, # sets number for bins\n", |
| 868 | + " bwdf_df_type=\"stats\", # Type of BWDF dataframe to generate (stats, binned, sorted_bwdf, sorted_dists)\n", |
| 869 | + " read_icobis=False, # set to true to read ICOBI data\n", |
| 870 | + " read_icoops=False, # set to true to read ICOOP data\n", |
| 871 | + " n_jobs=3,)" |
| 872 | + ], |
| 873 | + "id": "2ed6793640da4fac" |
| 874 | + }, |
| 875 | + { |
| 876 | + "metadata": {}, |
| 877 | + "cell_type": "markdown", |
| 878 | + "source": [ |
| 879 | + "```python\n", |
| 880 | + "## Initialize batch ICOXXLIST featurizer (Change this cell block type to Code and remove formatting when executing locally)\n", |
| 881 | + "batch_icohp = BatchIcoxxlistFeaturizer(path_to_lobster_calcs=directory / \"..\" / \"Featurizer_test_data\" / \"Lobster_calcs\", # path to parent lobster calcs\n", |
| 882 | + " normalization=\"formula_units\", # will normalize the BWDF values by formula units\n", |
| 883 | + " max_length=6, # maximum bond length for BWDF computation\n", |
| 884 | + " bin_width=0.1, # sets number for bins\n", |
| 885 | + " bwdf_df_type=\"stats\", # Type of BWDF dataframe to generate (stats, binned, sorted_bwdf, sorted_dists)\n", |
| 886 | + " read_icobis=False, # set to true to read ICOBI data\n", |
| 887 | + " read_icoops=False, # set to true to read ICOOP data\n", |
| 888 | + " n_jobs=3,)\n", |
| 889 | + "```" |
| 890 | + ], |
| 891 | + "id": "b3111a3881b29058" |
| 892 | + }, |
| 893 | + { |
| 894 | + "metadata": {}, |
| 895 | + "cell_type": "code", |
| 896 | + "outputs": [], |
| 897 | + "execution_count": null, |
| 898 | + "source": [ |
| 899 | + "# get the BWDF stats df\n", |
| 900 | + "batch_icohp.get_df()" |
| 901 | + ], |
| 902 | + "id": "7c731fe3e32065be" |
| 903 | + }, |
837 | 904 | { |
838 | 905 | "cell_type": "markdown", |
839 | 906 | "id": "4bf34582", |
|
1067 | 1134 | "name": "python", |
1068 | 1135 | "nbconvert_exporter": "python", |
1069 | 1136 | "pygments_lexer": "ipython3", |
1070 | | - "version": "3.12.4" |
| 1137 | + "version": "3.10.14" |
1071 | 1138 | }, |
1072 | 1139 | "widgets": { |
1073 | 1140 | "application/vnd.jupyter.widget-state+json": { |
|
0 commit comments