allomorph 0.1.0__tar.gz

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.
@@ -0,0 +1,72 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual environments
24
+ .venv/
25
+ venv/
26
+ ENV/
27
+ env/
28
+
29
+ # IDEs
30
+ .vscode/
31
+ .idea/
32
+ *.swp
33
+ *.swo
34
+ *~
35
+
36
+ # Testing
37
+ .pytest_cache/
38
+ .coverage
39
+ htmlcov/
40
+ .tox/
41
+
42
+ # Generated artefacts
43
+ *.lmp
44
+ *.xyz
45
+ *.log
46
+ *.csv
47
+ *.pickle
48
+ *.pkl
49
+ *.zip
50
+ *.exe
51
+ *.ipynb_checkpoints
52
+ MNP/
53
+ BNP/
54
+ TNP/
55
+ docs/_build/
56
+ docs/_static/
57
+ docs/_templates/
58
+
59
+ # Legacy directories
60
+ InitStruct/*NP/
61
+ InitStruct/*log*
62
+ MDsim/*.log
63
+ FeatExtEng/__pycache__/
64
+ FeatExtEng/*.log
65
+ FeatExtEng/NCPac/*.mod
66
+
67
+ # AI Assistants
68
+ .agents/
69
+ .antigravitycli/
70
+ .codex
71
+ .continue/
72
+ .qodo/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jonathan Yik Chang Ting
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.4
2
+ Name: allomorph
3
+ Version: 0.1.0
4
+ Summary: Toolkit for generating monometallic to trimetallic nanoparticle structural datasets for machine learning.
5
+ Project-URL: Homepage, https://github.com/jonathan-ting/allomorph
6
+ Project-URL: Bug Tracker, https://github.com/jonathan-ting/allomorph/issues
7
+ Author: Jonathan Yik Chang Ting
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026 Jonathan Yik Chang Ting
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Keywords: EAM,LAMMPS,machine-learning,materials-science,molecular-dynamics,nanoparticles
31
+ Classifier: Development Status :: 3 - Alpha
32
+ Classifier: Intended Audience :: Science/Research
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Programming Language :: Python :: 3
35
+ Classifier: Programming Language :: Python :: 3.9
36
+ Classifier: Programming Language :: Python :: 3.10
37
+ Classifier: Programming Language :: Python :: 3.11
38
+ Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: Programming Language :: Python :: 3.13
40
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
41
+ Classifier: Topic :: Scientific/Engineering :: Physics
42
+ Requires-Python: >=3.9
43
+ Requires-Dist: ase
44
+ Requires-Dist: numpy
45
+ Requires-Dist: pandas
46
+ Requires-Dist: scipy
47
+ Provides-Extra: dev
48
+ Requires-Dist: jupyterlab; extra == 'dev'
49
+ Requires-Dist: myst-nb; extra == 'dev'
50
+ Requires-Dist: myst-parser; extra == 'dev'
51
+ Requires-Dist: pytest-cov; extra == 'dev'
52
+ Requires-Dist: pytest>=7.0; extra == 'dev'
53
+ Requires-Dist: python-semantic-release; extra == 'dev'
54
+ Requires-Dist: ruff; extra == 'dev'
55
+ Requires-Dist: sphinx; extra == 'dev'
56
+ Requires-Dist: sphinx-autoapi; extra == 'dev'
57
+ Requires-Dist: sphinx-rtd-theme; extra == 'dev'
58
+ Description-Content-Type: text/markdown
59
+
60
+ # AlloMorph
61
+
62
+ ---
63
+
64
+ ## Description
65
+
66
+ AlloMorph is a Python toolkit for generating initial structural models of monometallic, bimetallic, and trimetallic nanoparticles. It is designed to create large-scale datasets for atomistic simulations and machine learning applications.
67
+
68
+ ![](https://raw.githubusercontent.com/Jon-Ting/allmorph/main/docs/figs/TNPs_generation_flowchart.png)
69
+
70
+ ---
71
+
72
+ ## Installation
73
+
74
+ This package uses [uv](https://docs.astral.sh/uv/) for dependency management and packaging. For detailed information on external tool requirements (LAMMPS, NCPac, etc.), see [DEPENDENCIES.md](DEPENDENCIES.md).
75
+
76
+ ```bash
77
+ # Clone the repository
78
+ git clone https://github.com/jonathan-ting/allomorph.git
79
+ cd allomorph
80
+
81
+ # Create a virtual environment and install dependencies
82
+ uv venv
83
+ uv pip install -e ".[dev]"
84
+ ```
85
+
86
+ Alternatively, you can install directly with pip:
87
+
88
+ ```bash
89
+ pip install allomorph
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Usage
95
+
96
+ The core `allomorph` command provides a streamlined interface for structure generation:
97
+
98
+ ```bash
99
+ # Generate a full suite of nanoparticles (MNP, BNP, TNP)
100
+ allomorph init-struct --stage all
101
+
102
+ # Generate only monometallic nanoparticles
103
+ allomorph init-struct --stage mnp
104
+
105
+ # Generate bimetallic nanoparticles with visual check (ASE GUI)
106
+ allomorph init-struct --stage bnp --vis
107
+ ```
108
+
109
+ Check out the [basic demonstration](https://github.com/Jon-Ting/allomorph/blob/main/docs/demo.ipynb) notebook for further explanations and demonstrations!
110
+
111
+ ---
112
+
113
+ ## Features
114
+
115
+ ### Core Package Structure
116
+
117
+ - `allomorph.init_struct` — Generation logic for monometallic, bimetallic, and trimetallic structures.
118
+ - `allomorph.constants` — Physical constants, element properties, and global configuration.
119
+
120
+ ### Project Extras & Research Tools
121
+
122
+ While the core `allomorph` package focuses on structure generation, this repository includes additional tools and legacy resources used in the original research pipeline:
123
+
124
+ #### 1. Research Extras (`extras/`)
125
+ These are standalone Python modules for managing the full simulation lifecycle:
126
+ - `extras/eam/` — Creation of EAM alloy potential files.
127
+ - `extras/md_sim/` — Management of LAMMPS simulations and HPC job submission.
128
+ - `extras/feat_ext_eng/` — Integration with NCPac for structural feature extraction.
129
+
130
+ #### 2. Physical Resources
131
+ - **InitStruct**: LAMMPS and Bash scripts for alternative structure generation workflows.
132
+ - **EAM**: Reference databases and tools for interatomic potentials.
133
+ - **MDsim**: LAMMPS templates and scripts for simulation orchestration.
134
+ - **FeatExtEng**: Source code and configuration for NCPac.
135
+
136
+ ### Degrees of Freedom
137
+
138
+ AlloMorph supports a wide range of configurable parameters:
139
+
140
+ - **Elemental composition:** Supports 1–3 arbitrary metallic elements (e.g., Au, Pt, Pd, Cu, Ni, Ag).
141
+ - **Size:** Configurable diameter range (default: 10–30 Å).
142
+ - **Shape:** CU (Cube), TH (Tetrahedron), RD (Rhombic Dodecahedron), OT (Octahedron), TO (Truncated Octahedron), CO (Cuboctahedron), DH (Decahedron), IC (Icosahedron), SP (Sphere).
143
+ - **Ratio:** Arbitrary stoichiometric ratios (e.g., 20:40:40).
144
+ - **Atomic ordering:**
145
+ - **BNP**: L10 (Ordered), RAL (Random), RCS (Random Core-Shell).
146
+ - **TNP**: L10R, CS, CL10S, CRALS, RRAL, CSRAL, CSL10, CRSR, LL10.
147
+
148
+ ### Future Enhancements
149
+
150
+ - **Support >3 metals:** Extend logic to quadrimetallic and beyond.
151
+ - **Non-FCC lattice support:** Support for BCC, HCP, and other lattices.
152
+ - **Modern Formats:** Support for HDF5 and ASE trajectory outputs.
153
+
154
+ ## Documentation
155
+
156
+ Detailed [documentations](https://allomorph.readthedocs.io/en/latest/) are hosted by `Read the Docs`.
157
+
158
+ ## Contributing
159
+
160
+ `Sphractal` appreciates your enthusiasm and welcomes your expertise!
161
+
162
+ Please check out the [contributing guidelines](https://github.com/Jon-Ting/allomorph/blob/main/CONTRIBUTING.md) and
163
+ [code of conduct](https://github.com/Jon-Ting/allomorph/blob/main/CONDUCT.md).
164
+ By contributing to this project, you agree to abide by its terms.
165
+
166
+ ## License
167
+
168
+ The project is distributed under an [MIT License](https://github.com/Jon-Ting/allomorph/blob/main/LICENSE).
@@ -0,0 +1,109 @@
1
+ # AlloMorph
2
+
3
+ ---
4
+
5
+ ## Description
6
+
7
+ AlloMorph is a Python toolkit for generating initial structural models of monometallic, bimetallic, and trimetallic nanoparticles. It is designed to create large-scale datasets for atomistic simulations and machine learning applications.
8
+
9
+ ![](https://raw.githubusercontent.com/Jon-Ting/allmorph/main/docs/figs/TNPs_generation_flowchart.png)
10
+
11
+ ---
12
+
13
+ ## Installation
14
+
15
+ This package uses [uv](https://docs.astral.sh/uv/) for dependency management and packaging. For detailed information on external tool requirements (LAMMPS, NCPac, etc.), see [DEPENDENCIES.md](DEPENDENCIES.md).
16
+
17
+ ```bash
18
+ # Clone the repository
19
+ git clone https://github.com/jonathan-ting/allomorph.git
20
+ cd allomorph
21
+
22
+ # Create a virtual environment and install dependencies
23
+ uv venv
24
+ uv pip install -e ".[dev]"
25
+ ```
26
+
27
+ Alternatively, you can install directly with pip:
28
+
29
+ ```bash
30
+ pip install allomorph
31
+ ```
32
+
33
+ ---
34
+
35
+ ## Usage
36
+
37
+ The core `allomorph` command provides a streamlined interface for structure generation:
38
+
39
+ ```bash
40
+ # Generate a full suite of nanoparticles (MNP, BNP, TNP)
41
+ allomorph init-struct --stage all
42
+
43
+ # Generate only monometallic nanoparticles
44
+ allomorph init-struct --stage mnp
45
+
46
+ # Generate bimetallic nanoparticles with visual check (ASE GUI)
47
+ allomorph init-struct --stage bnp --vis
48
+ ```
49
+
50
+ Check out the [basic demonstration](https://github.com/Jon-Ting/allomorph/blob/main/docs/demo.ipynb) notebook for further explanations and demonstrations!
51
+
52
+ ---
53
+
54
+ ## Features
55
+
56
+ ### Core Package Structure
57
+
58
+ - `allomorph.init_struct` — Generation logic for monometallic, bimetallic, and trimetallic structures.
59
+ - `allomorph.constants` — Physical constants, element properties, and global configuration.
60
+
61
+ ### Project Extras & Research Tools
62
+
63
+ While the core `allomorph` package focuses on structure generation, this repository includes additional tools and legacy resources used in the original research pipeline:
64
+
65
+ #### 1. Research Extras (`extras/`)
66
+ These are standalone Python modules for managing the full simulation lifecycle:
67
+ - `extras/eam/` — Creation of EAM alloy potential files.
68
+ - `extras/md_sim/` — Management of LAMMPS simulations and HPC job submission.
69
+ - `extras/feat_ext_eng/` — Integration with NCPac for structural feature extraction.
70
+
71
+ #### 2. Physical Resources
72
+ - **InitStruct**: LAMMPS and Bash scripts for alternative structure generation workflows.
73
+ - **EAM**: Reference databases and tools for interatomic potentials.
74
+ - **MDsim**: LAMMPS templates and scripts for simulation orchestration.
75
+ - **FeatExtEng**: Source code and configuration for NCPac.
76
+
77
+ ### Degrees of Freedom
78
+
79
+ AlloMorph supports a wide range of configurable parameters:
80
+
81
+ - **Elemental composition:** Supports 1–3 arbitrary metallic elements (e.g., Au, Pt, Pd, Cu, Ni, Ag).
82
+ - **Size:** Configurable diameter range (default: 10–30 Å).
83
+ - **Shape:** CU (Cube), TH (Tetrahedron), RD (Rhombic Dodecahedron), OT (Octahedron), TO (Truncated Octahedron), CO (Cuboctahedron), DH (Decahedron), IC (Icosahedron), SP (Sphere).
84
+ - **Ratio:** Arbitrary stoichiometric ratios (e.g., 20:40:40).
85
+ - **Atomic ordering:**
86
+ - **BNP**: L10 (Ordered), RAL (Random), RCS (Random Core-Shell).
87
+ - **TNP**: L10R, CS, CL10S, CRALS, RRAL, CSRAL, CSL10, CRSR, LL10.
88
+
89
+ ### Future Enhancements
90
+
91
+ - **Support >3 metals:** Extend logic to quadrimetallic and beyond.
92
+ - **Non-FCC lattice support:** Support for BCC, HCP, and other lattices.
93
+ - **Modern Formats:** Support for HDF5 and ASE trajectory outputs.
94
+
95
+ ## Documentation
96
+
97
+ Detailed [documentations](https://allomorph.readthedocs.io/en/latest/) are hosted by `Read the Docs`.
98
+
99
+ ## Contributing
100
+
101
+ `Sphractal` appreciates your enthusiasm and welcomes your expertise!
102
+
103
+ Please check out the [contributing guidelines](https://github.com/Jon-Ting/allomorph/blob/main/CONTRIBUTING.md) and
104
+ [code of conduct](https://github.com/Jon-Ting/allomorph/blob/main/CONDUCT.md).
105
+ By contributing to this project, you agree to abide by its terms.
106
+
107
+ ## License
108
+
109
+ The project is distributed under an [MIT License](https://github.com/Jon-Ting/allomorph/blob/main/LICENSE).
@@ -0,0 +1,101 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "allomorph"
7
+ version = "0.1.0"
8
+ description = "Toolkit for generating monometallic to trimetallic nanoparticle structural datasets for machine learning."
9
+
10
+ readme = "README.md"
11
+ license = { file = "LICENSE" }
12
+ requires-python = ">=3.9"
13
+ authors = [
14
+ { name = "Jonathan Yik Chang Ting" },
15
+ ]
16
+ keywords = [
17
+ "nanoparticles",
18
+ "machine-learning",
19
+ "materials-science",
20
+ "LAMMPS",
21
+ "EAM",
22
+ "molecular-dynamics",
23
+ ]
24
+ classifiers = [
25
+ "Development Status :: 3 - Alpha",
26
+ "Intended Audience :: Science/Research",
27
+ "License :: OSI Approved :: MIT License",
28
+ "Programming Language :: Python :: 3",
29
+ "Programming Language :: Python :: 3.9",
30
+ "Programming Language :: Python :: 3.10",
31
+ "Programming Language :: Python :: 3.11",
32
+ "Programming Language :: Python :: 3.12",
33
+ "Programming Language :: Python :: 3.13",
34
+ "Topic :: Scientific/Engineering :: Chemistry",
35
+ "Topic :: Scientific/Engineering :: Physics",
36
+ ]
37
+ dependencies = [
38
+ "numpy",
39
+ "pandas",
40
+ "ase",
41
+ "scipy",
42
+ ]
43
+
44
+ [project.optional-dependencies]
45
+ dev = [
46
+ "pytest>=7.0",
47
+ "pytest-cov",
48
+ "ruff",
49
+ "sphinx",
50
+ "sphinx-rtd-theme",
51
+ "myst-parser",
52
+ "myst-nb",
53
+ "sphinx-autoapi",
54
+ "jupyterlab",
55
+ "python-semantic-release",
56
+ ]
57
+
58
+ [project.scripts]
59
+ allomorph = "allomorph.cli:main"
60
+
61
+ [project.urls]
62
+ Homepage = "https://github.com/jonathan-ting/allomorph"
63
+ "Bug Tracker" = "https://github.com/jonathan-ting/allomorph/issues"
64
+
65
+ [tool.hatch.build.targets.wheel]
66
+ packages = ["src/allomorph"]
67
+
68
+ [tool.hatch.build.targets.sdist]
69
+ include = [
70
+ "/src",
71
+ "/tests",
72
+ "/README.md",
73
+ "/LICENSE",
74
+ ]
75
+
76
+ [tool.pytest.ini_options]
77
+ testpaths = ["tests"]
78
+ python_files = ["test_*.py"]
79
+
80
+ [tool.ruff]
81
+ line-length = 120
82
+ target-version = "py39"
83
+
84
+ [tool.ruff.lint]
85
+ select = ["E", "F", "W", "I"]
86
+ ignore = ["E501"]
87
+
88
+ [tool.ruff.lint.pydocstyle]
89
+ convention = "google"
90
+
91
+ [tool.ruff.format]
92
+ preview = true
93
+
94
+ [tool.semantic_release]
95
+ version_toml = [
96
+ "pyproject.toml:project.version"
97
+ ]
98
+ branch = "main"
99
+ upload_to_pypi = true
100
+ upload_to_release = true
101
+ build_command = "pip install build && python -m build"
@@ -0,0 +1,58 @@
1
+ """Nanoparticle structure generation toolkit.
2
+
3
+ A package for generating monometallic to trimetallic nanoparticle structural
4
+ datasets for machine learning applications.
5
+ """
6
+
7
+ __version__ = "0.1.0"
8
+
9
+ from allomorph.constants import (
10
+ BNP_DIR,
11
+ BNP_DISTRIB_LIST,
12
+ DIAMETER_LIST,
13
+ ELE_DICT,
14
+ GOLDEN_RATIO,
15
+ LMP_DATA_DIR,
16
+ MNP_DIR,
17
+ RANDOM_DISTRIB_NO,
18
+ RATIO_LIST,
19
+ SHAPE_LIST,
20
+ TNP_DIR,
21
+ TNP_DISTRIB_LIST,
22
+ VACUUM_THICKNESS,
23
+ load_ele_dict_from_file,
24
+ parse_ele_comb,
25
+ validate_ele_dict,
26
+ )
27
+ from allomorph.init_struct.gen_bnp_al import gen_bnp, write_bnp
28
+ from allomorph.init_struct.gen_bnp_cs import gen_hard_core_shell, write_hard_core_shell
29
+ from allomorph.init_struct.gen_mnp import gen_mnp, write_mnp
30
+ from allomorph.init_struct.gen_tnp_al import gen_tnp, write_tnp
31
+
32
+ __all__ = [
33
+ "__version__",
34
+ "LMP_DATA_DIR",
35
+ "MNP_DIR",
36
+ "BNP_DIR",
37
+ "TNP_DIR",
38
+ "GOLDEN_RATIO",
39
+ "VACUUM_THICKNESS",
40
+ "RANDOM_DISTRIB_NO",
41
+ "ELE_DICT",
42
+ "DIAMETER_LIST",
43
+ "SHAPE_LIST",
44
+ "BNP_DISTRIB_LIST",
45
+ "TNP_DISTRIB_LIST",
46
+ "RATIO_LIST",
47
+ "validate_ele_dict",
48
+ "load_ele_dict_from_file",
49
+ "parse_ele_comb",
50
+ "gen_mnp",
51
+ "write_mnp",
52
+ "gen_bnp",
53
+ "write_bnp",
54
+ "gen_tnp",
55
+ "write_tnp",
56
+ "gen_hard_core_shell",
57
+ "write_hard_core_shell",
58
+ ]
@@ -0,0 +1,4 @@
1
+ from allomorph.cli import main
2
+
3
+ if __name__ == "__main__":
4
+ main()
@@ -0,0 +1,85 @@
1
+ """Command-line interface for AlloMorph."""
2
+
3
+ import argparse
4
+ import sys
5
+
6
+ from allomorph.constants import load_config, update_constants
7
+
8
+
9
+ def main(argv=None):
10
+ """Entry point for the AlloMorph CLI."""
11
+ parser = argparse.ArgumentParser(
12
+ prog="allomorph",
13
+ description="Toolkit for generating monometallic to trimetallic nanoparticle structural datasets.",
14
+ )
15
+ parser.add_argument(
16
+ "--config",
17
+ help="Path to a configuration file (JSON, YAML, or TOML) to override default constants.",
18
+ )
19
+
20
+ # Subcommands
21
+ subparsers = parser.add_subparsers(dest="command", help="Available commands")
22
+
23
+ # init-struct subcommand (Main functionality)
24
+ init_parser = subparsers.add_parser(
25
+ "init-struct",
26
+ help="Generate initial nanoparticle structures.",
27
+ )
28
+ init_parser.add_argument(
29
+ "--stage",
30
+ choices=["mnp", "bnp", "tnp", "cs", "all"],
31
+ default="all",
32
+ help="Which structure generation stage to run (default: all)",
33
+ )
34
+ init_parser.add_argument(
35
+ "--replace",
36
+ action="store_true",
37
+ help="Overwrite existing files.",
38
+ )
39
+ init_parser.add_argument(
40
+ "--vis",
41
+ action="store_true",
42
+ help="Visualise generated structures (opens ASE GUI).",
43
+ )
44
+ init_parser.set_defaults(func=_init_struct_cmd)
45
+
46
+ args = parser.parse_args(argv)
47
+
48
+ if args.config:
49
+ config = load_config(args.config)
50
+ update_constants(config)
51
+
52
+ if args.vis:
53
+ print("Warning: --vis flag enabled. Visualization will run serially to prevent system hang.")
54
+ print("Many windows may be opened sequentially. Close one to see the next.")
55
+
56
+ if args.command is None:
57
+ parser.print_help()
58
+ sys.exit(1)
59
+
60
+ args.func(args)
61
+
62
+
63
+ def _init_struct_cmd(args):
64
+ """Run the initial structure generation command."""
65
+ from allomorph.init_struct.gen_bnp_al import main as gen_bnp_main
66
+ from allomorph.init_struct.gen_bnp_cs import write_hard_core_shell as gen_bnp_cs_main
67
+ from allomorph.init_struct.gen_mnp import main as gen_mnp_main
68
+ from allomorph.init_struct.gen_tnp_al import main as gen_tnp_main
69
+
70
+ if args.stage in ("mnp", "all"):
71
+ print("=== Generating monometallic nanoparticles (MNP) ===")
72
+ gen_mnp_main(replace=args.replace, vis=args.vis)
73
+ if args.stage in ("bnp", "all"):
74
+ print("=== Generating bimetallic nanoparticles (BNP) ===")
75
+ gen_bnp_main(replace=args.replace, vis=args.vis)
76
+ if args.stage in ("cs", "all"):
77
+ print("=== Generating hard core-shell nanoparticles (CS) ===")
78
+ gen_bnp_cs_main(replace=args.replace, vis=args.vis)
79
+ if args.stage in ("tnp", "all"):
80
+ print("=== Generating trimetallic nanoparticles (TNP) ===")
81
+ gen_tnp_main(replace=args.replace, vis=args.vis)
82
+
83
+
84
+ if __name__ == "__main__":
85
+ main()