Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions asap_env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: asap_env
channels:
- conda-forge
- fastai
dependencies:
- python=3.10
- pip
- setuptools
# Core Library Dependencies
- fastcore>=1.5
- numpy
- scipy
- ase
- spglib
- tqdm
- click
- matplotlib
- ipython
# Domain Specific (including asap3 and openkim-models for ASAP tests)
- alamode
- openkim-models=2021.01.28
- asap3
# Development Tools
- nbdev
- jupyterlab
- ipywidgets
- pre-commit
- quarto
- pip:
- -e .
6 changes: 3 additions & 3 deletions nbs/01_VASP_Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"source": [
"#| vasp\n",
"# Directory in which our project resides\n",
"base_dir = f'../example/VASP_3C-SiC/{supercell}/'"
"base_dir = f'../examples/VASP_3C-SiC/{supercell}/'"
]
},
{
Expand Down Expand Up @@ -158,7 +158,7 @@
"# Setup the calculator - single point energy calculation\n",
"# The details will change here from case to case\n",
"# We are using run-calc.sh from the main project directory!\n",
"calc.set(directory=f'../TMP/calc_{supercell}/sc')\n",
"calc.set(directory=f'../.tmp/calc_{supercell}/sc')\n",
"calc.set(command=f'{os.getcwd()}/../run-calc.sh \"3C-SiC-{supercell}\"')\n",
"calc.set(nsw=0)\n",
"cryst.calc = calc"
Expand Down Expand Up @@ -214,7 +214,7 @@
"#|vasp\n",
"# Space for results\n",
"xsl = []\n",
"calc_dir = f'../TMP/calc_{supercell}'"
"calc_dir = f'../.tmp/calc_{supercell}'"
]
},
{
Expand Down
74 changes: 37 additions & 37 deletions nbs/02_CLI.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
"outputs": [],
"source": [
"import os\n",
"os.makedirs('TMP', exist_ok=True)\n",
"os.makedirs('.tmp', exist_ok=True)\n",
"#| hide\n",
"#| vasp\n",
"from tempfile import TemporaryDirectory\n",
"calc_dir = TemporaryDirectory(dir='../TMP')\n",
"calc_dir_2 = TemporaryDirectory(dir='../TMP')"
"calc_dir = TemporaryDirectory(dir='../.tmp')\n",
"calc_dir_2 = TemporaryDirectory(dir='../.tmp')"
]
},
{
Expand Down Expand Up @@ -484,12 +484,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"$ hecss-sampler -W ../TMP/tmp552lh_fn -T 1000 -N 0 -e 10 -k 0 -c ./run-calc.sh ../example/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"$ hecss-sampler -W ../.tmp/tmp552lh_fn -T 1000 -N 0 -e 10 -k 0 -c ./run-calc.sh ../examples/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"\n",
"HECSS (0.5.29)\n",
"Supercell: ../example/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"Supercell: ../examples/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"Temperature: 1000.0K\n",
"Work directory: ../TMP/tmp552lh_fn\n",
"Work directory: ../.tmp/tmp552lh_fn\n",
"Calculator: VASP\n",
"\n",
"<Result RuntimeError('Looking for PP for potpaw/C/POTCAR\\n The pseudopotentials are expected to be in:\\n LDA: $VASP_PP_PATH/potpaw/\\n PBE: $VASP_PP_PATH/potpaw_PBE/\\n PW91: $VASP_PP_PATH/potpaw_GGA/\\n\\n No pseudopotential for C!')>\n"
Expand Down Expand Up @@ -536,7 +536,7 @@
" \"-T 1000 -N 0 -e 10 \"\n",
" \"-k 0 \"\n",
" \"-c ./run-calc.sh \"\n",
" \"../example/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\")"
" \"../examples/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\")"
]
},
{
Expand All @@ -557,12 +557,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"$ hecss-sampler -W ../TMP/tmp552lh_fn -T 300 -N 10 -w 1.85 -c ./run-calc.sh -s scale.dat ../example/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"$ hecss-sampler -W ../.tmp/tmp552lh_fn -T 300 -N 10 -w 1.85 -c ./run-calc.sh -s scale.dat ../examples/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"\n",
"HECSS (0.5.29)\n",
"Supercell: ../example/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"Supercell: ../examples/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"Temperature: 300.0K\n",
"Work directory: ../TMP/tmp552lh_fn\n",
"Work directory: ../.tmp/tmp552lh_fn\n",
"Calculator: VASP\n",
"\n",
"<Result RuntimeError('Looking for PP for potpaw/C/POTCAR\\n The pseudopotentials are expected to be in:\\n LDA: $VASP_PP_PATH/potpaw/\\n PBE: $VASP_PP_PATH/potpaw_PBE/\\n PW91: $VASP_PP_PATH/potpaw_GGA/\\n\\n No pseudopotential for C!')>\n"
Expand Down Expand Up @@ -613,7 +613,7 @@
" \"-T 300 -N 10 -w 1.85 \"\n",
" \"-c ./run-calc.sh \"\n",
" \"-s scale.dat \"\n",
" \"../example/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\")"
" \"../examples/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\")"
]
},
{
Expand Down Expand Up @@ -675,11 +675,11 @@
" -V, --version Show the version and exit.\n",
" -h, --help Show this message and exit.\n",
"\n",
"$ calculate-xscale -o ../TMP/tmp552lh_fn/iscale.dat -s 10 ../example/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR ../TMP/tmp552lh_fn/T_300.0K/scale.dat\n",
"$ calculate-xscale -o ../.tmp/tmp552lh_fn/iscale.dat -s 10 ../examples/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR ../.tmp/tmp552lh_fn/T_300.0K/scale.dat\n",
"\n",
"Usage: calculate-xscale [OPTIONS] SUPERCELL SCALE\n",
"\n",
"Error: Invalid value for 'SCALE': Path '../TMP/tmp552lh_fn/T_300.0K/scale.dat' does not exist.\n",
"Error: Invalid value for 'SCALE': Path '../.tmp/tmp552lh_fn/T_300.0K/scale.dat' does not exist.\n",
"\n",
"<Result SystemExit(2)>\n"
]
Expand All @@ -703,7 +703,7 @@
"run_cli_cmd(calculate_xscale, \"--help\")\n",
"run_cli_cmd(calculate_xscale, \n",
" f\"-o {calc_dir.name}/iscale.dat -s 10 \"\n",
" \"../example/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR \"\n",
" \"../examples/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR \"\n",
" f\"{calc_dir.name}/T_300.0K/scale.dat\")"
]
},
Expand All @@ -723,12 +723,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"$ hecss-sampler -W ../TMP/tmpgf1xuhq8 -T 300 -N 10 -w 1.85 -c ./run-calc.sh -s scale.dat -a ../TMP/tmp552lh_fn/iscale.dat ../example/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"$ hecss-sampler -W ../.tmp/tmpgf1xuhq8 -T 300 -N 10 -w 1.85 -c ./run-calc.sh -s scale.dat -a ../.tmp/tmp552lh_fn/iscale.dat ../examples/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"\n",
"HECSS (0.5.29)\n",
"Supercell: ../example/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"Supercell: ../examples/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\n",
"Temperature: 300.0K\n",
"Work directory: ../TMP/tmpgf1xuhq8\n",
"Work directory: ../.tmp/tmpgf1xuhq8\n",
"Calculator: VASP\n",
"\n",
"<Result RuntimeError('Looking for PP for potpaw/C/POTCAR\\n The pseudopotentials are expected to be in:\\n LDA: $VASP_PP_PATH/potpaw/\\n PBE: $VASP_PP_PATH/potpaw_PBE/\\n PW91: $VASP_PP_PATH/potpaw_GGA/\\n\\n No pseudopotential for C!')>\n"
Expand Down Expand Up @@ -778,7 +778,7 @@
"run_cli_cmd(hecss_sampler, \n",
" f\"-W {calc_dir_2.name} -T 300 -N 10 -w 1.85 \"\n",
" f\"-c ./run-calc.sh -s scale.dat -a {calc_dir.name}/iscale.dat\"\n",
" \" ../example/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\")"
" \" ../examples/VASP_3C-SiC/1x1x1/sc_1x1x1/CONTCAR\")"
]
},
{
Expand Down Expand Up @@ -855,8 +855,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"cat: '../TMP/$../TMP/tmp552lh_fn/T_300.0K/DFSET.dat.raw': Nie ma takiego pliku ani katalogu\n",
"cat: '../TMP/$../TMP/tmpgf1xuhq8/T_300.0K/DFSET.dat.raw': Nie ma takiego pliku ani katalogu\n",
"cat: '../.tmp/$../.tmp/tmp552lh_fn/T_300.0K/DFSET.dat.raw': Nie ma takiego pliku ani katalogu\n",
"cat: '../.tmp/$../.tmp/tmpgf1xuhq8/T_300.0K/DFSET.dat.raw': Nie ma takiego pliku ani katalogu\n",
"$ reshape-sample --help\n",
"\n",
"Usage: reshape-sample [OPTIONS] DFSET [T]\n",
Expand Down Expand Up @@ -886,9 +886,9 @@
" -V, --version Show the version and exit.\n",
" --help Show this message and exit.\n",
"\n",
"$ reshape-sample -d -o ../TMP/DFSET.dat ../TMP/DFSET_raw.dat\n",
"$ reshape-sample -d -o ../.tmp/DFSET.dat ../.tmp/DFSET_raw.dat\n",
"\n",
"/home/jochym/Projects/hecss_AG/hecss/util.py:96: UserWarning: loadtxt: input contained no data: \"../TMP/DFSET_raw.dat\"\n",
"/home/jochym/Projects/hecss_AG/hecss/util.py:96: UserWarning: loadtxt: input contained no data: \"../.tmp/DFSET_raw.dat\"\n",
" dfset = loadtxt(fn).reshape(N,-1,6)\n",
"\n",
"<Result ValueError('cannot reshape array of size 0 into shape (0,newaxis,6)')>\n"
Expand All @@ -915,12 +915,12 @@
],
"source": [
"#| echo: false\n",
"!cat ../TMP/${calc_dir.name}/T_300.0K/DFSET.dat.raw ../TMP/${calc_dir_2.name}/T_300.0K/DFSET.dat.raw > ../TMP/DFSET_raw.dat\n",
"!rm -f ../TMP/DFSET.dat\n",
"!cat ../.tmp/${calc_dir.name}/T_300.0K/DFSET.dat.raw ../.tmp/${calc_dir_2.name}/T_300.0K/DFSET.dat.raw > ../.tmp/DFSET_raw.dat\n",
"!rm -f ../.tmp/DFSET.dat\n",
"run_cli_cmd(reshape_sample, \"--help\")\n",
"run_cli_cmd(reshape_sample, \n",
" \" -d -o ../TMP/DFSET.dat\"\n",
" \" ../TMP/DFSET_raw.dat\")"
" \" -d -o ../.tmp/DFSET.dat\"\n",
" \" ../.tmp/DFSET_raw.dat\")"
]
},
{
Expand All @@ -932,12 +932,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"$ reshape-sample -N 1 -w -d -o ../TMP/tmp552lh_fn/T_300.0K/DFSET.dat --check ../TMP/tmp552lh_fn/T_300.0K/smpl ../TMP/tmp552lh_fn/T_300.0K/DFSET.dat.raw\n",
"$ reshape-sample -N 1 -w -d -o ../.tmp/tmp552lh_fn/T_300.0K/DFSET.dat --check ../.tmp/tmp552lh_fn/T_300.0K/smpl ../.tmp/tmp552lh_fn/T_300.0K/DFSET.dat.raw\n",
"\n",
"Usage: reshape-sample [OPTIONS] DFSET [T]\n",
"Try 'reshape-sample --help' for help.\n",
"\n",
"Error: Invalid value for 'DFSET': Path '../TMP/tmp552lh_fn/T_300.0K/DFSET.dat.raw' does not exist.\n",
"Error: Invalid value for 'DFSET': Path '../.tmp/tmp552lh_fn/T_300.0K/DFSET.dat.raw' does not exist.\n",
"\n",
"<Result SystemExit(2)>\n"
]
Expand Down Expand Up @@ -1043,9 +1043,9 @@
" -V, --version Show the version and exit.\n",
" --help Show this message and exit.\n",
"\n",
"$ plot-stats -n -w 7 -h 4 ../TMP/DFSET_raw.dat 300\n",
"$ plot-stats -n -w 7 -h 4 ../.tmp/DFSET_raw.dat 300\n",
"\n",
"/home/jochym/Projects/hecss_AG/hecss/util.py:96: UserWarning: loadtxt: input contained no data: \"../TMP/DFSET_raw.dat\"\n",
"/home/jochym/Projects/hecss_AG/hecss/util.py:96: UserWarning: loadtxt: input contained no data: \"../.tmp/DFSET_raw.dat\"\n",
" dfset = loadtxt(fn).reshape(N,-1,6)\n",
"\n",
"<Result ValueError('cannot reshape array of size 0 into shape (0,newaxis,6)')>\n"
Expand Down Expand Up @@ -1080,7 +1080,7 @@
"run_cli_cmd(plot_stats, \n",
" \"-n \" \n",
" \"-w 7 -h 4 \"\n",
" \"../TMP/DFSET_raw.dat \"\n",
" \"../.tmp/DFSET_raw.dat \"\n",
" \"300\")"
]
},
Expand Down Expand Up @@ -1134,7 +1134,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"$ plot-stats -n -w 7 -h 4 ../example/VASP_3C-SiC_calculated/2x2x2/T_1200K/DFSET.dat 1200\n",
"$ plot-stats -n -w 7 -h 4 ../examples/VASP_3C-SiC_calculated/2x2x2/T_1200K/DFSET.dat 1200\n",
"\n",
"\n"
]
Expand All @@ -1155,7 +1155,7 @@
"run_cli_cmd(plot_stats, \n",
" \"-n \" \n",
" \"-w 7 -h 4 \"\n",
" \"../example/VASP_3C-SiC_calculated/2x2x2/T_1200K/DFSET.dat \"\n",
" \"../examples/VASP_3C-SiC_calculated/2x2x2/T_1200K/DFSET.dat \"\n",
" \"1200\")"
]
},
Expand Down Expand Up @@ -1253,7 +1253,7 @@
" -V, --version Show the version and exit.\n",
" --help Show this message and exit.\n",
"\n",
"$ plot-bands -w 7 -h 4 -l '300K,600K,3000K' ../example/VASP_3C-SiC_calculated/2x2x2/T_300K/phon/cryst.bands ../example/VASP_3C-SiC_calculated/2x2x2/T_600K/phon/cryst.bands ../example/VASP_3C-SiC_calculated/2x2x2/T_3000K/phon/cryst.bands \n",
"$ plot-bands -w 7 -h 4 -l '300K,600K,3000K' ../examples/VASP_3C-SiC_calculated/2x2x2/T_300K/phon/cryst.bands ../examples/VASP_3C-SiC_calculated/2x2x2/T_600K/phon/cryst.bands ../examples/VASP_3C-SiC_calculated/2x2x2/T_3000K/phon/cryst.bands \n",
"\n",
"\n"
]
Expand All @@ -1274,9 +1274,9 @@
"run_cli_cmd(plot_bands, \"--help\")\n",
"run_cli_cmd(plot_bands, \n",
" \"-w 7 -h 4 -l '300K,600K,3000K' \"\n",
" \"../example/VASP_3C-SiC_calculated/2x2x2/T_300K/phon/cryst.bands \"\n",
" \"../example/VASP_3C-SiC_calculated/2x2x2/T_600K/phon/cryst.bands \"\n",
" \"../example/VASP_3C-SiC_calculated/2x2x2/T_3000K/phon/cryst.bands \")"
" \"../examples/VASP_3C-SiC_calculated/2x2x2/T_300K/phon/cryst.bands \"\n",
" \"../examples/VASP_3C-SiC_calculated/2x2x2/T_600K/phon/cryst.bands \"\n",
" \"../examples/VASP_3C-SiC_calculated/2x2x2/T_3000K/phon/cryst.bands \")"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions nbs/03_monitor_stats.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"source": [
"T = 300\n",
"supercell = '2x2x2'\n",
"plot_stats(load_dfset(f'../example/VASP_3C-SiC_calculated/{supercell}/T_{T:.0f}K/DFSET.dat'), \n",
"plot_stats(load_dfset(f'../examples/VASP_3C-SiC_calculated/{supercell}/T_{T:.0f}K/DFSET.dat'), \n",
" T=T, sqrN=True);"
]
},
Expand Down Expand Up @@ -108,7 +108,7 @@
"T = 600\n",
"supercell = '1x1x1'\n",
"monitor_stats(T=T, \n",
" dfset=f'../example/VASP_3C-SiC_calculated/{supercell}/T_{T:.0f}K/DFSET.dat',\n",
" dfset=f'../examples/VASP_3C-SiC_calculated/{supercell}/T_{T:.0f}K/DFSET.dat',\n",
" once=True # Show the plot and exit\n",
" )"
]
Expand Down Expand Up @@ -146,7 +146,7 @@
"fig, axs = plt.subplots(4,2, figsize=(14,14))\n",
"\n",
"for n, d in enumerate(sorted(\n",
" glob('../example/VASP_3C-SiC_calculated/?x?x?/T_*K'), \n",
" glob('../examples/VASP_3C-SiC_calculated/?x?x?/T_*K'), \n",
" key=lambda s: (s.split('/')[-2],float(s.split('/')[-1][2:-1])))):\n",
" T=float(d.split('/')[-1][2:-1])\n",
" sc = d.split('/')[-2]\n",
Expand Down
4 changes: 2 additions & 2 deletions nbs/04_monitor_phonons.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"for sc, ax in zip(('1x1x1', '2x2x2'), axs):\n",
" plt.sca(ax)\n",
" for T in 300, 600, 1200, 3000:\n",
" plot_bands_file(f'../example/VASP_3C-SiC_calculated/{sc}/T_{T}K/phon/cryst.bands', lbl=f'T={T}K')\n",
" plot_bands_file(f'../examples/VASP_3C-SiC_calculated/{sc}/T_{T}K/phon/cryst.bands', lbl=f'T={T}K')\n",
" plt.legend()\n",
" plt.title(f'Supercell: {sc}');"
]
Expand All @@ -84,7 +84,7 @@
"#| interactive\n",
"T = 3000\n",
"supercell = '2x2x2'\n",
"monitor_phonons(directory=f'../example/VASP_3C-SiC_calculated/{supercell}/phon/', \n",
"monitor_phonons(directory=f'../examples/VASP_3C-SiC_calculated/{supercell}/phon/', \n",
" dfset=f'../T_3000K/DFSET.dat', \n",
" kpath='3C_SiC', charge='3C_SiC', sc=f'../sc/CONTCAR',\n",
" order=1, # Change to 2 if you want to monitor cubic potential\n",
Expand Down
4 changes: 2 additions & 2 deletions nbs/05_vasp_workflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
"source": [
"#|vasp\n",
"# Directory in which our project resides\n",
"base_dir = f'../example/VASP_3C-SiC/{supercell}/'\n",
"calc_dir = TemporaryDirectory(dir='../TMP')"
"base_dir = f'../examples/VASP_3C-SiC/{supercell}/'\n",
"calc_dir = TemporaryDirectory(dir='../.tmp')"
]
},
{
Expand Down
Loading