ion-CSP 2.1.2__py3-none-any.whl → 2.1.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/log_and_time.py +10 -4
- ion_CSP/task_manager.py +2 -2
- {ion_csp-2.1.2.dist-info → ion_csp-2.1.3.dist-info}/METADATA +5 -1
- ion_csp-2.1.3.dist-info/RECORD +28 -0
- run/main_CSP.py +1 -2
- run/main_EE.py +1 -1
- run/run_convert_SMILES.py +1 -2
- run/run_empirical_estimate.py +1 -2
- run/run_gen_opt.py +1 -2
- run/run_read_mlp_density.py +1 -2
- run/run_upload_download.py +1 -3
- run/run_vasp_processing.py +1 -2
- ion_csp-2.1.2.dist-info/RECORD +0 -28
- {ion_csp-2.1.2.dist-info → ion_csp-2.1.3.dist-info}/WHEEL +0 -0
- {ion_csp-2.1.2.dist-info → ion_csp-2.1.3.dist-info}/entry_points.txt +0 -0
- {ion_csp-2.1.2.dist-info → ion_csp-2.1.3.dist-info}/licenses/LICENSE +0 -0
- {ion_csp-2.1.2.dist-info → ion_csp-2.1.3.dist-info}/top_level.txt +0 -0
ion_CSP/__init__.py
CHANGED
ion_CSP/log_and_time.py
CHANGED
@@ -3,17 +3,24 @@ import sys
|
|
3
3
|
import time
|
4
4
|
import yaml
|
5
5
|
import signal
|
6
|
+
import inspect
|
6
7
|
import logging
|
7
8
|
import argparse
|
9
|
+
import functools
|
8
10
|
from dpdispatcher.dlog import dlog
|
9
11
|
|
10
12
|
|
11
13
|
def log_and_time(func):
|
12
14
|
"""Decorator for recording log information and script runtime"""
|
13
|
-
|
14
|
-
def wrapper(
|
15
|
+
@functools.wraps(func)
|
16
|
+
def wrapper(work_dir, *args, **kwargs):
|
17
|
+
# 使用inspect获取真实脚本文件名
|
18
|
+
module = inspect.getmodule(func)
|
19
|
+
script_path = module.__file__ if module else __file__
|
20
|
+
script_name = os.path.splitext(os.path.basename(script_path))[0]
|
15
21
|
# 获取脚本所在目录, 在该目录下生成日志
|
16
22
|
log_file_path = os.path.join(work_dir, f"{script_name}_output.log")
|
23
|
+
print(f"Log file path: {log_file_path}")
|
17
24
|
# 配置日志记录
|
18
25
|
logging.basicConfig(
|
19
26
|
filename=log_file_path, # 日志文件名
|
@@ -32,7 +39,7 @@ def log_and_time(func):
|
|
32
39
|
logging.error(f"Error occurred: {e}", exc_info=True)
|
33
40
|
raise
|
34
41
|
print(
|
35
|
-
f"The script {script_name} has run successfully, and the output content has been recorded in the
|
42
|
+
f"The script {script_name} has run successfully, and the output content has been recorded in the {script_name}_output.log file in the same directory."
|
36
43
|
)
|
37
44
|
# 获取程序结束时的CPU时间和Wall Clock时间
|
38
45
|
end_cpu, end_clock = time.process_time(), time.perf_counter()
|
@@ -43,7 +50,6 @@ def log_and_time(func):
|
|
43
50
|
f"End running: {script_name}\nWall time: {wall_time:.4f} sec, CPU time: {cpu_time:.4f} sec\n"
|
44
51
|
)
|
45
52
|
return result
|
46
|
-
|
47
53
|
return wrapper
|
48
54
|
|
49
55
|
|
ion_CSP/task_manager.py
CHANGED
@@ -32,7 +32,7 @@ class TaskManager:
|
|
32
32
|
# 使用 importlib 动态加载
|
33
33
|
spec = importlib.util.spec_from_file_location(
|
34
34
|
"ion_CSP",
|
35
|
-
os.path.join(self.project_root, "src/__init__.py")
|
35
|
+
os.path.join(self.project_root, "src/ion_CSP/__init__.py")
|
36
36
|
)
|
37
37
|
module = importlib.util.module_from_spec(spec)
|
38
38
|
spec.loader.exec_module(module)
|
@@ -253,7 +253,7 @@ class TaskManager:
|
|
253
253
|
process.terminate()
|
254
254
|
return
|
255
255
|
# 创建符号链接
|
256
|
-
output_log = work_dir / f"main_{module}.
|
256
|
+
output_log = work_dir / f"main_{module}_output.log"
|
257
257
|
print(f"Original log file: {output_log}")
|
258
258
|
std_log = Path(self.log_dir) / f"{module}_{process.pid}.log"
|
259
259
|
try:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ion_CSP
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.3
|
4
4
|
Summary: Crystal Structure Design Software Based on Molecular/Ionic Configuration.
|
5
5
|
Home-page: https://github.com/bagabaga007/ion_CSP
|
6
6
|
Author: Ze Yang
|
@@ -71,6 +71,10 @@ Dynamic: requires-python
|
|
71
71
|
|
72
72
|
### 安装步骤
|
73
73
|
```bash
|
74
|
+
pip install ion-csp
|
75
|
+
```
|
76
|
+
或
|
77
|
+
```bash
|
74
78
|
# 创建虚拟环境
|
75
79
|
python -m venv venv
|
76
80
|
source venv/bin/activate # Linux/Mac
|
@@ -0,0 +1,28 @@
|
|
1
|
+
ion_CSP/__init__.py,sha256=axZa2cdqI7GY7iU5xGNsBIcYL4SqyozbGJ-76Blzf9I,374
|
2
|
+
ion_CSP/__main__.py,sha256=XlNCx5eMSrL7yld9ddSYXhjXvg2ZYGD_uk9LdqNabvs,74
|
3
|
+
ion_CSP/convert_SMILES.py,sha256=4fndMcuIEypYtkXWBoS7W7uEXkZXVLeMDshdXEIk5kY,13864
|
4
|
+
ion_CSP/empirical_estimate.py,sha256=_U5VRWSIAiJGcxnP3mnCHn8zKzviFEQhQwN7TjPTnCU,29089
|
5
|
+
ion_CSP/gen_opt.py,sha256=aVZmf2RqePCwZShgpNvzqfntNAW0I0yctWHGXoe3mgw,19463
|
6
|
+
ion_CSP/identify_molecules.py,sha256=hFKXS0Jjd7LyMsYGc9RmnoRPu1ibXF9fYO_9lR3wTfo,4634
|
7
|
+
ion_CSP/log_and_time.py,sha256=-RCycW1VB7sa3bjQZiF7c8i73iam8S41qgJxlHRqJaw,9406
|
8
|
+
ion_CSP/mlp_opt.py,sha256=ox4Qxg4D6WzrB8dxVnUWmAngnOA_wdcInP5UhBWsH4c,5535
|
9
|
+
ion_CSP/read_mlp_density.py,sha256=3N7kgM2RCe1gbP8QxpgtwYRaj77w4niNglWA5VDoQsk,11209
|
10
|
+
ion_CSP/steps_opt_monitor.sh,sha256=1klPjnK0gqkDbvI9PtjdK5qidJ5G0Mo8q1SfrlLW5xM,3330
|
11
|
+
ion_CSP/task_manager.py,sha256=TZPsbwUWoUIG_Kmsa-WcEh_rWx8WaKkj6SworG_qk9w,16733
|
12
|
+
ion_CSP/upload_download.py,sha256=Hiz5jKOy9x26hJJdcpt-owQdVUbzzGuGOelro6JozY8,23801
|
13
|
+
ion_CSP/vasp_processing.py,sha256=TshMNs7fA0zABvk4sKlVjofJFwGH9DVYcCGbcUpoH1s,31542
|
14
|
+
ion_csp-2.1.3.dist-info/licenses/LICENSE,sha256=2J6A8GT2iIf2LhuWO1_0ilgx7ijzzpQ2BXU7rHKe8Cc,1068
|
15
|
+
run/__init__.py,sha256=_9EAXp4cv41ARbxahCkihwqY4F00Y18tBeTauWeD9mw,186
|
16
|
+
run/main_CSP.py,sha256=UaYHlh7BSxar4uGppPi-V0cFDpB14212Oy6gta59LfA,5898
|
17
|
+
run/main_EE.py,sha256=4L0VbbgUaYaDJM-6EjffphxMoWAHaZchEaSCVJxsdls,6345
|
18
|
+
run/run_convert_SMILES.py,sha256=85a8-UXPxPo3Yw_iYED_QF47yNTvYRnJHm3PC1d-d_Q,2056
|
19
|
+
run/run_empirical_estimate.py,sha256=U_yvQ5gMiBkDEabHXLJSAEm0EzGHhSKs6xmWoEC_gjc,2831
|
20
|
+
run/run_gen_opt.py,sha256=_Zcsu0FkuZTfiGKSWNaK17LiyQ3qrP30F66UN5QemCo,2727
|
21
|
+
run/run_read_mlp_density.py,sha256=aSJjWS1jH-D7qzx7RnpMPSTH7KEZp2b35dg1b2OQSCM,1864
|
22
|
+
run/run_upload_download.py,sha256=wuTAdy4bgdduD7TJtgHwo_fTpHKlkAwmgRknClDLYDo,2436
|
23
|
+
run/run_vasp_processing.py,sha256=hziE4cZwmIWvVaZtwHn9Dl35apYSLlMvSVIbCyd5mFg,1612
|
24
|
+
ion_csp-2.1.3.dist-info/METADATA,sha256=_Ij1Ms_VyN0ZxGkw0FEs_3BcEaW-dvcaJKTakHeHsmQ,6524
|
25
|
+
ion_csp-2.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
26
|
+
ion_csp-2.1.3.dist-info/entry_points.txt,sha256=NexQJDs9f69kJA2DgoU6tsA3V8a66nadJRem1U_c_6g,54
|
27
|
+
ion_csp-2.1.3.dist-info/top_level.txt,sha256=Vp0RHefYscYU7uQ4Fu6bOKhC_ASrdGOzZxYfN5r0f2M,12
|
28
|
+
ion_csp-2.1.3.dist-info/RECORD,,
|
run/main_CSP.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import os
|
2
1
|
import logging
|
3
2
|
from ion_CSP.gen_opt import CrystalGenerator
|
4
3
|
from ion_CSP.read_mlp_density import ReadMlpDensity
|
@@ -131,4 +130,4 @@ if __name__ == "__main__":
|
|
131
130
|
default_config=DEFAULT_CONFIG, user_config=config, key=module
|
132
131
|
)
|
133
132
|
# 调用主函数
|
134
|
-
main(
|
133
|
+
main(work_dir, config)
|
run/main_EE.py
CHANGED
run/run_convert_SMILES.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import os
|
2
1
|
from ion_CSP.convert_SMILES import SmilesProcessing
|
3
2
|
from ion_CSP.log_and_time import log_and_time, merge_config, get_work_dir_and_config
|
4
3
|
|
@@ -47,4 +46,4 @@ if __name__ == "__main__":
|
|
47
46
|
default_config=DEFAULT_CONFIG, user_config=config, key="convert_SMILES"
|
48
47
|
)
|
49
48
|
# 调用主函数
|
50
|
-
main(
|
49
|
+
main(work_dir, config)
|
run/run_empirical_estimate.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import os
|
2
1
|
from ion_CSP.empirical_estimate import EmpiricalEstimation
|
3
2
|
from ion_CSP.log_and_time import log_and_time, merge_config, get_work_dir_and_config
|
4
3
|
|
@@ -53,4 +52,4 @@ if __name__ == "__main__":
|
|
53
52
|
default_config=DEFAULT_CONFIG, user_config=config, key="empirical_estimate"
|
54
53
|
)
|
55
54
|
# 调用主函数
|
56
|
-
main(
|
55
|
+
main(work_dir, config)
|
run/run_gen_opt.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import os
|
2
1
|
from ion_CSP.gen_opt import CrystalGenerator
|
3
2
|
from ion_CSP.log_and_time import StatusLogger
|
4
3
|
from ion_CSP.log_and_time import log_and_time, merge_config, get_work_dir_and_config
|
@@ -63,4 +62,4 @@ if __name__ == "__main__":
|
|
63
62
|
default_config=DEFAULT_CONFIG, user_config=config, key="gen_opt"
|
64
63
|
)
|
65
64
|
# 调用主函数
|
66
|
-
main(
|
65
|
+
main(work_dir, config)
|
run/run_read_mlp_density.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import os
|
2
1
|
from ion_CSP.read_mlp_density import ReadMlpDensity
|
3
2
|
from ion_CSP.log_and_time import StatusLogger
|
4
3
|
from ion_CSP.log_and_time import log_and_time, merge_config, get_work_dir_and_config
|
@@ -40,4 +39,4 @@ if __name__ == "__main__":
|
|
40
39
|
default_config=DEFAULT_CONFIG, user_config=config, key="read_mlp_density"
|
41
40
|
)
|
42
41
|
# 调用主函数
|
43
|
-
main(
|
42
|
+
main(work_dir, config)
|
run/run_upload_download.py
CHANGED
@@ -62,7 +62,5 @@ if __name__ == "__main__":
|
|
62
62
|
except FileNotFoundError:
|
63
63
|
print(f"config.yaml not found in {args.work_dir}.")
|
64
64
|
raise
|
65
|
-
# 获取当前脚本的名称
|
66
|
-
script_name = os.path.basename(__file__)
|
67
65
|
# 调用主函数
|
68
|
-
main(
|
66
|
+
main(args.work_dir, config)
|
run/run_vasp_processing.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import os
|
2
1
|
from ion_CSP.vasp_processing import VaspProcessing
|
3
2
|
from ion_CSP.log_and_time import StatusLogger
|
4
3
|
from ion_CSP.log_and_time import log_and_time, merge_config, get_work_dir_and_config
|
@@ -40,4 +39,4 @@ if __name__ == "__main__":
|
|
40
39
|
default_config=DEFAULT_CONFIG, user_config=config, key="vasp_processing"
|
41
40
|
)
|
42
41
|
# 调用主函数
|
43
|
-
main(
|
42
|
+
main(work_dir, config)
|
ion_csp-2.1.2.dist-info/RECORD
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
ion_CSP/__init__.py,sha256=hYxxDupiYyKqFBRl78HzhGiku8nFYpnk1GujZQaInXk,374
|
2
|
-
ion_CSP/__main__.py,sha256=XlNCx5eMSrL7yld9ddSYXhjXvg2ZYGD_uk9LdqNabvs,74
|
3
|
-
ion_CSP/convert_SMILES.py,sha256=4fndMcuIEypYtkXWBoS7W7uEXkZXVLeMDshdXEIk5kY,13864
|
4
|
-
ion_CSP/empirical_estimate.py,sha256=_U5VRWSIAiJGcxnP3mnCHn8zKzviFEQhQwN7TjPTnCU,29089
|
5
|
-
ion_CSP/gen_opt.py,sha256=aVZmf2RqePCwZShgpNvzqfntNAW0I0yctWHGXoe3mgw,19463
|
6
|
-
ion_CSP/identify_molecules.py,sha256=hFKXS0Jjd7LyMsYGc9RmnoRPu1ibXF9fYO_9lR3wTfo,4634
|
7
|
-
ion_CSP/log_and_time.py,sha256=6RKegXF8Gc1HqzAbE-PT9ejX3Ncyuz3v3FivujJt8to,9072
|
8
|
-
ion_CSP/mlp_opt.py,sha256=ox4Qxg4D6WzrB8dxVnUWmAngnOA_wdcInP5UhBWsH4c,5535
|
9
|
-
ion_CSP/read_mlp_density.py,sha256=3N7kgM2RCe1gbP8QxpgtwYRaj77w4niNglWA5VDoQsk,11209
|
10
|
-
ion_CSP/steps_opt_monitor.sh,sha256=1klPjnK0gqkDbvI9PtjdK5qidJ5G0Mo8q1SfrlLW5xM,3330
|
11
|
-
ion_CSP/task_manager.py,sha256=SdpmpQS6q-ZdnMpwrGrquX6dQjT0UBsAoP7_eG5_DdE,16728
|
12
|
-
ion_CSP/upload_download.py,sha256=Hiz5jKOy9x26hJJdcpt-owQdVUbzzGuGOelro6JozY8,23801
|
13
|
-
ion_CSP/vasp_processing.py,sha256=TshMNs7fA0zABvk4sKlVjofJFwGH9DVYcCGbcUpoH1s,31542
|
14
|
-
ion_csp-2.1.2.dist-info/licenses/LICENSE,sha256=2J6A8GT2iIf2LhuWO1_0ilgx7ijzzpQ2BXU7rHKe8Cc,1068
|
15
|
-
run/__init__.py,sha256=_9EAXp4cv41ARbxahCkihwqY4F00Y18tBeTauWeD9mw,186
|
16
|
-
run/main_CSP.py,sha256=qR3SVZVwJwudnrIDypJrtCAYGzFswL3UGsYRBRMcaxs,5936
|
17
|
-
run/main_EE.py,sha256=8gazhe-JzvygbSIqxVITmums2E5McRnld6QB3Us2i5s,6373
|
18
|
-
run/run_convert_SMILES.py,sha256=sngOyse2pdSsWGZhOTVNtlb2Bg9uBFL4qejpgKu38Gs,2094
|
19
|
-
run/run_empirical_estimate.py,sha256=D1600cl9isiglhWk528nmvfD7Zh6YBawrrc9x8LpKww,2869
|
20
|
-
run/run_gen_opt.py,sha256=xert_S4urD0lkGjOO2hX2T3aD3UPzt39GWQVkqzxUGI,2765
|
21
|
-
run/run_read_mlp_density.py,sha256=1QSRlOWEVpEnoGL4jIR3t-73V9dM4_pu6FtD9aisLH0,1902
|
22
|
-
run/run_upload_download.py,sha256=rX82igeAWssmx-qaU8i45VezxtZvY3wDKlrT1a_2i3Y,2528
|
23
|
-
run/run_vasp_processing.py,sha256=JqliNn-Qan89byUbgJAKRbRVHjZ9CwCixkD1YUTaHj8,1650
|
24
|
-
ion_csp-2.1.2.dist-info/METADATA,sha256=3lXbX3oY09e3y51j2ORdVcnb7pOISQNY-3e0r7lfrVk,6488
|
25
|
-
ion_csp-2.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
26
|
-
ion_csp-2.1.2.dist-info/entry_points.txt,sha256=NexQJDs9f69kJA2DgoU6tsA3V8a66nadJRem1U_c_6g,54
|
27
|
-
ion_csp-2.1.2.dist-info/top_level.txt,sha256=Vp0RHefYscYU7uQ4Fu6bOKhC_ASrdGOzZxYfN5r0f2M,12
|
28
|
-
ion_csp-2.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|