dynx 0.0.1__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.
DynX/__init__.py ADDED
@@ -0,0 +1,4 @@
1
+ __VERSION__ = "0.0.1"
2
+
3
+ ### utilities
4
+ from .utilities.logger import getLogger, writeSysInfo
DynX/cli/main.py ADDED
@@ -0,0 +1,41 @@
1
+ import argparse, sys
2
+ from DynX import getLogger, writeSysInfo
3
+
4
+
5
+ COMMANDS = [
6
+ ]
7
+
8
+
9
+ def main():
10
+ sys.stdout.reconfigure(line_buffering=True) ### set stdout unbuffered
11
+
12
+ parser = argparse.ArgumentParser(prog="dynx")
13
+ subparsers = parser.add_subparsers(dest="command")
14
+
15
+ # regsiter all commands
16
+ for cmd in COMMANDS:
17
+ cmd.add_parser(subparsers)
18
+
19
+ args = parser.parse_args()
20
+
21
+ if args.command is None:
22
+ print_logo_info()
23
+ parser.print_help()
24
+ return
25
+
26
+ # execute
27
+ cmd_class = args.command_class()
28
+ cmd_class.run(args)
29
+
30
+
31
+ def print_logo_info():
32
+ logger = getLogger()
33
+ writeSysInfo(logger)
34
+ logger.info("="*85)
35
+ logger.info(f"{'DynX: Adaptive kinetic monte carlo simulations &&':^85}")
36
+ logger.info(f"{'Automatic exploring reaction networks.':^85}")
37
+ logger.info("="*85)
38
+
39
+
40
+ if __name__ == "__main__":
41
+ main()
@@ -0,0 +1,93 @@
1
+ import sys, os
2
+ import platform, socket, re, uuid, subprocess
3
+ import logging
4
+ from DynX import __VERSION__
5
+
6
+ logo =\
7
+ """
8
+
9
+ DDDDDDDDDDDDD XXXXXXX XXXXXXX
10
+ D::::::::::::DDD X:::::X X:::::X
11
+ D:::::::::::::::DD X:::::X X:::::X
12
+ DDD:::::DDDDD:::::D X::::::X X::::::X
13
+ D:::::D D:::::Dyyyyyyy yyyyyyynnnn nnnnnnnn XXX:::::X X:::::XXX
14
+ D:::::D D:::::Dy:::::y y:::::y n:::nn::::::::nn X:::::X X:::::X
15
+ D:::::D D:::::D y:::::y y:::::y n::::::::::::::nn X:::::X:::::X
16
+ D:::::D D:::::D y:::::y y:::::y nn:::::::::::::::n X:::::::::X
17
+ D:::::D D:::::D y:::::y y:::::y n:::::nnnn:::::n X:::::::::X
18
+ D:::::D D:::::D y:::::y y:::::y n::::n n::::n X:::::X:::::X
19
+ D:::::D D:::::D y:::::y:::::y n::::n n::::n X:::::X X:::::X
20
+ D:::::D D:::::D y:::::::::y n::::n n::::nXXX:::::X X:::::XXX
21
+ DDD:::::DDDDD:::::D y:::::::y n::::n n::::nX::::::X X::::::X
22
+ D:::::::::::::::DD y:::::y n::::n n::::nX:::::X X:::::X
23
+ D::::::::::::DDD y:::::y n::::n n::::nX:::::X X:::::X
24
+ DDDDDDDDDDDDD y:::::y nnnnnn nnnnnnXXXXXXX XXXXXXX
25
+ y:::::y
26
+ y:::::y
27
+ y:::::y
28
+ y:::::y
29
+ yyyyyyy
30
+
31
+ """
32
+
33
+ def getLogger(name="DynX",
34
+ logfile=None,
35
+ fmt="%(message)s",
36
+ level=logging.INFO):
37
+ logger = logging.getLogger(name)
38
+ logger.setLevel(level)
39
+
40
+ if logger.handlers:
41
+ return logger
42
+
43
+ formatter = logging.Formatter(fmt, datefmt="%Y-%m-%d %H:%M:%S")
44
+
45
+ if logfile is not None:
46
+ file_handler = logging.FileHandler(logfile)
47
+ file_handler.setFormatter(formatter)
48
+ logger.addHandler(file_handler)
49
+ else:
50
+ console_handler = logging.StreamHandler(sys.stdout)
51
+ console_handler.setFormatter(formatter)
52
+ logger.addHandler(console_handler)
53
+
54
+ return logger
55
+
56
+ def writeSysInfo(logger):
57
+ logger.info(logo)
58
+ getSystemInfo(logger)
59
+
60
+ def getProcessorName():
61
+ if platform.system() == "Windows":
62
+ return platform.processor()
63
+ elif platform.system() == "Darwin":
64
+ os.environ['PATH'] = os.environ['PATH'] + os.pathsep + '/usr/sbin'
65
+ command ="sysctl -n machdep.cpu.brand_string"
66
+ return subprocess.check_output(command).strip()
67
+ elif platform.system() == "Linux":
68
+ command = "grep model /proc/cpuinfo"
69
+ all_info = subprocess.check_output(command, shell=True).decode('utf-8').strip()
70
+ for line in all_info.split("\n"):
71
+ if "model name" in line:
72
+ return re.sub(".*model name.*:", "", line,1)
73
+ return ""
74
+
75
+ def getSystemInfo(logger=None):
76
+ if logger is None:
77
+ sys.stderr('No logger is provided')
78
+ try:
79
+ logger.info('Platform: %s', platform.system())
80
+ logger.info('Platform-release: %s', platform.release())
81
+ logger.info('Platform-version: %s', platform.version())
82
+ logger.info('Architecture: %s', platform.machine())
83
+ logger.info('Hostname: %s', socket.gethostname())
84
+ logger.info('IP-address: %s', socket.gethostbyname(socket.gethostname()))
85
+ logger.info('MAC-address: %s', ':'.join(re.findall('..', '%012x' % uuid.getnode())))
86
+ logger.info('Processor: %s', getProcessorName())
87
+ logger.info('Version: %s', __VERSION__)
88
+ #logger.info('Ram: %s', str(round(psutil.virtual_memory().total / (1024.0 **3)))+" GB")
89
+ #except Exception as e:
90
+ # sys.stderr(e)
91
+ except:
92
+ pass
93
+
@@ -0,0 +1,59 @@
1
+ Metadata-Version: 2.4
2
+ Name: dynx
3
+ Version: 0.0.1
4
+ Summary: Adaptive dynamic kinetic monte carlo simulation & automatic exploration of chemical reaction networks
5
+ Author: Jun Luo
6
+ Project-URL: Homepage, https://gitee.com/aicatal/DynX/tree/v2.0/
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: numpy>=2.2.5
10
+ Requires-Dist: scipy>=1.15.3
11
+
12
+
13
+
14
+ <p align="center">
15
+ <img src="./logo.png" alt="logo" width="50%" height="50%">
16
+ </p>
17
+
18
+ # <center> DynX : Extending Time and Spatial Scale of Dynamics Simulations <center>
19
+
20
+ On-the-fly KMC simulation software based on [ASE](https://wiki.fysik.dtu.dk/ase/index.html) (Atomic Simulation Environment) providing automation saddle searching capabilities. Enable Extending Time and Spatial Scale of Dynamics Simulations.
21
+
22
+ ## Features
23
+ * Based on the ASE package, supports different calculators.
24
+ * Allow for automated batch calculations of transition state searching.
25
+ * Main feature: on-the-fly KMC simulation, hyperdynamics...
26
+
27
+
28
+ ## Installation
29
+ ```shell
30
+ $ pip install dynx
31
+ ```
32
+
33
+ ### Requirements
34
+
35
+ | Package | version |
36
+ | ---- | ---- |
37
+ | [Python](https://www.python.org/) | >= 3.8 |
38
+ | [ase](https://wiki.fysik.dtu.dk/ase/index.html)|>= 3.18.0|
39
+ | [lammps](https://docs.lammps.org/Install_conda.html) |optional|
40
+
41
+
42
+ ### From Source
43
+
44
+ ```shell
45
+ $ git clone --recursive git@gitlab.com:ai-ltdynamics/DynX.git
46
+ $ cd DynX
47
+ $ pip install .
48
+ ```
49
+
50
+
51
+ ## Usage
52
+ Go to examples/xxx and simply type
53
+ ```shell
54
+ $ dynx run
55
+ ```
56
+ Clean the dynx output, please type
57
+ ```shell
58
+ $ dynx clear
59
+ ```
@@ -0,0 +1,8 @@
1
+ DynX/__init__.py,sha256=u57YdWmgTI8V3ZV2uVfXbV1tIFnJXJHSujWSJnxvkSE,91
2
+ DynX/cli/main.py,sha256=Uiib-qMjOO3gusBn7NGbOBCR2gq4m0Bk_fVSt-FKbfA,880
3
+ DynX/utilities/logger.py,sha256=NS00JIeWk7kDM6jWULaPRPJ_OyLA8VqHglWi3pCXQAo,4403
4
+ dynx-0.0.1.dist-info/METADATA,sha256=t7Dscqi-Ry-8JNeeGsw1DXpP91BzF1ovU534hysnXvg,1530
5
+ dynx-0.0.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
6
+ dynx-0.0.1.dist-info/entry_points.txt,sha256=RIakNF-qO0R_fweMIswss_Eq4pkYN0099pw9midEfng,44
7
+ dynx-0.0.1.dist-info/top_level.txt,sha256=u_hMq3lsHBrtwrqS3EwzXrazVP_A7GxAozduRRpScag,5
8
+ dynx-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dynx = DynX.cli.main:main
@@ -0,0 +1 @@
1
+ DynX