alomancy 0.1.0.post0__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.
- alomancy-0.1.0.post0/.coverage +0 -0
- alomancy-0.1.0.post0/.github/workflows/ci.yml +214 -0
- alomancy-0.1.0.post0/.gitignore +11 -0
- alomancy-0.1.0.post0/.pre-commit-config.yaml +42 -0
- alomancy-0.1.0.post0/PKG-INFO +346 -0
- alomancy-0.1.0.post0/README.md +297 -0
- alomancy-0.1.0.post0/TESTING.md +314 -0
- alomancy-0.1.0.post0/__init__.py +0 -0
- alomancy-0.1.0.post0/examples/basic_use/basic_use.py +15 -0
- alomancy-0.1.0.post0/examples/basic_use/input_files/standard_config.yaml +51 -0
- alomancy-0.1.0.post0/pyproject.toml +242 -0
- alomancy-0.1.0.post0/pytest.ini +23 -0
- alomancy-0.1.0.post0/requirements.txt +89 -0
- alomancy-0.1.0.post0/run_tests.py +82 -0
- alomancy-0.1.0.post0/setup.cfg +4 -0
- alomancy-0.1.0.post0/src/alomancy/__init__.py +0 -0
- alomancy-0.1.0.post0/src/alomancy/analysis/__init__.py +0 -0
- alomancy-0.1.0.post0/src/alomancy/analysis/mace_analysis.py +136 -0
- alomancy-0.1.0.post0/src/alomancy/configs/__init__.py +0 -0
- alomancy-0.1.0.post0/src/alomancy/configs/config_dictionaries.py +53 -0
- alomancy-0.1.0.post0/src/alomancy/configs/remote_info.py +25 -0
- alomancy-0.1.0.post0/src/alomancy/configs/standard_config.yaml +52 -0
- alomancy-0.1.0.post0/src/alomancy/core/__init__.py +0 -0
- alomancy-0.1.0.post0/src/alomancy/core/base_active_learning.py +251 -0
- alomancy-0.1.0.post0/src/alomancy/core/standard_active_learning.py +200 -0
- alomancy-0.1.0.post0/src/alomancy/high_accuracy_evaluation/dft/__init__.py +0 -0
- alomancy-0.1.0.post0/src/alomancy/high_accuracy_evaluation/dft/qe_remote_submitter.py +58 -0
- alomancy-0.1.0.post0/src/alomancy/high_accuracy_evaluation/dft/run_qe.py +129 -0
- alomancy-0.1.0.post0/src/alomancy/mlip/__init__.py +0 -0
- alomancy-0.1.0.post0/src/alomancy/mlip/committee_remote_submitter.py +51 -0
- alomancy-0.1.0.post0/src/alomancy/mlip/mace_wfl.py +151 -0
- alomancy-0.1.0.post0/src/alomancy/structure_generation/__init__.py +0 -0
- alomancy-0.1.0.post0/src/alomancy/structure_generation/find_high_sd_structures.py +201 -0
- alomancy-0.1.0.post0/src/alomancy/structure_generation/md/__init__.py +0 -0
- alomancy-0.1.0.post0/src/alomancy/structure_generation/md/generate_structures.py +155 -0
- alomancy-0.1.0.post0/src/alomancy/structure_generation/md/md_remote_submitter.py +59 -0
- alomancy-0.1.0.post0/src/alomancy/structure_generation/md/md_wfl.py +216 -0
- alomancy-0.1.0.post0/src/alomancy/structure_generation/select_initial_structures.py +116 -0
- alomancy-0.1.0.post0/src/alomancy/utils/__init__.py +0 -0
- alomancy-0.1.0.post0/src/alomancy/utils/clean_structures.py +24 -0
- alomancy-0.1.0.post0/src/alomancy/utils/remote_job_executor.py +302 -0
- alomancy-0.1.0.post0/src/alomancy/utils/test_train_manager.py +35 -0
- alomancy-0.1.0.post0/src/alomancy/version.py +34 -0
- alomancy-0.1.0.post0/src/alomancy.egg-info/PKG-INFO +346 -0
- alomancy-0.1.0.post0/src/alomancy.egg-info/SOURCES.txt +54 -0
- alomancy-0.1.0.post0/src/alomancy.egg-info/dependency_links.txt +1 -0
- alomancy-0.1.0.post0/src/alomancy.egg-info/requires.txt +31 -0
- alomancy-0.1.0.post0/src/alomancy.egg-info/top_level.txt +1 -0
- alomancy-0.1.0.post0/tests/__init__.py +0 -0
- alomancy-0.1.0.post0/tests/conftest.py +248 -0
- alomancy-0.1.0.post0/tests/core_tests/test_base_active_learning.py +424 -0
- alomancy-0.1.0.post0/tests/core_tests/test_standard_active_learning.py +618 -0
- alomancy-0.1.0.post0/tests/high_acc_tests/test_quantum_espresso.py +470 -0
- alomancy-0.1.0.post0/tests/mlip_train_tests/test_mace_training.py +388 -0
- alomancy-0.1.0.post0/tests/struc_gen_tests/test_structure_generation.py +488 -0
- alomancy-0.1.0.post0/tests/utils_tests/test_utilities.py +362 -0
|
Binary file
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
name: CI/CD Pipeline
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, master, develop ]
|
|
8
|
+
release:
|
|
9
|
+
types: [published]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
lint:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v4
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.10"
|
|
21
|
+
|
|
22
|
+
- name: Cache pip packages
|
|
23
|
+
uses: actions/cache@v3
|
|
24
|
+
with:
|
|
25
|
+
path: ~/.cache/pip
|
|
26
|
+
key: ${{ runner.os }}-pip-lint-${{ hashFiles('**/pyproject.toml') }}
|
|
27
|
+
restore-keys: |
|
|
28
|
+
${{ runner.os }}-pip-lint-
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
python -m pip install --upgrade pip
|
|
33
|
+
pip install ruff mypy
|
|
34
|
+
pip install -e ".[dev]"
|
|
35
|
+
|
|
36
|
+
- name: Lint with ruff
|
|
37
|
+
run: ruff check src tests
|
|
38
|
+
|
|
39
|
+
- name: Check formatting with ruff
|
|
40
|
+
run: ruff format --check src tests
|
|
41
|
+
|
|
42
|
+
- name: Type check with mypy
|
|
43
|
+
run: mypy src/alomancy
|
|
44
|
+
continue-on-error: true # Allow to continue if mypy fails
|
|
45
|
+
|
|
46
|
+
test:
|
|
47
|
+
runs-on: ${{ matrix.os }}
|
|
48
|
+
needs: lint # Run tests after linting passes
|
|
49
|
+
strategy:
|
|
50
|
+
matrix:
|
|
51
|
+
os: [ubuntu-latest, macos-latest]
|
|
52
|
+
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
|
53
|
+
exclude:
|
|
54
|
+
# Exclude some combinations to reduce CI time
|
|
55
|
+
- os: macos-latest
|
|
56
|
+
python-version: "3.9"
|
|
57
|
+
- os: macos-latest
|
|
58
|
+
python-version: "3.11"
|
|
59
|
+
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v4
|
|
62
|
+
|
|
63
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
64
|
+
uses: actions/setup-python@v4
|
|
65
|
+
with:
|
|
66
|
+
python-version: ${{ matrix.python-version }}
|
|
67
|
+
|
|
68
|
+
- name: Cache pip packages
|
|
69
|
+
uses: actions/cache@v3
|
|
70
|
+
with:
|
|
71
|
+
path: ~/.cache/pip
|
|
72
|
+
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/pyproject.toml') }}
|
|
73
|
+
restore-keys: |
|
|
74
|
+
${{ runner.os }}-py${{ matrix.python-version }}-pip-
|
|
75
|
+
|
|
76
|
+
- name: Install dependencies
|
|
77
|
+
run: |
|
|
78
|
+
python -m pip install --upgrade pip
|
|
79
|
+
pip install -e ".[dev]"
|
|
80
|
+
|
|
81
|
+
- name: Test with pytest
|
|
82
|
+
run: |
|
|
83
|
+
pytest --cov=alomancy --cov-report=xml --cov-fail-under=70 -v tests/
|
|
84
|
+
env:
|
|
85
|
+
ALOMANCY_TEST_MODE: "1"
|
|
86
|
+
ALOMANCY_MOCK_EXTERNAL: "1"
|
|
87
|
+
|
|
88
|
+
- name: Upload coverage to Codecov
|
|
89
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
|
|
90
|
+
uses: codecov/codecov-action@v3
|
|
91
|
+
with:
|
|
92
|
+
file: ./coverage.xml
|
|
93
|
+
flags: unittests
|
|
94
|
+
name: codecov-umbrella
|
|
95
|
+
fail_ci_if_error: false
|
|
96
|
+
|
|
97
|
+
integration-test:
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
needs: test
|
|
100
|
+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
|
|
101
|
+
|
|
102
|
+
steps:
|
|
103
|
+
- uses: actions/checkout@v4
|
|
104
|
+
|
|
105
|
+
- name: Set up Python 3.10
|
|
106
|
+
uses: actions/setup-python@v4
|
|
107
|
+
with:
|
|
108
|
+
python-version: "3.10"
|
|
109
|
+
|
|
110
|
+
- name: Cache pip packages
|
|
111
|
+
uses: actions/cache@v3
|
|
112
|
+
with:
|
|
113
|
+
path: ~/.cache/pip
|
|
114
|
+
key: ${{ runner.os }}-integration-pip-${{ hashFiles('**/pyproject.toml') }}
|
|
115
|
+
|
|
116
|
+
- name: Install dependencies
|
|
117
|
+
run: |
|
|
118
|
+
python -m pip install --upgrade pip
|
|
119
|
+
pip install -e ".[dev]"
|
|
120
|
+
|
|
121
|
+
- name: Run integration tests
|
|
122
|
+
run: |
|
|
123
|
+
pytest -m integration tests/ -v
|
|
124
|
+
env:
|
|
125
|
+
ALOMANCY_TEST_MODE: "1"
|
|
126
|
+
ALOMANCY_MOCK_EXTERNAL: "1"
|
|
127
|
+
|
|
128
|
+
build:
|
|
129
|
+
runs-on: ubuntu-latest
|
|
130
|
+
needs: [test, lint]
|
|
131
|
+
if: github.event_name == 'release' || github.event_name == 'push'
|
|
132
|
+
|
|
133
|
+
steps:
|
|
134
|
+
- uses: actions/checkout@v4
|
|
135
|
+
with:
|
|
136
|
+
fetch-depth: 0 # Needed for setuptools_scm
|
|
137
|
+
|
|
138
|
+
- name: Set up Python
|
|
139
|
+
uses: actions/setup-python@v4
|
|
140
|
+
with:
|
|
141
|
+
python-version: "3.10"
|
|
142
|
+
|
|
143
|
+
- name: Install build dependencies
|
|
144
|
+
run: |
|
|
145
|
+
python -m pip install --upgrade pip
|
|
146
|
+
pip install build twine
|
|
147
|
+
|
|
148
|
+
- name: Build package
|
|
149
|
+
run: python -m build
|
|
150
|
+
|
|
151
|
+
- name: Check package
|
|
152
|
+
run: twine check dist/*
|
|
153
|
+
|
|
154
|
+
- name: Upload build artifacts
|
|
155
|
+
uses: actions/upload-artifact@v3
|
|
156
|
+
with:
|
|
157
|
+
name: dist
|
|
158
|
+
path: dist/
|
|
159
|
+
|
|
160
|
+
publish:
|
|
161
|
+
runs-on: ubuntu-latest
|
|
162
|
+
needs: build
|
|
163
|
+
if: github.event_name == 'release'
|
|
164
|
+
environment: release # Use environment protection
|
|
165
|
+
|
|
166
|
+
steps:
|
|
167
|
+
- name: Download build artifacts
|
|
168
|
+
uses: actions/download-artifact@v3
|
|
169
|
+
with:
|
|
170
|
+
name: dist
|
|
171
|
+
path: dist/
|
|
172
|
+
|
|
173
|
+
- name: Publish to PyPI
|
|
174
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
175
|
+
with:
|
|
176
|
+
user: __token__
|
|
177
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
178
|
+
|
|
179
|
+
documentation:
|
|
180
|
+
runs-on: ubuntu-latest
|
|
181
|
+
needs: test
|
|
182
|
+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
|
|
183
|
+
|
|
184
|
+
steps:
|
|
185
|
+
- uses: actions/checkout@v4
|
|
186
|
+
|
|
187
|
+
- name: Set up Python
|
|
188
|
+
uses: actions/setup-python@v4
|
|
189
|
+
with:
|
|
190
|
+
python-version: "3.10"
|
|
191
|
+
|
|
192
|
+
- name: Cache pip packages
|
|
193
|
+
uses: actions/cache@v3
|
|
194
|
+
with:
|
|
195
|
+
path: ~/.cache/pip
|
|
196
|
+
key: ${{ runner.os }}-docs-pip-${{ hashFiles('**/pyproject.toml') }}
|
|
197
|
+
|
|
198
|
+
- name: Install dependencies
|
|
199
|
+
run: |
|
|
200
|
+
python -m pip install --upgrade pip
|
|
201
|
+
pip install -e ".[docs]"
|
|
202
|
+
|
|
203
|
+
- name: Build documentation
|
|
204
|
+
run: |
|
|
205
|
+
cd docs
|
|
206
|
+
make html
|
|
207
|
+
continue-on-error: true
|
|
208
|
+
|
|
209
|
+
- name: Deploy to GitHub Pages
|
|
210
|
+
if: success()
|
|
211
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
212
|
+
with:
|
|
213
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
214
|
+
publish_dir: ./docs/_build/html
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Minimal pre-commit configuration
|
|
2
|
+
repos:
|
|
3
|
+
# General code quality
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
+
rev: v4.5.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: trailing-whitespace
|
|
8
|
+
- id: end-of-file-fixer
|
|
9
|
+
- id: check-merge-conflict
|
|
10
|
+
- id: check-yaml
|
|
11
|
+
- id: check-toml
|
|
12
|
+
- id: debug-statements
|
|
13
|
+
|
|
14
|
+
# Python formatting and linting
|
|
15
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
16
|
+
rev: v0.1.15
|
|
17
|
+
hooks:
|
|
18
|
+
- id: ruff
|
|
19
|
+
args: [--fix]
|
|
20
|
+
- id: ruff-format
|
|
21
|
+
|
|
22
|
+
# Fast unit tests only
|
|
23
|
+
- repo: local
|
|
24
|
+
hooks:
|
|
25
|
+
- id: pytest-unit
|
|
26
|
+
name: Unit tests
|
|
27
|
+
entry: pytest
|
|
28
|
+
language: system
|
|
29
|
+
pass_filenames: false
|
|
30
|
+
always_run: true
|
|
31
|
+
args: [-m, "not integration and not slow", --tb=line, -q, tests/]
|
|
32
|
+
stages: [pre-commit]
|
|
33
|
+
|
|
34
|
+
exclude: |
|
|
35
|
+
(?x)^(
|
|
36
|
+
\.git/|
|
|
37
|
+
__pycache__/|
|
|
38
|
+
build/|
|
|
39
|
+
dist/|
|
|
40
|
+
\.venv/|
|
|
41
|
+
src/alomancy/_?version\.py
|
|
42
|
+
)
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: alomancy
|
|
3
|
+
Version: 0.1.0.post0
|
|
4
|
+
Summary: Active Learning framework for atomistic simulations with flexible workflows and HPC submission.
|
|
5
|
+
Author-email: Julian Holland <holland@fhi.mpg.de>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/julianholland/ALomancy
|
|
8
|
+
Project-URL: Repository, https://github.com/julianholland/ALomancy
|
|
9
|
+
Project-URL: Documentation, https://alomancy.readthedocs.io
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
Requires-Dist: ase>=3.22.0
|
|
22
|
+
Requires-Dist: numpy>=1.21.0
|
|
23
|
+
Requires-Dist: pandas>=1.3.0
|
|
24
|
+
Requires-Dist: pyyaml>=6.0
|
|
25
|
+
Requires-Dist: tqdm>=4.60.0
|
|
26
|
+
Requires-Dist: scipy>=1.7.0
|
|
27
|
+
Requires-Dist: matplotlib>=3.5.0
|
|
28
|
+
Requires-Dist: wfl==0.3.3
|
|
29
|
+
Requires-Dist: expyre-wfl==0.1.6
|
|
30
|
+
Requires-Dist: seaborn>=0.11.0
|
|
31
|
+
Requires-Dist: mace-torch>=0.3.0
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-mock>=3.10; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-xdist>=3.0; extra == "dev"
|
|
37
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
38
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
39
|
+
Requires-Dist: pre-commit>=3.0; extra == "dev"
|
|
40
|
+
Provides-Extra: docs
|
|
41
|
+
Requires-Dist: sphinx>=6.0; extra == "docs"
|
|
42
|
+
Requires-Dist: sphinx-rtd-theme>=1.2; extra == "docs"
|
|
43
|
+
Requires-Dist: sphinxcontrib-napoleon>=0.7; extra == "docs"
|
|
44
|
+
Provides-Extra: test
|
|
45
|
+
Requires-Dist: pytest>=7.0; extra == "test"
|
|
46
|
+
Requires-Dist: pytest-cov>=4.0; extra == "test"
|
|
47
|
+
Requires-Dist: pytest-mock>=3.10; extra == "test"
|
|
48
|
+
Requires-Dist: pytest-xdist>=3.0; extra == "test"
|
|
49
|
+
|
|
50
|
+
<div align="center">
|
|
51
|
+
|
|
52
|
+
</div>
|
|
53
|
+
<div align="center">
|
|
54
|
+
|
|
55
|
+
# `ALomancy` 🔮
|
|
56
|
+
|
|
57
|
+
**Modular Active Learning Workflows for Modern Computational Chemistry**
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
[](https://badge.fury.io/py/alomancy)
|
|
61
|
+
[](https://www.python.org/downloads/)
|
|
62
|
+
[](https://opensource.org/licenses/MIT)
|
|
63
|
+
[](https://github.com/yourusername/ALomnacy/actions)
|
|
64
|
+
[](https://github.com/astral-sh/ruff)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
[Installation](#installation) • [Quick Start](#quick-start) • [Documentation](#documentation) • [Examples](#examples) • [Contributing](#contributing)
|
|
68
|
+
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 🎯 Overview
|
|
74
|
+
|
|
75
|
+
ALomnacy is a Python framework for running active learning (AL) workflows for training machine-learned inter-atomic potentials (MLIPs). This package focusses on customization and reproducibility to build robust training datasets and train MLIPs.
|
|
76
|
+
|
|
77
|
+
### Key Features
|
|
78
|
+
|
|
79
|
+
- 🚀 **Automated AL Workflows**: End-to-end active learning with minimal manual intervention
|
|
80
|
+
- 🔧 **HPC Integration**: Built-in support for remote job submission on HPC clusters
|
|
81
|
+
- **Parallelization**: Ensures that jobs run concurrently where possible
|
|
82
|
+
- 🔄 **Extensible Design**: Abstract base classes for easy customization and extension
|
|
83
|
+
- 📊 **Analysis Tools**: Built-in utilities for monitoring and analyzing AL progress
|
|
84
|
+
|
|
85
|
+
### Workflow Overview
|
|
86
|
+
|
|
87
|
+
```mermaid
|
|
88
|
+
graph LR
|
|
89
|
+
A[Initial Dataset] --> B[Train MLIP Committee]
|
|
90
|
+
B --> C[Generate Structures]
|
|
91
|
+
C --> D[Uncertainty Quantification]
|
|
92
|
+
D --> E[High-Accuracy Evaluation]
|
|
93
|
+
E --> F[Update Dataset]
|
|
94
|
+
F --> B
|
|
95
|
+
|
|
96
|
+
style A fill:#e1f5fe
|
|
97
|
+
style B fill:#f3e5f5
|
|
98
|
+
style C fill:#e8f5e8
|
|
99
|
+
style D fill:#fff3e0
|
|
100
|
+
style E fill:#fce4ec
|
|
101
|
+
style F fill:#f1f8e9
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 🚀 Installation
|
|
105
|
+
|
|
106
|
+
### From PyPI (Recommended)
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
pip install alomancy
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### From Source
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
git clone https://github.com/yourusername/ALomnacy.git
|
|
116
|
+
cd ALomnacy
|
|
117
|
+
pip install -e ".[dev]"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Dependencies
|
|
121
|
+
|
|
122
|
+
- Python 3.9+
|
|
123
|
+
- [ASE](https://wiki.fysik.dtu.dk/ase/) - Atomic Simulation Environment
|
|
124
|
+
- [WFL](https://github.com/libAtoms/workflow) - Workflow for atomistic simulations
|
|
125
|
+
- [Expyre](https://github.com/libAtoms/ExPyRe) - Remote job execution
|
|
126
|
+
|
|
127
|
+
## ⚡ Quick Start
|
|
128
|
+
|
|
129
|
+
### 1. Basic Active Learning Workflow
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
from alomancy.core import StandardActiveLearningWorkflow
|
|
133
|
+
from pathlib import Path
|
|
134
|
+
|
|
135
|
+
# Initialize workflow
|
|
136
|
+
workflow = StandardActiveLearningWorkflow(
|
|
137
|
+
initial_train_file_path="train_set.xyz",
|
|
138
|
+
initial_test_file_path="test_set.xyz",
|
|
139
|
+
config_file_path="config.yaml",
|
|
140
|
+
number_of_al_loops=5,
|
|
141
|
+
verbose=1
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
# Run the active learning workflow
|
|
145
|
+
workflow.run()
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 2. Configuration File
|
|
149
|
+
|
|
150
|
+
Create a `config.yaml` file to specify your computational setup:
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
mlip_committee:
|
|
154
|
+
name: "mace_training"
|
|
155
|
+
size_of_committee: 4
|
|
156
|
+
epochs: 1000
|
|
157
|
+
max_time: "24:00:00"
|
|
158
|
+
hpc:
|
|
159
|
+
hpc_name: "gpu_cluster"
|
|
160
|
+
partitions: ["gpu"]
|
|
161
|
+
pre_cmds: ["module load cuda", "source activate mace"]
|
|
162
|
+
|
|
163
|
+
structure_generation:
|
|
164
|
+
name: "md_generation"
|
|
165
|
+
number_of_concurrent_jobs: 8
|
|
166
|
+
desired_number_of_structures: 100
|
|
167
|
+
max_time: "12:00:00"
|
|
168
|
+
hpc:
|
|
169
|
+
hpc_name: "gpu_cluster"
|
|
170
|
+
partitions: ["gpu"]
|
|
171
|
+
pre_cmds: ["module load cuda", "source activate mace"]
|
|
172
|
+
|
|
173
|
+
high_accuracy_evaluation:
|
|
174
|
+
name: "dft_evaluation"
|
|
175
|
+
max_time: "48:00:00"
|
|
176
|
+
hpc:
|
|
177
|
+
hpc_name: "cpu_cluster"
|
|
178
|
+
partitions: ["cpu"]
|
|
179
|
+
pre_cmds: ["module load quantum-espresso"]
|
|
180
|
+
node_info:
|
|
181
|
+
ranks_per_system: 32
|
|
182
|
+
ranks_per_node: 32
|
|
183
|
+
threads_per_rank: 1
|
|
184
|
+
max_mem_per_node: "128GB"
|
|
185
|
+
pwx_path: "/path/to/pw.x"
|
|
186
|
+
pp_path: "/path/to/pseudopotentials"
|
|
187
|
+
pseudo_dict:
|
|
188
|
+
H: "H.pbe-rrkjus_psl.1.0.0.UPF"
|
|
189
|
+
O: "O.pbe-n-kjpaw_psl.1.0.0.UPF"
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### 3. Custom Workflow Implementation
|
|
193
|
+
|
|
194
|
+
Extend the base class for specialized workflows:
|
|
195
|
+
|
|
196
|
+
```python
|
|
197
|
+
from alomancy.core import BaseActiveLearningWorkflow
|
|
198
|
+
from ase import Atoms
|
|
199
|
+
import pandas as pd
|
|
200
|
+
|
|
201
|
+
class CustomActiveLearningWorkflow(BaseActiveLearningWorkflow):
|
|
202
|
+
|
|
203
|
+
def train_mlip(self, base_name: str, mlip_committee_job_dict: dict, **kwargs):
|
|
204
|
+
"""Custom MLIP training implementation"""
|
|
205
|
+
# Your custom training logic here
|
|
206
|
+
return "path/to/trained/model.pt"
|
|
207
|
+
|
|
208
|
+
def evaluate_mlip(self, mlip_committee_job_dict: dict, **kwargs) -> pd.DataFrame:
|
|
209
|
+
"""Custom model evaluation"""
|
|
210
|
+
# Your evaluation logic here
|
|
211
|
+
return pd.DataFrame({"rmse": [0.1], "mae": [0.05]})
|
|
212
|
+
|
|
213
|
+
def generate_structures(self, base_name: str, job_dict: dict,
|
|
214
|
+
train_data: list[Atoms], **kwargs) -> list[Atoms]:
|
|
215
|
+
"""Custom structure generation"""
|
|
216
|
+
# Your structure generation logic here
|
|
217
|
+
return generated_structures
|
|
218
|
+
|
|
219
|
+
def high_accuracy_evaluation(self, base_name: str,
|
|
220
|
+
high_accuracy_eval_job_dict: dict,
|
|
221
|
+
structures: list[Atoms], **kwargs) -> list[Atoms]:
|
|
222
|
+
"""Custom high-accuracy evaluation"""
|
|
223
|
+
# Your DFT calculation logic here
|
|
224
|
+
return evaluated_structures
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## 📚 Examples
|
|
228
|
+
|
|
229
|
+
Check out the `examples/` directory for complete workflow examples:
|
|
230
|
+
|
|
231
|
+
- **Basic Usage**: Simple active learning workflow setup
|
|
232
|
+
- **Custom HPC Configuration**: Advanced cluster configuration
|
|
233
|
+
- **Analysis Scripts**: Post-processing and visualization tools
|
|
234
|
+
|
|
235
|
+
## 🏗️ Project Structure
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
alomancy/
|
|
239
|
+
├── analysis/ # Analysis and visualization tools
|
|
240
|
+
├── configs/ # Configuration management
|
|
241
|
+
├── core/ # Core active learning framework
|
|
242
|
+
├── high_accuracy_evaluation/ # DFT calculation modules
|
|
243
|
+
├── mlip/ # Machine learning potential training
|
|
244
|
+
├── structure_generation/ # MD and structure generation
|
|
245
|
+
└── utils/ # Utility functions and helpers
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## 🔧 Key Components
|
|
249
|
+
|
|
250
|
+
### Core Framework
|
|
251
|
+
- **BaseActiveLearningWorkflow**: Abstract base class for AL workflows
|
|
252
|
+
- **StandardActiveLearningWorkflow**: Ready-to-use implementation
|
|
253
|
+
|
|
254
|
+
### MLIP Training
|
|
255
|
+
- **MACE Integration**: Committee training with uncertainty quantification
|
|
256
|
+
- **Remote Submission**: HPC job management for GPU-accelerated training
|
|
257
|
+
|
|
258
|
+
### Structure Generation
|
|
259
|
+
- **Molecular Dynamics**: ASE-based MD simulations with MACE potentials
|
|
260
|
+
- **Uncertainty Sampling**: Intelligent structure selection based on model disagreement
|
|
261
|
+
|
|
262
|
+
### High-Accuracy Evaluation
|
|
263
|
+
- **Quantum Espresso**: Automated DFT calculations for reference data
|
|
264
|
+
- **Job Management**: Parallel submission and monitoring of DFT jobs
|
|
265
|
+
|
|
266
|
+
## 📊 Monitoring and Analysis
|
|
267
|
+
|
|
268
|
+
Monitor your AL progress with built-in analysis tools:
|
|
269
|
+
|
|
270
|
+
```python
|
|
271
|
+
from alomancy.analysis import MACEAnalysis
|
|
272
|
+
|
|
273
|
+
# Analyze model performance
|
|
274
|
+
analyzer = MACEAnalysis("results/")
|
|
275
|
+
analyzer.plot_learning_curves()
|
|
276
|
+
analyzer.analyze_uncertainty_evolution()
|
|
277
|
+
analyzer.generate_report()
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## 🤝 Contributing
|
|
281
|
+
|
|
282
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
283
|
+
|
|
284
|
+
### Development Setup
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
# Clone the repository
|
|
288
|
+
git clone https://github.com/yourusername/ALomnacy.git
|
|
289
|
+
cd ALomnacy
|
|
290
|
+
|
|
291
|
+
# Install in development mode
|
|
292
|
+
pip install -e ".[dev]"
|
|
293
|
+
|
|
294
|
+
# Run tests
|
|
295
|
+
pytest
|
|
296
|
+
|
|
297
|
+
# Run linting
|
|
298
|
+
ruff check .
|
|
299
|
+
ruff format .
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Running Tests
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
# Run all tests
|
|
306
|
+
pytest
|
|
307
|
+
|
|
308
|
+
# Run specific test categories
|
|
309
|
+
pytest tests/core_tests/
|
|
310
|
+
pytest tests/mlip_train_tests/
|
|
311
|
+
pytest tests/high_acc_tests/
|
|
312
|
+
|
|
313
|
+
# Run with coverage
|
|
314
|
+
pytest --cov=alomancy
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## 📝 Citation
|
|
318
|
+
|
|
319
|
+
If you use ALomnacy in your research, please cite:
|
|
320
|
+
|
|
321
|
+
```bibtex
|
|
322
|
+
@software{alomancy2025,
|
|
323
|
+
title={ALomnacy: Modular Active Learning Workflows for Modern Computational Chemistry},
|
|
324
|
+
author={Julian Holland},
|
|
325
|
+
year={2025},
|
|
326
|
+
url={https://github.com/yourusername/ALomnacy},
|
|
327
|
+
version={0.1.0}
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
## 📄 License
|
|
332
|
+
|
|
333
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
334
|
+
|
|
335
|
+
## 🙏 Acknowledgments
|
|
336
|
+
|
|
337
|
+
- The Fritz Haber Institute
|
|
338
|
+
|
|
339
|
+
## 📞 Support
|
|
340
|
+
|
|
341
|
+
- 📖 **Documentation**: [Link to docs]
|
|
342
|
+
- 🐛 **Bug Reports**: [GitHub Issues](https://github.com/yourusername/ALomnacy/issues)
|
|
343
|
+
- 💬 **Discussions**: [GitHub Discussions](https://github.com/yourusername/ALomnacy/discussions)
|
|
344
|
+
- 📧 **Email**: holland@fhi.mpg.de
|
|
345
|
+
|
|
346
|
+
---
|