ion-CSP 2.2.1__py3-none-any.whl → 2.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ion_CSP/__init__.py +2 -2
- ion_CSP/gen_opt.py +6 -6
- ion_CSP/mlp_opt.py +2 -6
- ion_CSP/read_mlp_density.py +5 -1
- ion_CSP/task_manager.py +1 -1
- {ion_csp-2.2.1.dist-info → ion_csp-2.2.3.dist-info}/METADATA +1 -1
- {ion_csp-2.2.1.dist-info → ion_csp-2.2.3.dist-info}/RECORD +11 -11
- {ion_csp-2.2.1.dist-info → ion_csp-2.2.3.dist-info}/WHEEL +0 -0
- {ion_csp-2.2.1.dist-info → ion_csp-2.2.3.dist-info}/entry_points.txt +0 -0
- {ion_csp-2.2.1.dist-info → ion_csp-2.2.3.dist-info}/licenses/LICENSE +0 -0
- {ion_csp-2.2.1.dist-info → ion_csp-2.2.3.dist-info}/top_level.txt +0 -0
ion_CSP/__init__.py
CHANGED
ion_CSP/gen_opt.py
CHANGED
@@ -116,9 +116,8 @@ class CrystalGenerator:
|
|
116
116
|
pyxtal_structure.to_file(POSCAR_path, fmt="poscar")
|
117
117
|
total_count += 1
|
118
118
|
group_count += 1
|
119
|
+
# 捕获对于某一空间群生成结构的运行时间过长、组成兼容性错误、对称性兼容性错误等异常,使结构生成能够完全进行而不中断
|
119
120
|
except (RuntimeError, Comp_CompatibilityError, Symm_CompatibilityError) as e:
|
120
|
-
# 捕获对于某一空间群生成结构的运行时间过长、组成兼容性错误、对称性兼容性错误等异常,使结构生成能够完全进行而不中断
|
121
|
-
logging.error(f"Generating structure error: {e}")
|
122
121
|
# 记录异常类型并跳出当前空间群的生成循环
|
123
122
|
exception_message = type(e).__name__
|
124
123
|
break
|
@@ -154,7 +153,11 @@ class CrystalGenerator:
|
|
154
153
|
# 按顺序处理POSCAR文件,首先复制一份无数字后缀的POSCAR文件
|
155
154
|
shutil.copy(f"{self.POSCAR_dir}/{filename}", f"{self.POSCAR_dir}/POSCAR")
|
156
155
|
try:
|
157
|
-
subprocess.run(
|
156
|
+
subprocess.run(
|
157
|
+
["nohup", "phonopy", "--symmetry", "POSCAR"],
|
158
|
+
check=True,
|
159
|
+
stdout=subprocess.DEVNULL
|
160
|
+
)
|
158
161
|
except subprocess.CalledProcessError as e:
|
159
162
|
# 新增:捕获phonopy执行错误
|
160
163
|
logging.error(f"Phonopy execution failed for {filename}: {str(e)}")
|
@@ -168,9 +171,6 @@ class CrystalGenerator:
|
|
168
171
|
|
169
172
|
# 检查生成的POSCAR中的原子数,如果不匹配则删除该POSCAR并在日志中记录
|
170
173
|
if cell_atoms != self.cell_atoms:
|
171
|
-
error_message = f"Atom number mismatch ({cell_atoms} vs {self.cell_atoms})"
|
172
|
-
print(f"{filename} - {error_message}")
|
173
|
-
|
174
174
|
# 新增:回溯空间群归属
|
175
175
|
poscar_index = int(filename.split('_')[1]) # 提取POSCAR编号
|
176
176
|
space_group = self._find_space_group(poscar_index)
|
ion_CSP/mlp_opt.py
CHANGED
@@ -10,17 +10,14 @@ import numpy as np
|
|
10
10
|
import multiprocessing
|
11
11
|
from ase.io.vasp import read_vasp
|
12
12
|
from ase.optimize import LBFGS
|
13
|
-
|
14
|
-
from ase.filters import ExpCellFilter
|
13
|
+
from ase.constraints import UnitCellFilter
|
15
14
|
from deepmd.calculator import DP
|
16
|
-
# from mattersim.forcefield import MatterSimCalculator
|
17
15
|
|
18
16
|
# 根据脚本位置确定model.pt文件的位置, 减少错误发生
|
19
17
|
base_dir = os.path.dirname(__file__)
|
20
18
|
relative_path = './model.pt'
|
21
19
|
file_path = os.path.join(base_dir, relative_path)
|
22
20
|
calc = DP(file_path)
|
23
|
-
# calc = MatterSimCalculator(device="cuda")
|
24
21
|
|
25
22
|
|
26
23
|
def get_element_num(elements):
|
@@ -162,8 +159,7 @@ def run_opt(index: int):
|
|
162
159
|
aim_stress = 1.0 * pstress * 0.01 * 0.6242 / 10.0
|
163
160
|
atoms = read_vasp('POSCAR_'+str(index))
|
164
161
|
atoms.calc = calc
|
165
|
-
|
166
|
-
ucf = ExpCellFilter(atoms, scalar_pressure=aim_stress)
|
162
|
+
ucf = UnitCellFilter(atoms, scalar_pressure=aim_stress)
|
167
163
|
# optimization
|
168
164
|
opt = LBFGS(ucf)
|
169
165
|
opt.run(fmax=fmax,steps=Opt_Step)
|
ion_CSP/read_mlp_density.py
CHANGED
@@ -174,7 +174,11 @@ class ReadMlpDensity:
|
|
174
174
|
# 使用phonopy模块处理POSCAR结构文件,获取对称化的原胞和常规胞。
|
175
175
|
# 应用晶体的对称操作优化后的原胞可以最好地符合晶体的对称性,减少后续优化计算的复杂性。
|
176
176
|
log.write(f'\nProcessing file: {new_CONTCAR_filename}\n')
|
177
|
-
result = subprocess.run(
|
177
|
+
result = subprocess.run(
|
178
|
+
["nohup", "phonopy", "--symmetry", "POSCAR"],
|
179
|
+
check=True,
|
180
|
+
stdout=subprocess.DEVNULL
|
181
|
+
)
|
178
182
|
log.write(f'Finished processing file: {new_CONTCAR_filename} with return code: {result.returncode}\n')
|
179
183
|
# 将phonopy生成的PPOSCAR(对称化原胞)和BPOSCAR(对称化常规胞)放到对应的文件夹中,并将文件名改回POSCAR_index
|
180
184
|
shutil.move(f'{self.phonopy_dir}/PPOSCAR', f'{self.primitive_cell_dir}/{new_CONTCAR_filename}')
|
ion_CSP/task_manager.py
CHANGED
@@ -264,7 +264,7 @@ class TaskManager:
|
|
264
264
|
std_log.symlink_to(output_log)
|
265
265
|
|
266
266
|
print('Starting task ......')
|
267
|
-
time.sleep(
|
267
|
+
time.sleep(3)
|
268
268
|
logging.info(f"Started {module} module (PID: {process.pid})")
|
269
269
|
print(f"Task started (PID: {process.pid})")
|
270
270
|
print(f"Normalized log file: {std_log}")
|
@@ -1,14 +1,14 @@
|
|
1
|
-
ion_CSP/__init__.py,sha256=
|
1
|
+
ion_CSP/__init__.py,sha256=jMZJMwgE30wGC-Ej_2ghlbE9UnLRCcLb0W-3kQ4mVnM,356
|
2
2
|
ion_CSP/__main__.py,sha256=XlNCx5eMSrL7yld9ddSYXhjXvg2ZYGD_uk9LdqNabvs,74
|
3
3
|
ion_CSP/convert_SMILES.py,sha256=i_f9cbCAr6SpZUvClZRAPGjK-_v9U9lFGA-06i041Tk,15755
|
4
4
|
ion_CSP/empirical_estimate.py,sha256=aSidH3jyoG39ky-kDNUY0ix8hPefeVVWmPABVjTmy0g,37866
|
5
|
-
ion_CSP/gen_opt.py,sha256=
|
5
|
+
ion_CSP/gen_opt.py,sha256=EEMIPZ7oEOR9iGLRL-eJleHaWBiOK90o4a8_go9f-9o,21468
|
6
6
|
ion_CSP/identify_molecules.py,sha256=GxDWq815Bk_Fq_SR8fe-dbrbEi1YgATVa7UINw3hAu4,5535
|
7
7
|
ion_CSP/log_and_time.py,sha256=Db53LAM2KH_ty6M9_5FF8xDGiULgExh7pcKOvFtS7DQ,11697
|
8
|
-
ion_CSP/mlp_opt.py,sha256=
|
9
|
-
ion_CSP/read_mlp_density.py,sha256=
|
8
|
+
ion_CSP/mlp_opt.py,sha256=DP8gldX07O2jXDhopUOodh8nqa5JeusLJjChTtt_DSE,7049
|
9
|
+
ion_CSP/read_mlp_density.py,sha256=0fymqrpqoAmWosnyoNwH3GAvml42skZp_6SLvrXN0SI,12232
|
10
10
|
ion_CSP/steps_opt_monitor.sh,sha256=1klPjnK0gqkDbvI9PtjdK5qidJ5G0Mo8q1SfrlLW5xM,3330
|
11
|
-
ion_CSP/task_manager.py,sha256=
|
11
|
+
ion_CSP/task_manager.py,sha256=62E5s2bkVkRJiKroSGWVfTNYBRbzVcMPqTfZ1FPN61A,16654
|
12
12
|
ion_CSP/upload_download.py,sha256=HXxVQMUydEoHe2vV89wR7De4Ut1lEte6pmp8Q82decI,23800
|
13
13
|
ion_CSP/vasp_processing.py,sha256=Q4OotC5eK4RN4R3GZu5DnLk7wnkYSh-yC1oeGvrtT5U,28436
|
14
14
|
ion_CSP/model/model.pt,sha256=5D9HTP5b7jUOv3kHltT71ORzhgt5p96awjbqC4oZVjQ,24649402
|
@@ -35,9 +35,9 @@ ion_CSP/run/run_gen_opt.py,sha256=_Zcsu0FkuZTfiGKSWNaK17LiyQ3qrP30F66UN5QemCo,27
|
|
35
35
|
ion_CSP/run/run_read_mlp_density.py,sha256=aSJjWS1jH-D7qzx7RnpMPSTH7KEZp2b35dg1b2OQSCM,1864
|
36
36
|
ion_CSP/run/run_upload_download.py,sha256=wuTAdy4bgdduD7TJtgHwo_fTpHKlkAwmgRknClDLYDo,2436
|
37
37
|
ion_CSP/run/run_vasp_processing.py,sha256=hziE4cZwmIWvVaZtwHn9Dl35apYSLlMvSVIbCyd5mFg,1612
|
38
|
-
ion_csp-2.2.
|
39
|
-
ion_csp-2.2.
|
40
|
-
ion_csp-2.2.
|
41
|
-
ion_csp-2.2.
|
42
|
-
ion_csp-2.2.
|
43
|
-
ion_csp-2.2.
|
38
|
+
ion_csp-2.2.3.dist-info/licenses/LICENSE,sha256=yeL9PshY_rGAt3GKqn8U7NafHifpmZipb-Owu0DDrHo,1070
|
39
|
+
ion_csp-2.2.3.dist-info/METADATA,sha256=hCXl6gqOMqsmHyptied9QekguXqh-YctkAX5Y9QR124,6314
|
40
|
+
ion_csp-2.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
41
|
+
ion_csp-2.2.3.dist-info/entry_points.txt,sha256=NexQJDs9f69kJA2DgoU6tsA3V8a66nadJRem1U_c_6g,54
|
42
|
+
ion_csp-2.2.3.dist-info/top_level.txt,sha256=aYZa43dDebjLpWPN6bDIlBb6BVwA8gk4ajEjDDK9b9I,8
|
43
|
+
ion_csp-2.2.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|