dynx 2.10__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,133 @@
1
+ """
2
+ ========== v1.1
3
+
4
+ 1. Add new parameters: atoms_register_mode, sites_register_mode, using_atoms_cache, using_sites_cache
5
+ 2. Now support three modes for registering sites or atoms:
6
+ a. each worker compares and register items simultaneously; (register)
7
+ b. each worker compares items firstly, then results are analysised and registered by main process; (remove)
8
+ c. each worker registers items directly, do not compare; (all)
9
+ 3. Choose to use cache or not
10
+
11
+ ========== v1.2
12
+
13
+ 1. Avoid generating debug.log timer.log and dynx.log file when directly import modules from DynX.
14
+
15
+ ========== v2.0
16
+
17
+ 1. Write NetX class to save reaction networks of states, atoms and sites.
18
+ 2. Rename RegisterWorker to CompareWorker, part of codes are moved to other module.
19
+ 3. Write Register class to register states specifically.
20
+ 4. Support generating new states by atoms network and sites network.
21
+ 5. Fix bugs.
22
+
23
+ ========== v2.1
24
+
25
+ 1. Fix bugs of load networks.
26
+ 2. Add reconstructing atoms networks and sites networks function.
27
+
28
+ ========== v2.2
29
+
30
+ 1. Fix bugs while using kdb method.
31
+ 2. Deal with error while using explorer workers.
32
+
33
+ ========== v2.3
34
+
35
+ 1. Add command line interface (CLI).
36
+ 2. Add pyproject.toml configuration file.
37
+
38
+ ========== v2.4
39
+
40
+ 1. Add command line interface rate and event.
41
+ 2. Fix nnsites explorer bugs.
42
+
43
+ ========== v2.5
44
+
45
+ 1. Add/update CLI of state and event.
46
+ 2. Use numpy.memmap to store state and event record.
47
+ 3. Use pathlib.Path to manipulate file path.
48
+ 4. Read memmap file dynamically.
49
+
50
+ ========== v2.6
51
+
52
+ 1. Adjust parameters n_state and n_event to adjust state map dynamically.
53
+ 2. Add command to show storage of state and event map.
54
+
55
+ ========== v2.7
56
+
57
+ 1. Add CLI of net command.
58
+ 2. Fix rewrite sites bug.
59
+ 3. Check if file or directory exists when using CLI in case of generating unnecessary objects.
60
+ 4. Delete unnecessary config parameters.
61
+ 5. Restart from a breaking running will not change the results.
62
+
63
+ ========== v2.8
64
+
65
+ 1. Add worker.get_unique_prod_sites_ids method to generate consistent surface sites for each new atoms.
66
+ 2. Plot visited code with ligthgreen and unvisited code with lightblue.
67
+ 3. Add parameter skip_double_count choose to skip double count or not.
68
+
69
+ ========== v2.9
70
+
71
+ 1. Add worker.get_optimize_site_atoms_bank method to generate consistent optimized surface atoms for each new sites.
72
+ 2. Add SurfaceSites.get_adatom_substrate_sites method to identify substrate sites of adatoms.
73
+
74
+ ========== v2.10
75
+
76
+ 1. Using register class to update the rate list of KMC.
77
+ 2. Add key of 'by' in event class to distinguish the generator of events.
78
+ 3. Register event for visited atoms and visited sites.
79
+ 4. Identify adatoms substrate sites in SurfaceSites class.
80
+ """
81
+ __VERSION__ = "2.10"
82
+ __DB__ = "sqlite3"
83
+
84
+ ### utilities
85
+ from .utilities.logger import getLogger, writeSysInfo
86
+ from .utilities.timer import Timer
87
+ from .utilities.netx import NetX
88
+ if __DB__ == "sqlite3":
89
+ from .utilities.db.sql3 import DB
90
+ elif __DB__ == 'lmdb':
91
+ try:
92
+ from .utilities.db.lmdb import DB
93
+ except Exception as e:
94
+ raise Exception(e)
95
+ else:
96
+ raise ValueError('Unexpected DB type: {}'.format(__DB__))
97
+
98
+ ### explorer
99
+ from .explorer.explorer import Explorer
100
+ from .explorer.md import MD
101
+ from .explorer.ts_search import TSSearch
102
+ from .explorer.dimer import Dimer
103
+ from .explorer.nnsites import NNSites
104
+ from .explorer.compare import Compare
105
+
106
+ ### Rate
107
+ from .rate.rate import Rate
108
+ from .rate.species import Species
109
+
110
+ ### scenarios
111
+ from .scenarios.local_env import find_local_environments
112
+
113
+ ### Site
114
+ from .sites.site import Site
115
+ from .sites.site_event import SiteEvent, GasAdsDesEvent
116
+ from .sites.site_system import SiteSystem
117
+ from .sites.surf_sites import SurfaceSites
118
+
119
+ from .structure import unfold_local_environment_new, match
120
+ from .confidence import get_confidence
121
+ from .calculator import CalcProfiler
122
+ from .matcher import MatchProfiler
123
+ from .optimizer import OptProfiler
124
+ from .config import ConfigClass
125
+ from .register import Register
126
+ from .seed import Seed
127
+ from .state import State
128
+ from .event import Event
129
+ from .kdb import KDB
130
+ from .kmc import KMC
131
+ from .workers import Workers
132
+ from .akmc import AKMC
133
+ from .dynx_runner import dynxRunner
DynX/cli/main.py ADDED
@@ -0,0 +1,57 @@
1
+ import argparse, sys
2
+ from DynX.cli.akmc import AKMCCommand
3
+ from DynX.cli.clear import ClearCommand
4
+ from DynX.cli.view import ViewCommand
5
+ from DynX.cli.rate import RateCommand
6
+ from DynX.cli.event import EventCommand
7
+ from DynX.cli.db import DBCommand
8
+ from DynX.cli.state import StateCommand
9
+ from DynX.cli.network import NetworkCommand
10
+ from DynX import getLogger, writeSysInfo
11
+
12
+
13
+ COMMANDS = [
14
+ AKMCCommand,
15
+ ClearCommand,
16
+ ViewCommand,
17
+ RateCommand,
18
+ StateCommand,
19
+ EventCommand,
20
+ DBCommand,
21
+ NetworkCommand,
22
+ ]
23
+
24
+
25
+ def main():
26
+ sys.stdout.reconfigure(line_buffering=True) ### set stdout unbuffered
27
+
28
+ parser = argparse.ArgumentParser(prog="dynx")
29
+ subparsers = parser.add_subparsers(dest="command")
30
+
31
+ # regsiter all commands
32
+ for cmd in COMMANDS:
33
+ cmd.add_parser(subparsers)
34
+
35
+ args = parser.parse_args()
36
+
37
+ if args.command is None:
38
+ print_logo_info()
39
+ parser.print_help()
40
+ return
41
+
42
+ # execute
43
+ cmd_class = args.command_class()
44
+ cmd_class.run(args)
45
+
46
+
47
+ def print_logo_info():
48
+ logger = getLogger()
49
+ writeSysInfo(logger)
50
+ logger.info("="*85)
51
+ logger.info(f"{'DynX: Adaptive kinetic monte carlo simulations &&':^85}")
52
+ logger.info(f"{'Automatic exploring reaction networks.':^85}")
53
+ logger.info("="*85)
54
+
55
+
56
+ if __name__ == "__main__":
57
+ 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,64 @@
1
+ Metadata-Version: 2.4
2
+ Name: dynx
3
+ Version: 2.10
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 such as [PyNEP](https://github.com/bigd4/PyNEP), [PyAMFF](https://gitlab.com/pyamff/pyamff), [DP](https://github.com/deepmodeling/deepmd-kit)(todo), and [LAMMPS](https://www.lammps.org/).
24
+
25
+ * Allow for automated batch calculations of transition state searching.
26
+ * Main feature: on-the-fly KMC simulation, hyperdynamics...
27
+
28
+
29
+ ## Installation
30
+ ```shell
31
+ $ pip install dynx
32
+ ```
33
+
34
+ ### Requirements
35
+
36
+ | Package | version |
37
+ | ---- | ---- |
38
+ | [Python](https://www.python.org/) | >= 3.8 |
39
+ | [ase](https://wiki.fysik.dtu.dk/ase/index.html)|>= 3.18.0|
40
+ | [Pytorch](https://pytorch.org/)| newest |
41
+ | [PyYAML](https://pyyaml.org/) | newest |
42
+ | [lammps](https://docs.lammps.org/Install_conda.html) |optional|
43
+ | [PyAmff](https://pyamff.gitlab.io/pyamff/main.html#main) |optional|
44
+ | [PyNEP](https://github.com/bigd4/PyNEP) |optional |
45
+
46
+
47
+ ### From Source
48
+
49
+ ```shell
50
+ $ git clone --recursive git@gitlab.com:ai-ltdynamics/DynX.git
51
+ $ cd DynX
52
+ $ pip install .
53
+ ```
54
+
55
+
56
+ ## Usage
57
+ Go to examples/xxx and simply type
58
+ ```shell
59
+ $ dynx run
60
+ ```
61
+ Clean the dynx output, please type
62
+ ```shell
63
+ $ dynx clear
64
+ ```
@@ -0,0 +1,8 @@
1
+ DynX/__init__.py,sha256=UUJUP78Tw9eQP1IbCa6mojUWre3HPit-bPSTr-cKhig,4135
2
+ DynX/cli/main.py,sha256=rCEhhd6s79-dWZYsIOat1rkKNvyK0147Xoa1q1-wlQw,1332
3
+ DynX/utilities/logger.py,sha256=NS00JIeWk7kDM6jWULaPRPJ_OyLA8VqHglWi3pCXQAo,4403
4
+ dynx-2.10.dist-info/METADATA,sha256=v_-uNhwp-LiNX_bVVPjzI0cUd5bWFMakSM6b0IDDxI8,1928
5
+ dynx-2.10.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
6
+ dynx-2.10.dist-info/entry_points.txt,sha256=RIakNF-qO0R_fweMIswss_Eq4pkYN0099pw9midEfng,44
7
+ dynx-2.10.dist-info/top_level.txt,sha256=u_hMq3lsHBrtwrqS3EwzXrazVP_A7GxAozduRRpScag,5
8
+ dynx-2.10.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