From ec667b5f68554646cdf8ec9c86ae7c983444f15c Mon Sep 17 00:00:00 2001 From: Zhuoyuan <75076820+ZLI-afk@users.noreply.github.com> Date: Wed, 21 Sep 2022 23:22:19 +0800 Subject: [PATCH 01/13] Fix incompatibility of Interstitial.py and Vacancy.py with pymatgen>2022.7.19 --- dpgen/auto_test/Interstitial.py | 21 +++++++++++++-------- dpgen/auto_test/Vacancy.py | 6 ++++-- tests/auto_test/test_interstitial.py | 8 ++++---- tests/auto_test/test_vacancy.py | 4 ++-- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/dpgen/auto_test/Interstitial.py b/dpgen/auto_test/Interstitial.py index b621e54b3..3013ff744 100644 --- a/dpgen/auto_test/Interstitial.py +++ b/dpgen/auto_test/Interstitial.py @@ -2,6 +2,7 @@ import json import os import re +import numpy as np from monty.serialization import loadfn, dumpfn from pymatgen.analysis.defects.generators import InterstitialGenerator @@ -147,9 +148,10 @@ def make_confs(self, os.remove(insert_element_task) for ii in self.insert_ele: - vds = InterstitialGenerator(ss, ii) + pre_vds = InterstitialGenerator() + vds = pre_vds.generate(ss, {self.insert_ele[0]: [[0, 0.2, 0.5]]}) for jj in vds: - temp = jj.generate_defect_structure(self.supercell) + temp = jj.get_supercell_structure(sc_mat=np.eye(3) * self.supercell) smallest_distance = list(set(temp.distance_matrix.ravel()))[1] if 'conf_filters' in self.parameter and 'min_dist' in self.parameter['conf_filters']: min_dist = self.parameter['conf_filters']['min_dist'] @@ -188,6 +190,9 @@ def make_confs(self, if 'bcc_self' in self.parameter and self.parameter['bcc_self']: + super_size = self.supercell[0] * self.supercell[1] * self.supercell[2] + num_atom = super_size * 2 + chl = -num_atom - 2 os.chdir(path_to_work) with open('POSCAR', 'r') as fin: fin.readline() @@ -210,7 +215,7 @@ def make_confs(self, with open(insert_element_task, 'a+') as fout: print(self.insert_ele[0], file=fout) dumpfn(self.supercell, 'supercell.json') - pos_line[-2] = '%.6f' % float(latt_param/4/super_latt_param) + ' ' + '%.6f' % float(latt_param/2/super_latt_param) + ' 0.000000 ' + self.insert_ele[0] + pos_line[chl] = '%.6f' % float(latt_param/4/super_latt_param) + ' ' + '%.6f' % float(latt_param/2/super_latt_param) + ' 0.000000 ' + self.insert_ele[0] with open('POSCAR', 'w+') as fout: for ii in pos_line: print(ii, file=fout) @@ -224,7 +229,7 @@ def make_confs(self, with open(insert_element_task, 'a+') as fout: print(self.insert_ele[0], file=fout) dumpfn(self.supercell, 'supercell.json') - pos_line[-2] = '%.6f' % float(latt_param/2/super_latt_param) + ' ' + '%.6f' % float(latt_param/2/super_latt_param) + ' 0.000000 ' + self.insert_ele[0] + pos_line[chl] = '%.6f' % float(latt_param/2/super_latt_param) + ' ' + '%.6f' % float(latt_param/2/super_latt_param) + ' 0.000000 ' + self.insert_ele[0] with open('POSCAR', 'w+') as fout: for ii in pos_line: print(ii, file=fout) @@ -238,7 +243,7 @@ def make_confs(self, with open(insert_element_task, 'a+') as fout: print(self.insert_ele[0], file=fout) dumpfn(self.supercell, 'supercell.json') - pos_line[-2] = '%.6f' % float(latt_param/4/super_latt_param) + ' ' + '%.6f' % float(latt_param/4/super_latt_param) + ' ' + '%.6f' % float(latt_param/4/super_latt_param) + ' ' + self.insert_ele[0] + pos_line[chl] = '%.6f' % float(latt_param/4/super_latt_param) + ' ' + '%.6f' % float(latt_param/4/super_latt_param) + ' ' + '%.6f' % float(latt_param/4/super_latt_param) + ' ' + self.insert_ele[0] with open('POSCAR', 'w+') as fout: for ii in pos_line: print(ii, file=fout) @@ -258,7 +263,7 @@ def make_confs(self, with open(insert_element_task, 'a+') as fout: print(self.insert_ele[0], file=fout) dumpfn(self.supercell, 'supercell.json') - pos_line[-2] = '%.6f' % float(latt_param/3/super_latt_param) + ' ' + '%.6f' % float(latt_param/3/super_latt_param) + ' ' + '%.6f' % float(latt_param/3/super_latt_param) + ' ' + self.insert_ele[0] + pos_line[chl] = '%.6f' % float(latt_param/3/super_latt_param) + ' ' + '%.6f' % float(latt_param/3/super_latt_param) + ' ' + '%.6f' % float(latt_param/3/super_latt_param) + ' ' + self.insert_ele[0] pos_line[replace_label] = '%.6f' % float(latt_param/3*2/super_latt_param) + ' ' + '%.6f' % float(latt_param/3*2/super_latt_param) + ' ' + '%.6f' % float(latt_param/3*2/super_latt_param) + ' ' + self.insert_ele[0] with open('POSCAR', 'w+') as fout: @@ -274,7 +279,7 @@ def make_confs(self, with open(insert_element_task, 'a+') as fout: print(self.insert_ele[0], file=fout) dumpfn(self.supercell, 'supercell.json') - pos_line[-2] = '%.6f' % float((latt_param+2.1/2**0.5)/2/super_latt_param) + ' ' + '%.6f' % float((latt_param-2.1/2**0.5)/2/super_latt_param) + ' ' + '%.6f' % float(latt_param/2/super_latt_param) + ' ' + self.insert_ele[0] + pos_line[chl] = '%.6f' % float((latt_param+2.1/2**0.5)/2/super_latt_param) + ' ' + '%.6f' % float((latt_param-2.1/2**0.5)/2/super_latt_param) + ' ' + '%.6f' % float(latt_param/2/super_latt_param) + ' ' + self.insert_ele[0] pos_line[replace_label] = '%.6f' % float((latt_param-2.1/2**0.5)/2/super_latt_param) + ' ' + '%.6f' % float((latt_param+2.1/2**0.5)/2/super_latt_param) + ' ' + '%.6f' % float(latt_param/2/super_latt_param) + ' ' + self.insert_ele[0] with open('POSCAR', 'w+') as fout: @@ -290,7 +295,7 @@ def make_confs(self, with open(insert_element_task, 'a+') as fout: print(self.insert_ele[0], file=fout) dumpfn(self.supercell, 'supercell.json') - pos_line[-2] = '%.6f' % float(latt_param/2/super_latt_param) + ' ' + '%.6f' % float(latt_param/2/super_latt_param) + ' ' + '%.6f' % float((latt_param-2.1)/2/super_latt_param) + ' ' + self.insert_ele[0] + pos_line[chl] = '%.6f' % float(latt_param/2/super_latt_param) + ' ' + '%.6f' % float(latt_param/2/super_latt_param) + ' ' + '%.6f' % float((latt_param-2.1)/2/super_latt_param) + ' ' + self.insert_ele[0] pos_line[replace_label] = '%.6f' % float(latt_param/2/super_latt_param) + ' ' + '%.6f' % float(latt_param/2/super_latt_param) + ' ' + '%.6f' % float((latt_param+2.1)/2/super_latt_param) + ' ' + self.insert_ele[0] with open('POSCAR', 'w+') as fout: diff --git a/dpgen/auto_test/Vacancy.py b/dpgen/auto_test/Vacancy.py index f161f93be..bf686bbe1 100644 --- a/dpgen/auto_test/Vacancy.py +++ b/dpgen/auto_test/Vacancy.py @@ -2,6 +2,7 @@ import json import os import re +import numpy as np from monty.serialization import loadfn, dumpfn from pymatgen.analysis.defects.generators import VacancyGenerator @@ -134,10 +135,11 @@ def make_confs(self, else: ss = Structure.from_file(equi_contcar) - vds = VacancyGenerator(ss) + pre_vds = VacancyGenerator() + vds = pre_vds.generate(ss) dss = [] for jj in vds: - dss.append(jj.generate_defect_structure(self.supercell)) + dss.append(jj.get_supercell_structure(sc_mat=np.eye(3)*self.supercell)) print('gen vacancy with supercell ' + str(self.supercell)) os.chdir(path_to_work) diff --git a/tests/auto_test/test_interstitial.py b/tests/auto_test/test_interstitial.py index dc1652535..6d646e3de 100644 --- a/tests/auto_test/test_interstitial.py +++ b/tests/auto_test/test_interstitial.py @@ -85,16 +85,16 @@ def test_make_confs_bcc(self): st_file = os.path.join(ii, 'POSCAR') self.assertTrue(os.path.isfile(st_file)) st0 = Structure.from_file(st_file) - inter_site = st0[-1] - inter = pmg_Interstitial(ref_st, inter_site, charge=0.0) - st1 = inter.generate_defect_structure(self.prop_param[0]['supercell']) + inter_site = st0[0] + inter = pmg_Interstitial(ref_st, inter_site) + st1 = inter.get_supercell_structure(sc_mat=np.eye(3)*self.prop_param[0]['supercell']) self.assertEqual(st0, st1) for ii in dfm_dirs[4:]: st_file = os.path.join(ii, 'POSCAR') self.assertTrue(os.path.isfile(st_file)) st0 = Structure.from_file(st_file) - inter_site1 = st0.pop(-1) + inter_site1 = st0.pop(0) inter_site2 = st0.pop(-1) center = (inter_site1.coords + inter_site2.coords) / 2 self.assertTrue((center[0] - center[1]) < 1e-4) diff --git a/tests/auto_test/test_vacancy.py b/tests/auto_test/test_vacancy.py index fa8894ed6..f76626f88 100644 --- a/tests/auto_test/test_vacancy.py +++ b/tests/auto_test/test_vacancy.py @@ -85,6 +85,6 @@ def test_make_confs_0(self): self.assertTrue(os.path.isfile(st_file)) st0 = Structure.from_file(st_file) vac_site = equiv_site_seq.pop(0) - vac = pmg_Vacancy(ref_st, vac_site[0], charge=0.0) - st1 = vac.generate_defect_structure(self.prop_param[0]['supercell']) + vac = pmg_Vacancy(ref_st, vac_site[0]) + st1 = vac.get_supercell_structure(sc_mat=np.eye(3)*self.prop_param[0]['supercell']) self.assertEqual(st0, st1) From 9f45b4e3441ccbbeb58b10f2d4d14330ab3589e1 Mon Sep 17 00:00:00 2001 From: Zhuoyuan <75076820+ZLI-afk@users.noreply.github.com> Date: Wed, 21 Sep 2022 23:35:26 +0800 Subject: [PATCH 02/13] add pymatgen-analysis-defect and pybind11 in setup.py. add reminder for user to install pymatgen-analysis-defect if this package is not in their environment. --- dpgen/auto_test/Interstitial.py | 7 +++++++ dpgen/auto_test/Vacancy.py | 8 +++++++- setup.py | 2 ++ tests/auto_test/test_interstitial.py | 8 +++++++- tests/auto_test/test_vacancy.py | 7 +++++++ 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/dpgen/auto_test/Interstitial.py b/dpgen/auto_test/Interstitial.py index 3013ff744..497c1b174 100644 --- a/dpgen/auto_test/Interstitial.py +++ b/dpgen/auto_test/Interstitial.py @@ -6,6 +6,13 @@ from monty.serialization import loadfn, dumpfn from pymatgen.analysis.defects.generators import InterstitialGenerator +try: + from pymatgen.analysis.defects.generators import InterstitialGenerator +except ModuleNotFoundError: + print("pymatgen==2022.7.19 is the final release with `pymatgen.analysis.defects` module. Please check the version of pymatgen.") + print("Please install `pymatgen-analysis-defects`.") + print("Kindly reminder: `pybind11>=2.4` need to be installed previously.") + os._exit(0) from pymatgen.core.structure import Structure import dpgen.auto_test.lib.lammps as lammps diff --git a/dpgen/auto_test/Vacancy.py b/dpgen/auto_test/Vacancy.py index bf686bbe1..2690bb55f 100644 --- a/dpgen/auto_test/Vacancy.py +++ b/dpgen/auto_test/Vacancy.py @@ -5,7 +5,13 @@ import numpy as np from monty.serialization import loadfn, dumpfn -from pymatgen.analysis.defects.generators import VacancyGenerator +try: + from pymatgen.analysis.defects.generators import VacancyGenerator +except ModuleNotFoundError: + print("pymatgen==2022.7.19 is the final release with `pymatgen.analysis.defects` module. Please check the version of pymatgen.") + print("Please install `pymatgen-analysis-defects`.") + print("Kindly reminder: `pybind11>=2.4` need to be installed previously.") + os._exit(0) from pymatgen.core.structure import Structure from dpgen import dlog diff --git a/setup.py b/setup.py index f8490ed20..91dbbf96c 100755 --- a/setup.py +++ b/setup.py @@ -29,6 +29,8 @@ 'dpdispatcher>=0.3.11', 'netCDF4', 'dargs>=0.2.9', + 'pybind11>=2.4', + 'pymatgen-analysis-defects' ] setuptools.setup( diff --git a/tests/auto_test/test_interstitial.py b/tests/auto_test/test_interstitial.py index 6d646e3de..2de7016f4 100644 --- a/tests/auto_test/test_interstitial.py +++ b/tests/auto_test/test_interstitial.py @@ -7,7 +7,13 @@ from pymatgen.core import Structure from pymatgen.io.vasp import Incar from pymatgen.symmetry.analyzer import SpacegroupAnalyzer -from pymatgen.analysis.defects.core import Interstitial as pmg_Interstitial +try: + from pymatgen.analysis.defects.core import Interstitial as pmg_Interstitial +except ModuleNotFoundError: + print("pymatgen==2022.7.19 is the final release with `pymatgen.analysis.defects` module. Please check the version of pymatgen.") + print("Please install `pymatgen-analysis-defects`.") + print("Kindly reminder: `pybind11>=2.4` need to be installed previously.") + os._exit(0) sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) __package__ = 'auto_test' diff --git a/tests/auto_test/test_vacancy.py b/tests/auto_test/test_vacancy.py index f76626f88..93c833c2b 100644 --- a/tests/auto_test/test_vacancy.py +++ b/tests/auto_test/test_vacancy.py @@ -8,6 +8,13 @@ from pymatgen.io.vasp import Incar from pymatgen.symmetry.analyzer import SpacegroupAnalyzer from pymatgen.analysis.defects.core import Vacancy as pmg_Vacancy +try: + from pymatgen.analysis.defects.core import Vacancy as pmg_Vacancy +except ModuleNotFoundError: + print("pymatgen==2022.7.19 is the final release with `pymatgen.analysis.defects` module. Please check the version of pymatgen.") + print("Please install `pymatgen-analysis-defects`.") + print("Kindly reminder: `pybind11>=2.4` need to be installed previously.") + os._exit(0) sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) __package__ = 'auto_test' From 5bb3eb3f70d639cfb1ff998f9ec513b13d941366 Mon Sep 17 00:00:00 2001 From: Zhuoyuan <75076820+ZLI-afk@users.noreply.github.com> Date: Thu, 22 Sep 2022 09:49:48 +0800 Subject: [PATCH 03/13] revise pymatgen_version in test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index becafd6d3..83907c751 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: python-version: [3.7, 3.8] - PYMATGEN_VERSION: [2019.1.13, 2019.7.30] + PYMATGEN_VERSION: [2022.7.19] steps: - uses: actions/checkout@v2 From ff33232403a8a67ff445cf8f422b7d471e7fac82 Mon Sep 17 00:00:00 2001 From: Zhuoyuan <75076820+ZLI-afk@users.noreply.github.com> Date: Thu, 22 Sep 2022 10:03:56 +0800 Subject: [PATCH 04/13] revise pymatgen_version in test.yml --- .github/workflows/test.yml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83907c751..f98dff4da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8] + python-version: [3.8, 3.9] PYMATGEN_VERSION: [2022.7.19] steps: diff --git a/setup.py b/setup.py index 91dbbf96c..382645f35 100755 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ install_requires=[ 'numpy>=1.14.3', 'dpdata>=0.2.6', - 'pymatgen>=2019.1.13', + 'pymatgen>=2022.7.19', 'ase', 'monty>2.0.0', 'paramiko', From 371eeb362b4b78320f4e309e586f1174c92a0c70 Mon Sep 17 00:00:00 2001 From: Zhuoyuan <75076820+ZLI-afk@users.noreply.github.com> Date: Thu, 22 Sep 2022 11:51:11 +0800 Subject: [PATCH 05/13] revise duplicate import --- dpgen/auto_test/Interstitial.py | 7 ------- dpgen/auto_test/Vacancy.py | 8 +------- tests/auto_test/test_interstitial.py | 8 +------- tests/auto_test/test_vacancy.py | 7 ------- 4 files changed, 2 insertions(+), 28 deletions(-) diff --git a/dpgen/auto_test/Interstitial.py b/dpgen/auto_test/Interstitial.py index 497c1b174..3013ff744 100644 --- a/dpgen/auto_test/Interstitial.py +++ b/dpgen/auto_test/Interstitial.py @@ -6,13 +6,6 @@ from monty.serialization import loadfn, dumpfn from pymatgen.analysis.defects.generators import InterstitialGenerator -try: - from pymatgen.analysis.defects.generators import InterstitialGenerator -except ModuleNotFoundError: - print("pymatgen==2022.7.19 is the final release with `pymatgen.analysis.defects` module. Please check the version of pymatgen.") - print("Please install `pymatgen-analysis-defects`.") - print("Kindly reminder: `pybind11>=2.4` need to be installed previously.") - os._exit(0) from pymatgen.core.structure import Structure import dpgen.auto_test.lib.lammps as lammps diff --git a/dpgen/auto_test/Vacancy.py b/dpgen/auto_test/Vacancy.py index 2690bb55f..bf686bbe1 100644 --- a/dpgen/auto_test/Vacancy.py +++ b/dpgen/auto_test/Vacancy.py @@ -5,13 +5,7 @@ import numpy as np from monty.serialization import loadfn, dumpfn -try: - from pymatgen.analysis.defects.generators import VacancyGenerator -except ModuleNotFoundError: - print("pymatgen==2022.7.19 is the final release with `pymatgen.analysis.defects` module. Please check the version of pymatgen.") - print("Please install `pymatgen-analysis-defects`.") - print("Kindly reminder: `pybind11>=2.4` need to be installed previously.") - os._exit(0) +from pymatgen.analysis.defects.generators import VacancyGenerator from pymatgen.core.structure import Structure from dpgen import dlog diff --git a/tests/auto_test/test_interstitial.py b/tests/auto_test/test_interstitial.py index 2de7016f4..6d646e3de 100644 --- a/tests/auto_test/test_interstitial.py +++ b/tests/auto_test/test_interstitial.py @@ -7,13 +7,7 @@ from pymatgen.core import Structure from pymatgen.io.vasp import Incar from pymatgen.symmetry.analyzer import SpacegroupAnalyzer -try: - from pymatgen.analysis.defects.core import Interstitial as pmg_Interstitial -except ModuleNotFoundError: - print("pymatgen==2022.7.19 is the final release with `pymatgen.analysis.defects` module. Please check the version of pymatgen.") - print("Please install `pymatgen-analysis-defects`.") - print("Kindly reminder: `pybind11>=2.4` need to be installed previously.") - os._exit(0) +from pymatgen.analysis.defects.core import Interstitial as pmg_Interstitial sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) __package__ = 'auto_test' diff --git a/tests/auto_test/test_vacancy.py b/tests/auto_test/test_vacancy.py index 93c833c2b..f76626f88 100644 --- a/tests/auto_test/test_vacancy.py +++ b/tests/auto_test/test_vacancy.py @@ -8,13 +8,6 @@ from pymatgen.io.vasp import Incar from pymatgen.symmetry.analyzer import SpacegroupAnalyzer from pymatgen.analysis.defects.core import Vacancy as pmg_Vacancy -try: - from pymatgen.analysis.defects.core import Vacancy as pmg_Vacancy -except ModuleNotFoundError: - print("pymatgen==2022.7.19 is the final release with `pymatgen.analysis.defects` module. Please check the version of pymatgen.") - print("Please install `pymatgen-analysis-defects`.") - print("Kindly reminder: `pybind11>=2.4` need to be installed previously.") - os._exit(0) sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) __package__ = 'auto_test' From e1c94112a75b4b8c2b97e244247ab9b5d3553b2e Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 26 Sep 2022 14:03:54 -0400 Subject: [PATCH 06/13] add .readthedocs.yaml --- .readthedocs.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 000000000..d56afbed6 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,24 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.10" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# If using Sphinx, optionally build your docs in additional formats such as PDF +formats: all + +# Optionally declare the Python requirements required to build your docs +python: + install: + - requirements: docs/requirements.txt From cea5985d6e2e3f335d6387b7823c300c38d34355 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 26 Sep 2022 14:05:05 -0400 Subject: [PATCH 07/13] fix docs path --- .readthedocs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d56afbed6..46c022414 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -13,7 +13,7 @@ build: # Build documentation in the docs/ directory with Sphinx sphinx: - configuration: docs/conf.py + configuration: doc/conf.py # If using Sphinx, optionally build your docs in additional formats such as PDF formats: all @@ -21,4 +21,4 @@ formats: all # Optionally declare the Python requirements required to build your docs python: install: - - requirements: docs/requirements.txt + - requirements: doc/requirements.txt From 41d2530857489ff6df52ae5cca904bb6d214f422 Mon Sep 17 00:00:00 2001 From: Zhuoyuan <75076820+ZLI-afk@users.noreply.github.com> Date: Wed, 28 Sep 2022 02:13:37 +0800 Subject: [PATCH 08/13] Update setup.py delete pybind11 from setup.py --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 382645f35..4c73d598e 100755 --- a/setup.py +++ b/setup.py @@ -29,7 +29,6 @@ 'dpdispatcher>=0.3.11', 'netCDF4', 'dargs>=0.2.9', - 'pybind11>=2.4', 'pymatgen-analysis-defects' ] From 00694fb0b7b2ca0dee97c02ec29a5a7195aa1bb8 Mon Sep 17 00:00:00 2001 From: Zhuoyuan <75076820+ZLI-afk@users.noreply.github.com> Date: Wed, 28 Sep 2022 02:17:28 +0800 Subject: [PATCH 09/13] Update Interstitial.py --- dpgen/auto_test/Interstitial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpgen/auto_test/Interstitial.py b/dpgen/auto_test/Interstitial.py index 3013ff744..3dd9ec4df 100644 --- a/dpgen/auto_test/Interstitial.py +++ b/dpgen/auto_test/Interstitial.py @@ -151,7 +151,7 @@ def make_confs(self, pre_vds = InterstitialGenerator() vds = pre_vds.generate(ss, {self.insert_ele[0]: [[0, 0.2, 0.5]]}) for jj in vds: - temp = jj.get_supercell_structure(sc_mat=np.eye(3) * self.supercell) + temp = jj.get_supercell_structure(sc_mat=np.diag(self.supercell, k=0)) smallest_distance = list(set(temp.distance_matrix.ravel()))[1] if 'conf_filters' in self.parameter and 'min_dist' in self.parameter['conf_filters']: min_dist = self.parameter['conf_filters']['min_dist'] From cdbad263b77cf40c62faea39b809e43e7c1e9a4d Mon Sep 17 00:00:00 2001 From: Zhuoyuan <75076820+ZLI-afk@users.noreply.github.com> Date: Wed, 28 Sep 2022 02:18:14 +0800 Subject: [PATCH 10/13] Update Vacancy.py --- dpgen/auto_test/Vacancy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpgen/auto_test/Vacancy.py b/dpgen/auto_test/Vacancy.py index bf686bbe1..107c8af11 100644 --- a/dpgen/auto_test/Vacancy.py +++ b/dpgen/auto_test/Vacancy.py @@ -139,7 +139,7 @@ def make_confs(self, vds = pre_vds.generate(ss) dss = [] for jj in vds: - dss.append(jj.get_supercell_structure(sc_mat=np.eye(3)*self.supercell)) + dss.append(jj.get_supercell_structure(sc_mat=np.diag(self.supercell, k=0)) print('gen vacancy with supercell ' + str(self.supercell)) os.chdir(path_to_work) From 753862ad19f468bb03ab56b14d9025f410a84f38 Mon Sep 17 00:00:00 2001 From: Zhuoyuan <75076820+ZLI-afk@users.noreply.github.com> Date: Wed, 28 Sep 2022 21:39:25 +0800 Subject: [PATCH 11/13] Fix SyntaxError in vacancy.py --- dpgen/auto_test/Vacancy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpgen/auto_test/Vacancy.py b/dpgen/auto_test/Vacancy.py index 107c8af11..a7a3cbfd4 100644 --- a/dpgen/auto_test/Vacancy.py +++ b/dpgen/auto_test/Vacancy.py @@ -139,7 +139,7 @@ def make_confs(self, vds = pre_vds.generate(ss) dss = [] for jj in vds: - dss.append(jj.get_supercell_structure(sc_mat=np.diag(self.supercell, k=0)) + dss.append(jj.get_supercell_structure(sc_mat=np.diag(self.supercell, k=0))) print('gen vacancy with supercell ' + str(self.supercell)) os.chdir(path_to_work) From 418a846eaf46a8bf8219ab548536427f1e83080f Mon Sep 17 00:00:00 2001 From: Zhuoyuan <75076820+ZLI-afk@users.noreply.github.com> Date: Thu, 29 Sep 2022 15:27:05 +0800 Subject: [PATCH 12/13] Update Vacancy.py --- dpgen/auto_test/Vacancy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpgen/auto_test/Vacancy.py b/dpgen/auto_test/Vacancy.py index a7a3cbfd4..ddce3117b 100644 --- a/dpgen/auto_test/Vacancy.py +++ b/dpgen/auto_test/Vacancy.py @@ -139,7 +139,7 @@ def make_confs(self, vds = pre_vds.generate(ss) dss = [] for jj in vds: - dss.append(jj.get_supercell_structure(sc_mat=np.diag(self.supercell, k=0))) + dss.append(jj.get_supercell_structure(sc_mat=np.diag(self.supercell, k=0))) print('gen vacancy with supercell ' + str(self.supercell)) os.chdir(path_to_work) From 81d369087e0b74bfe9e9cfdfdd02bac81cbfd8cb Mon Sep 17 00:00:00 2001 From: Zhuoyuan <75076820+ZLI-afk@users.noreply.github.com> Date: Fri, 30 Sep 2022 15:53:24 +0800 Subject: [PATCH 13/13] revise inputs of interstitial generator --- dpgen/auto_test/Interstitial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpgen/auto_test/Interstitial.py b/dpgen/auto_test/Interstitial.py index 3dd9ec4df..70560418c 100644 --- a/dpgen/auto_test/Interstitial.py +++ b/dpgen/auto_test/Interstitial.py @@ -149,7 +149,7 @@ def make_confs(self, for ii in self.insert_ele: pre_vds = InterstitialGenerator() - vds = pre_vds.generate(ss, {self.insert_ele[0]: [[0, 0.2, 0.5]]}) + vds = pre_vds.generate(ss, {ii: [[0.1,0.1,0.1]]}) for jj in vds: temp = jj.get_supercell_structure(sc_mat=np.diag(self.supercell, k=0)) smallest_distance = list(set(temp.distance_matrix.ravel()))[1]