diff --git a/asap_env.yaml b/asap_env.yaml new file mode 100644 index 0000000..cc79490 --- /dev/null +++ b/asap_env.yaml @@ -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 . diff --git a/nbs/01_VASP_Tutorial.ipynb b/nbs/01_VASP_Tutorial.ipynb index 3c6aed1..6063c43 100644 --- a/nbs/01_VASP_Tutorial.ipynb +++ b/nbs/01_VASP_Tutorial.ipynb @@ -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}/'" ] }, { @@ -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" @@ -214,7 +214,7 @@ "#|vasp\n", "# Space for results\n", "xsl = []\n", - "calc_dir = f'../TMP/calc_{supercell}'" + "calc_dir = f'../.tmp/calc_{supercell}'" ] }, { diff --git a/nbs/02_CLI.ipynb b/nbs/02_CLI.ipynb index 1b31373..a12ab91 100644 --- a/nbs/02_CLI.ipynb +++ b/nbs/02_CLI.ipynb @@ -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')" ] }, { @@ -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", "\n" @@ -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\")" ] }, { @@ -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", "\n" @@ -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\")" ] }, { @@ -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", "\n" ] @@ -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\")" ] }, @@ -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", "\n" @@ -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\")" ] }, { @@ -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", @@ -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", "\n" @@ -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\")" ] }, { @@ -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", "\n" ] @@ -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", "\n" @@ -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\")" ] }, @@ -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" ] @@ -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\")" ] }, @@ -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" ] @@ -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 \")" ] }, { diff --git a/nbs/03_monitor_stats.ipynb b/nbs/03_monitor_stats.ipynb index cbde87f..7a1589f 100644 --- a/nbs/03_monitor_stats.ipynb +++ b/nbs/03_monitor_stats.ipynb @@ -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);" ] }, @@ -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", " )" ] @@ -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", diff --git a/nbs/04_monitor_phonons.ipynb b/nbs/04_monitor_phonons.ipynb index 4ed99c1..c6b2b16 100644 --- a/nbs/04_monitor_phonons.ipynb +++ b/nbs/04_monitor_phonons.ipynb @@ -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}');" ] @@ -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", diff --git a/nbs/05_vasp_workflow.ipynb b/nbs/05_vasp_workflow.ipynb index 4e9981b..f01dff2 100644 --- a/nbs/05_vasp_workflow.ipynb +++ b/nbs/05_vasp_workflow.ipynb @@ -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')" ] }, { diff --git a/nbs/11_parwidth.ipynb b/nbs/11_parwidth.ipynb index 9ea2a03..f0430bd 100644 --- a/nbs/11_parwidth.ipynb +++ b/nbs/11_parwidth.ipynb @@ -324,8 +324,8 @@ "source": [ "#|vasp\n", "# Directory in which our project resides\n", - "base_dir = f'../example/VASP_3C-SiC_calculated/{supercell}/'\n", - "calc_dir = TemporaryDirectory(dir='../TMP')" + "base_dir = f'../examples/VASP_3C-SiC_calculated/{supercell}/'\n", + "calc_dir = TemporaryDirectory(dir='../.tmp')" ] }, { @@ -454,7 +454,7 @@ }, { "ename": "CalculationFailed", - "evalue": "vasp in /home/jochym/Projects/hecss_AG/TMP/tmp3w9yovet/w_est/000 returned an error: 1 stderr Error: /home/jochym/Projects/hecss_AG/nbs/example/scripts/run-calc-ssh.sh is missing or not executable.\n", + "evalue": "vasp in /home/jochym/Projects/hecss_AG/.tmp/tmp3w9yovet/w_est/000 returned an error: 1 stderr Error: /home/jochym/Projects/hecss_AG/../examples/scripts/run-calc-ssh.sh is missing or not executable.\n", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", @@ -471,7 +471,7 @@ "File \u001b[0;32m~/miniconda/envs/hecss-dev/lib/python3.10/site-packages/ase/calculators/abc.py:26\u001b[0m, in \u001b[0;36mGetPropertiesMixin.get_potential_energy\u001b[0;34m(self, atoms, force_consistent)\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 25\u001b[0m name \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124menergy\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m---> 26\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_property\u001b[49m\u001b[43m(\u001b[49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43matoms\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m~/miniconda/envs/hecss-dev/lib/python3.10/site-packages/ase/calculators/calculator.py:519\u001b[0m, in \u001b[0;36mBaseCalculator.get_property\u001b[0;34m(self, name, atoms, allow_calculation)\u001b[0m\n\u001b[1;32m 516\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39muse_cache:\n\u001b[1;32m 517\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39matoms \u001b[38;5;241m=\u001b[39m atoms\u001b[38;5;241m.\u001b[39mcopy()\n\u001b[0;32m--> 519\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcalculate\u001b[49m\u001b[43m(\u001b[49m\u001b[43matoms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[43mname\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msystem_changes\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 521\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m name \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mresults:\n\u001b[1;32m 522\u001b[0m \u001b[38;5;66;03m# For some reason the calculator was not able to do what we want,\u001b[39;00m\n\u001b[1;32m 523\u001b[0m \u001b[38;5;66;03m# and that is OK.\u001b[39;00m\n\u001b[1;32m 524\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m PropertyNotImplementedError(\n\u001b[1;32m 525\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m not present in this \u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcalculation\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mformat(name)\n\u001b[1;32m 526\u001b[0m )\n", "File \u001b[0;32m~/miniconda/envs/hecss-dev/lib/python3.10/site-packages/ase/calculators/vasp/vasp.py:342\u001b[0m, in \u001b[0;36mVasp.calculate\u001b[0;34m(self, atoms, properties, system_changes)\u001b[0m\n\u001b[1;32m 337\u001b[0m errorcode, stderr \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_run(command\u001b[38;5;241m=\u001b[39mcommand,\n\u001b[1;32m 338\u001b[0m out\u001b[38;5;241m=\u001b[39mout,\n\u001b[1;32m 339\u001b[0m directory\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdirectory)\n\u001b[1;32m 341\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m errorcode:\n\u001b[0;32m--> 342\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m calculator\u001b[38;5;241m.\u001b[39mCalculationFailed(\n\u001b[1;32m 343\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m in \u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m returned an error: \u001b[39m\u001b[38;5;132;01m{:d}\u001b[39;00m\u001b[38;5;124m stderr \u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mformat(\n\u001b[1;32m 344\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mname, Path(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdirectory)\u001b[38;5;241m.\u001b[39mresolve(), errorcode,\n\u001b[1;32m 345\u001b[0m stderr))\n\u001b[1;32m 347\u001b[0m \u001b[38;5;66;03m# Read results from calculation\u001b[39;00m\n\u001b[1;32m 348\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mupdate_atoms(atoms)\n", - "\u001b[0;31mCalculationFailed\u001b[0m: vasp in /home/jochym/Projects/hecss_AG/TMP/tmp3w9yovet/w_est/000 returned an error: 1 stderr Error: /home/jochym/Projects/hecss_AG/nbs/example/scripts/run-calc-ssh.sh is missing or not executable.\n" + "\u001b[0;31mCalculationFailed\u001b[0m: vasp in /home/jochym/Projects/hecss_AG/.tmp/tmp3w9yovet/w_est/000 returned an error: 1 stderr Error: /home/jochym/Projects/hecss_AG/../examples/scripts/run-calc-ssh.sh is missing or not executable.\n" ] } ], diff --git a/nbs/15_monitor.ipynb b/nbs/15_monitor.ipynb index 311f2f0..e4ca7df 100644 --- a/nbs/15_monitor.ipynb +++ b/nbs/15_monitor.ipynb @@ -447,7 +447,7 @@ } ], "source": [ - "plot_stats(load_dfset('../example/VASP_3C-SiC_calculated/1x1x1/T_300K/DFSET.dat'), \n", + "plot_stats(load_dfset('../examples/VASP_3C-SiC_calculated/1x1x1/T_300K/DFSET.dat'), \n", " T=300, sqrN=True)" ] }, @@ -505,7 +505,7 @@ ], "source": [ "monitor_stats(T=600, \n", - " dfset='../example/VASP_3C-SiC_calculated/1x1x1/T_600K/DFSET.dat', \n", + " dfset='../examples/VASP_3C-SiC_calculated/1x1x1/T_600K/DFSET.dat', \n", " once=True)" ] }, diff --git a/nbs/16_util.ipynb b/nbs/16_util.ipynb index b0d9f73..484eea5 100644 --- a/nbs/16_util.ipynb +++ b/nbs/16_util.ipynb @@ -227,7 +227,7 @@ ], "source": [ "#| hide\n", - "confs = load_dfset('../example/VASP_3C-SiC_calculated/2x2x2/T_300K/DFSET.dat')\n", + "confs = load_dfset('../examples/VASP_3C-SiC_calculated/2x2x2/T_300K/DFSET.dat')\n", "len(confs)" ] }, @@ -266,12 +266,12 @@ "outputs": [], "source": [ "#| hide\n", - "open('../TMP/dfset_test.dat', 'w').close()\n", + "open('../.tmp/dfset_test.dat', 'w').close()\n", "for s in confs:\n", - " write_dfset('../TMP/dfset_test.dat', s)\n", + " write_dfset('../.tmp/dfset_test.dat', s)\n", "\n", - "assert allclose(loadtxt('../TMP/dfset_test.dat'), \n", - " loadtxt('../example/VASP_3C-SiC_calculated/2x2x2/T_300K/DFSET.dat'))" + "assert allclose(loadtxt('../.tmp/dfset_test.dat'), \n", + " loadtxt('../examples/VASP_3C-SiC_calculated/2x2x2/T_300K/DFSET.dat'))" ] }, { diff --git a/nbs/17_xscale.ipynb b/nbs/17_xscale.ipynb index 3f1ae1c..df489b7 100644 --- a/nbs/17_xscale.ipynb +++ b/nbs/17_xscale.ipynb @@ -338,7 +338,7 @@ "metadata": {}, "outputs": [], "source": [ - "sc = ase.io.read(f'../example/VASP_3C-SiC/{supercell}/sc_{supercell}/vasprun.xml')" + "sc = ase.io.read(f'../examples/VASP_3C-SiC/{supercell}/sc_{supercell}/vasprun.xml')" ] }, { @@ -383,7 +383,7 @@ "vt = []\n", "\n", "# for i, sfn in enumerate(sorted(glob(f'TMP/calc_{supercell}/w_est/*/vasprun.xml'))):\n", - "for i, sfn in enumerate(sorted(glob(f'../example/VASP_3C-SiC_calculated/calc_{supercell}/w_est/*/vasprun.xml'))):\n", + "for i, sfn in enumerate(sorted(glob(f'../examples/VASP_3C-SiC_calculated/calc_{supercell}/w_est/*/vasprun.xml'))):\n", " s = ase.io.read(sfn)\n", " dx = normalize_conf(s, sc)[0] - sc.get_positions()\n", " try :\n", diff --git a/nbs/72_DOF_map.ipynb b/nbs/72_DOF_map.ipynb index f10de3b..f771947 100644 --- a/nbs/72_DOF_map.ipynb +++ b/nbs/72_DOF_map.ipynb @@ -56,7 +56,7 @@ "# cryst = ase.io.read('/home/jochym/cryst/TiO2_hecss/PBE_2x2x4/uc/CONTCAR')\n", "# cryst = ase.io.read('/home/jochym/cryst/TiO2_hecss/PBE_Tetra/uc/CONTCAR')*(2,2,4)\n", "# cryst = ase.io.read('/home/pastukh/Czech.calculation/sc/CONTCAR')\n", - "cryst = ase.io.read('../example/VASP_3C-SiC_calculated/2x2x2/sc/CONTCAR')" + "cryst = ase.io.read('../examples/VASP_3C-SiC_calculated/2x2x2/sc/CONTCAR')" ] }, { diff --git a/nbs/98_ase_smoketest.ipynb b/nbs/98_ase_smoketest.ipynb index 20093e2..e1b9a7f 100644 --- a/nbs/98_ase_smoketest.ipynb +++ b/nbs/98_ase_smoketest.ipynb @@ -25,7 +25,7 @@ "output_type": "stream", "text": [ "Energy: -55.65267549 eV\n", - "Workdir: ../TMP/tmpano7eqne\n" + "Workdir: ../.tmp/tmpano7eqne\n" ] } ], @@ -39,7 +39,7 @@ "from ase.calculators.vasp import Vasp\n", "\n", "# Paths\n", - "source_dir = Path('../TMP/sc').resolve()\n", + "source_dir = Path('../.tmp/sc').resolve()\n", "run_calc = Path('../run-calc.sh').resolve()\n", "\n", "if not source_dir.exists():\n", @@ -48,7 +48,7 @@ " raise FileNotFoundError(f\"Missing run-calc.sh: {run_calc}\")\n", "\n", "# Working directory in TMP\n", - "work_tmp = TemporaryDirectory(dir='../TMP')\n", + "work_tmp = TemporaryDirectory(dir='../.tmp')\n", "workdir = Path(work_tmp.name)\n", "\n", "# Copy required inputs; include local run-calc.conf if present for convenience\n", diff --git a/std_env.yaml b/std_env.yaml new file mode 100644 index 0000000..4dce01f --- /dev/null +++ b/std_env.yaml @@ -0,0 +1,28 @@ +name: std_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 (excluding asap3 and openkim-models) + - alamode + # Development Tools + - nbdev + - jupyterlab + - ipywidgets + - pre-commit + - quarto + - pip: + - -e .