cavotf 0.1.7.12.25__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.
Files changed (30) hide show
  1. cavotf-0.1.7.12.25/MANIFEST.in +2 -0
  2. cavotf-0.1.7.12.25/PKG-INFO +94 -0
  3. cavotf-0.1.7.12.25/README.md +82 -0
  4. cavotf-0.1.7.12.25/cavotf/__init__.py +5 -0
  5. cavotf-0.1.7.12.25/cavotf/__main__.py +4 -0
  6. cavotf-0.1.7.12.25/cavotf/cli.py +97 -0
  7. cavotf-0.1.7.12.25/cavotf/config.py +403 -0
  8. cavotf-0.1.7.12.25/cavotf/dftb.py +59 -0
  9. cavotf-0.1.7.12.25/cavotf/dynamics.py +153 -0
  10. cavotf-0.1.7.12.25/cavotf/geometry.py +74 -0
  11. cavotf-0.1.7.12.25/cavotf/hpc.py +93 -0
  12. cavotf-0.1.7.12.25/cavotf/resources/DFTB_clean/__init__.py +0 -0
  13. cavotf-0.1.7.12.25/cavotf/resources/DFTB_clean/cavityDFTB.slurm +14 -0
  14. cavotf-0.1.7.12.25/cavotf/resources/DFTB_clean/client_DFTB.py +374 -0
  15. cavotf-0.1.7.12.25/cavotf/resources/DFTB_clean/client_DFTB_extend.py +322 -0
  16. cavotf-0.1.7.12.25/cavotf/resources/DFTB_clean/dftb.py +118 -0
  17. cavotf-0.1.7.12.25/cavotf/resources/DFTB_clean/funcLM.py +101 -0
  18. cavotf-0.1.7.12.25/cavotf/resources/DFTB_clean/get_mu.py +116 -0
  19. cavotf-0.1.7.12.25/cavotf/resources/DFTB_clean/muDFTB.slurm +33 -0
  20. cavotf-0.1.7.12.25/cavotf/resources/__init__.py +15 -0
  21. cavotf-0.1.7.12.25/cavotf/server_DFTB.py +223 -0
  22. cavotf-0.1.7.12.25/cavotf/workflow.py +90 -0
  23. cavotf-0.1.7.12.25/cavotf.egg-info/PKG-INFO +94 -0
  24. cavotf-0.1.7.12.25/cavotf.egg-info/SOURCES.txt +28 -0
  25. cavotf-0.1.7.12.25/cavotf.egg-info/dependency_links.txt +1 -0
  26. cavotf-0.1.7.12.25/cavotf.egg-info/entry_points.txt +2 -0
  27. cavotf-0.1.7.12.25/cavotf.egg-info/requires.txt +3 -0
  28. cavotf-0.1.7.12.25/cavotf.egg-info/top_level.txt +1 -0
  29. cavotf-0.1.7.12.25/pyproject.toml +29 -0
  30. cavotf-0.1.7.12.25/setup.cfg +4 -0
@@ -0,0 +1,2 @@
1
+ include README.md
2
+ recursive-include cavotf/resources *
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: cavotf
3
+ Version: 0.1.7.12.25
4
+ Summary: cavOTF.py Package
5
+ Author: Sachith Wickramasinghe, Amir H. Amini, Arkajit Mandal
6
+ License: MIT
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: numpy
10
+ Requires-Dist: scipy
11
+ Requires-Dist: ase
12
+
13
+ # cavOTF
14
+ **Sachith Wickramasinghe, Amir H. Amini**
15
+
16
+
17
+ <p align="center">
18
+ <img src="/logo.png" alt="CavityOTF" width="300"/>
19
+ </p>
20
+
21
+ Development code: https://github.com/msachithpw/cavityDFTB
22
+
23
+ **cavOTF** is a highly customizable molecular dynamics package based on DFTB+ (Density Functional Tight Binding) for simulating cavity systems. Due to the computational intensity and long runtimes, this package is designed for use on High Performance Computing (HPC) systems.
24
+
25
+ ## Installation
26
+
27
+ Before installing **cavOTF**, ensure that you have a clean DFTB+ installation in your environment. For instructions, refer to the [DFTB+ Installation Guide](https://dftbplus-recipes.readthedocs.io/en/latest/introduction.html). We recommend installing DFTB+ using the **Anaconda** package manager within a separate environment dedicated solely to DFTB+. Avoid using pre-compiled DFTB+ binaries as they may significantly reduce the performance of your calculations. **cavOTF** has been tested with the **no MPI** version of DFTB+, so it is advisable to use this version, as `numpy` and/or `scipy` may have compatibility issues with some MPI installations.
28
+
29
+ The package uses the **setuptools** build system and includes most required Python modules and resource templates. Ensure you have an up-to-date version of `setuptools` before installation.
30
+
31
+ To install **cavOTF**, clone the repository and run:
32
+
33
+ ```bash
34
+ pip install .
35
+ ```
36
+
37
+ Alternatively, you can install directly from the repository:
38
+
39
+ ```bash
40
+ pip install git+https://github.com/mandalgrouptamu/cavOTF.git
41
+ ```
42
+
43
+ ### Available Entry Points
44
+
45
+ Once installed, you can use the following commands:
46
+
47
+ - `cavotf --config input.txt validate` — Perform a dry-run validation without submitting jobs.
48
+ - `cavotf --config input.txt run` — Execute the full workflow, including sbatch job submissions.
49
+ - `python -m cavotf --config input.txt ...` — Invoke the module programmatically, equivalent to the CLI.
50
+
51
+ ## Quickstart
52
+
53
+ 1. Copy the `input.txt.example` file and modify the paths and parameters according to your system. Detailed descriptions of input options are provided within the file.
54
+ 2. Ensure your geometry directory contains one subfolder per trajectory seed, with corresponding coordinate (`init_xyz_file`) and velocity (`init_vel_file`) files.
55
+ 3. Run the following command to validate the sbatch scripts and ensure that the run directories will be created correctly:
56
+ ```bash
57
+ cavotf --config input.txt validate
58
+ ```
59
+ 4. Execute the full workflow with:
60
+ ```bash
61
+ cavotf --config input.txt run
62
+ ```
63
+ This will create the necessary run folders, initialize the cavity coordinates, and submit the required jobs through Slurm.
64
+ 5. Optionally, modify the provided sbatch template to fit your cluster’s requirements. We recommend using the maximum allowable wall time to ensure the simulations run smoothly.
65
+
66
+ <!-- During execution, **cavOTF** will:
67
+
68
+ - Parse the configuration file into strongly-typed dataclasses (located in `cavotf.config`).
69
+ - Prepare the run directories and copy the seed geometries (handled by `cavotf.geometry`).
70
+ - Build the DFTB+ input files and multiprog definitions for dipole collection and dynamics (using `cavotf.dftb`).
71
+ - Render Slurm sbatch scripts, incorporating any custom template provided (`cavotf.hpc`).
72
+ - Initialize cavity coordinates based on generated dipoles before launching dynamics simulations (`cavotf.dynamics`). -->
73
+
74
+ ## Configuration Overview
75
+
76
+ The `input.txt.example` file provides an example configuration, including all supported keys. Key sections include:
77
+
78
+ - **[general]** — Specifies the geometry path, initial coordinate/velocity filenames and optional overrides for bundled `DFTB_clean` templates. Modifications to the `DFTB_clean` folder should be done cautiously.
79
+ - **[physics]** — Defines the number of clients (`nk`), cavity parameters (`beta`, `lambda`, `omega_c`, `eta_b`), thermostat controls, dipole derivative options, and thermalization steps for cavity initialization.
80
+ - **[outputs]** — Controls for logfile and results generation, k-space tracking, and client-side outputs such as `qt.dat` and trajectory histograms.
81
+ - **[dftb]** — Override ASE DFTB+ calculator settings. Set values to `off` or `none` to omit default lines. The provided defaults are configured for a 99-atom water simulation, so modify these as needed.
82
+ - **[hpc]** — Slurm integration details, including CPUs per task, partition/account, DFTB+ prefix/command, sbatch template path, walltime, and memory requirements. Ensure sufficient memory allocation to prevent out-of-memory (OOM) issues.
83
+
84
+ <!-- Refer to `docs/USAGE.md` for a more detailed walkthrough of how these settings are parsed and utilized throughout the workflow. -->
85
+
86
+ <!-- ## Bundled Resources
87
+
88
+ The package includes the default `DFTB_clean` templates and `server_DFTB.py`, making these resources available even when running from an installed package. You can override the template directory via the `clean_template_dir` option in the `[general]` section if custom DFTB+ input files are required. -->
89
+
90
+ ---
91
+
92
+ **Authors:**
93
+ Sachith Wickramasinghe, Amir H. Amini, Arkajit Mandal
94
+ November 2025, Chemistry Department, Texas A&M University
@@ -0,0 +1,82 @@
1
+ # cavOTF
2
+ **Sachith Wickramasinghe, Amir H. Amini**
3
+
4
+
5
+ <p align="center">
6
+ <img src="/logo.png" alt="CavityOTF" width="300"/>
7
+ </p>
8
+
9
+ Development code: https://github.com/msachithpw/cavityDFTB
10
+
11
+ **cavOTF** is a highly customizable molecular dynamics package based on DFTB+ (Density Functional Tight Binding) for simulating cavity systems. Due to the computational intensity and long runtimes, this package is designed for use on High Performance Computing (HPC) systems.
12
+
13
+ ## Installation
14
+
15
+ Before installing **cavOTF**, ensure that you have a clean DFTB+ installation in your environment. For instructions, refer to the [DFTB+ Installation Guide](https://dftbplus-recipes.readthedocs.io/en/latest/introduction.html). We recommend installing DFTB+ using the **Anaconda** package manager within a separate environment dedicated solely to DFTB+. Avoid using pre-compiled DFTB+ binaries as they may significantly reduce the performance of your calculations. **cavOTF** has been tested with the **no MPI** version of DFTB+, so it is advisable to use this version, as `numpy` and/or `scipy` may have compatibility issues with some MPI installations.
16
+
17
+ The package uses the **setuptools** build system and includes most required Python modules and resource templates. Ensure you have an up-to-date version of `setuptools` before installation.
18
+
19
+ To install **cavOTF**, clone the repository and run:
20
+
21
+ ```bash
22
+ pip install .
23
+ ```
24
+
25
+ Alternatively, you can install directly from the repository:
26
+
27
+ ```bash
28
+ pip install git+https://github.com/mandalgrouptamu/cavOTF.git
29
+ ```
30
+
31
+ ### Available Entry Points
32
+
33
+ Once installed, you can use the following commands:
34
+
35
+ - `cavotf --config input.txt validate` — Perform a dry-run validation without submitting jobs.
36
+ - `cavotf --config input.txt run` — Execute the full workflow, including sbatch job submissions.
37
+ - `python -m cavotf --config input.txt ...` — Invoke the module programmatically, equivalent to the CLI.
38
+
39
+ ## Quickstart
40
+
41
+ 1. Copy the `input.txt.example` file and modify the paths and parameters according to your system. Detailed descriptions of input options are provided within the file.
42
+ 2. Ensure your geometry directory contains one subfolder per trajectory seed, with corresponding coordinate (`init_xyz_file`) and velocity (`init_vel_file`) files.
43
+ 3. Run the following command to validate the sbatch scripts and ensure that the run directories will be created correctly:
44
+ ```bash
45
+ cavotf --config input.txt validate
46
+ ```
47
+ 4. Execute the full workflow with:
48
+ ```bash
49
+ cavotf --config input.txt run
50
+ ```
51
+ This will create the necessary run folders, initialize the cavity coordinates, and submit the required jobs through Slurm.
52
+ 5. Optionally, modify the provided sbatch template to fit your cluster’s requirements. We recommend using the maximum allowable wall time to ensure the simulations run smoothly.
53
+
54
+ <!-- During execution, **cavOTF** will:
55
+
56
+ - Parse the configuration file into strongly-typed dataclasses (located in `cavotf.config`).
57
+ - Prepare the run directories and copy the seed geometries (handled by `cavotf.geometry`).
58
+ - Build the DFTB+ input files and multiprog definitions for dipole collection and dynamics (using `cavotf.dftb`).
59
+ - Render Slurm sbatch scripts, incorporating any custom template provided (`cavotf.hpc`).
60
+ - Initialize cavity coordinates based on generated dipoles before launching dynamics simulations (`cavotf.dynamics`). -->
61
+
62
+ ## Configuration Overview
63
+
64
+ The `input.txt.example` file provides an example configuration, including all supported keys. Key sections include:
65
+
66
+ - **[general]** — Specifies the geometry path, initial coordinate/velocity filenames and optional overrides for bundled `DFTB_clean` templates. Modifications to the `DFTB_clean` folder should be done cautiously.
67
+ - **[physics]** — Defines the number of clients (`nk`), cavity parameters (`beta`, `lambda`, `omega_c`, `eta_b`), thermostat controls, dipole derivative options, and thermalization steps for cavity initialization.
68
+ - **[outputs]** — Controls for logfile and results generation, k-space tracking, and client-side outputs such as `qt.dat` and trajectory histograms.
69
+ - **[dftb]** — Override ASE DFTB+ calculator settings. Set values to `off` or `none` to omit default lines. The provided defaults are configured for a 99-atom water simulation, so modify these as needed.
70
+ - **[hpc]** — Slurm integration details, including CPUs per task, partition/account, DFTB+ prefix/command, sbatch template path, walltime, and memory requirements. Ensure sufficient memory allocation to prevent out-of-memory (OOM) issues.
71
+
72
+ <!-- Refer to `docs/USAGE.md` for a more detailed walkthrough of how these settings are parsed and utilized throughout the workflow. -->
73
+
74
+ <!-- ## Bundled Resources
75
+
76
+ The package includes the default `DFTB_clean` templates and `server_DFTB.py`, making these resources available even when running from an installed package. You can override the template directory via the `clean_template_dir` option in the `[general]` section if custom DFTB+ input files are required. -->
77
+
78
+ ---
79
+
80
+ **Authors:**
81
+ Sachith Wickramasinghe, Amir H. Amini, Arkajit Mandal
82
+ November 2025, Chemistry Department, Texas A&M University
@@ -0,0 +1,5 @@
1
+ from .config import Config, OutputConfig, load_config
2
+ from .workflow import run_workflow, validate_workflow
3
+
4
+ __all__ = ["Config", "OutputConfig", "load_config", "run_workflow", "validate_workflow"]
5
+ __version__ = "0.1.5.12.25"
@@ -0,0 +1,4 @@
1
+ from .cli import main
2
+
3
+ if __name__ == "__main__":
4
+ main()
@@ -0,0 +1,97 @@
1
+ # =============================================================================
2
+ # Project: cavOTF.py
3
+ # File: cli.py
4
+ # Author: Amir H. Amini <amiramini@tamu.edu>
5
+ # Last update: 11/28/2025
6
+ #
7
+ # Description:
8
+ # Command-line interface for cavOTF.py simulations, including argument
9
+ # parsing and workflow execution.
10
+ # =============================================================================
11
+
12
+ from __future__ import annotations
13
+
14
+ import time
15
+ import sys
16
+
17
+ import argparse
18
+ import logging
19
+ from pathlib import Path
20
+ from typing import Optional
21
+
22
+ from .config import ConfigError, load_config
23
+ from .workflow import run_workflow, validate_workflow
24
+
25
+
26
+ LOG_LEVELS = {
27
+ "DEBUG": logging.DEBUG,
28
+ "INFO": logging.INFO,
29
+ "WARNING": logging.WARNING,
30
+ "ERROR": logging.ERROR,
31
+ }
32
+
33
+
34
+ def _print_banner() -> None:
35
+ banner = r"""
36
+ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
37
+ ╔═══════════════════════════════════════════════════════╗
38
+ ║ ██████╗ █████╗ ██╗ ██╗ ██████╗ ████████╗███████╗ ║
39
+ ║ ██╔════╝██╔══██╗██║ ██║██╔═══██╗╚══██╔══╝██╔════╝ ║
40
+ ║ ██║ ███████║██║ ██║██║ ██║ ██║ █████╗ ║
41
+ ║ ██║ ██╔══██║╚██╗ ██╔╝██║ ██║ ██║ ██╔══╝ ║
42
+ ║ ╚██████╗██║ ██║ ╚████╔╝ ╚██████╔╝ ██║ ██║ ║
43
+ ║ ╚═════╝╚═╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ║
44
+ ╠═══════════════════════════════════════════════════════╣
45
+ ║ Mandal Group, Texas A&M University • 2025 ║
46
+ ╚═══════════════════════════════════════════════════════╝
47
+ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
48
+ """
49
+ for line in banner.splitlines():
50
+ print(line)
51
+ sys.stdout.flush()
52
+ time.sleep(0.05) # adjust speed (seconds per line)
53
+
54
+
55
+
56
+ def _configure_logging(verbose: bool) -> None:
57
+ level = logging.DEBUG if verbose else logging.INFO
58
+ logging.basicConfig(level=level, format="[%(levelname)s] %(message)s")
59
+
60
+
61
+ def _parse_args(args: Optional[list[str]] = None) -> argparse.Namespace:
62
+ parser = argparse.ArgumentParser(description="CAVOTF cavity MD workflow runner")
63
+ parser.add_argument("--config", required=True, type=Path, help="Path to input.txt configuration file")
64
+ parser.add_argument("--verbose", action="store_true", help="Enable verbose logging")
65
+
66
+ subparsers = parser.add_subparsers(dest="command", required=True)
67
+
68
+ run_parser = subparsers.add_parser("run", help="Execute the workflow")
69
+ run_parser.set_defaults(command="run")
70
+
71
+ validate_parser = subparsers.add_parser("validate", help="Validate configuration and print planned actions")
72
+ validate_parser.set_defaults(command="validate")
73
+
74
+ return parser.parse_args(args)
75
+
76
+
77
+ def main(argv: Optional[list[str]] = None) -> None:
78
+ _print_banner()
79
+ args = _parse_args(argv)
80
+ _configure_logging(args.verbose)
81
+
82
+ try:
83
+ config = load_config(args.config)
84
+ except ConfigError as exc: # noqa: BLE001
85
+ logging.error("Configuration error: %s", exc)
86
+ raise SystemExit(1) from exc
87
+
88
+ if args.command == "validate":
89
+ validate_workflow(config)
90
+ elif args.command == "run":
91
+ run_workflow(config)
92
+ else: # pragma: no cover - argparse ensures coverage
93
+ raise SystemExit(f"Unknown command: {args.command}")
94
+
95
+
96
+ if __name__ == "__main__":
97
+ main()