active-learning-step 2026.10.14__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 (80) hide show
  1. active_learning_step-2026.10.14/AUTHORS.rst +5 -0
  2. active_learning_step-2026.10.14/CONTRIBUTING.rst +113 -0
  3. active_learning_step-2026.10.14/HISTORY.rst +28 -0
  4. active_learning_step-2026.10.14/LICENSE +31 -0
  5. active_learning_step-2026.10.14/MANIFEST.in +14 -0
  6. active_learning_step-2026.10.14/PKG-INFO +140 -0
  7. active_learning_step-2026.10.14/README.rst +62 -0
  8. active_learning_step-2026.10.14/active_learning_step/__init__.py +34 -0
  9. active_learning_step-2026.10.14/active_learning_step/_version.py +21 -0
  10. active_learning_step-2026.10.14/active_learning_step/active_learning.py +209 -0
  11. active_learning_step-2026.10.14/active_learning_step/active_learning_parameters.py +120 -0
  12. active_learning_step-2026.10.14/active_learning_step/active_learning_step.py +95 -0
  13. active_learning_step-2026.10.14/active_learning_step/check.py +928 -0
  14. active_learning_step-2026.10.14/active_learning_step/cli.py +468 -0
  15. active_learning_step-2026.10.14/active_learning_step/committee.py +774 -0
  16. active_learning_step-2026.10.14/active_learning_step/covalent_radii.py +131 -0
  17. active_learning_step-2026.10.14/active_learning_step/data/properties.csv +1 -0
  18. active_learning_step-2026.10.14/active_learning_step/data/references.bib +40 -0
  19. active_learning_step-2026.10.14/active_learning_step/engine.py +585 -0
  20. active_learning_step-2026.10.14/active_learning_step/lammps_data.py +147 -0
  21. active_learning_step-2026.10.14/active_learning_step/metadata.py +145 -0
  22. active_learning_step-2026.10.14/active_learning_step/molecules.py +279 -0
  23. active_learning_step-2026.10.14/active_learning_step/pool.py +252 -0
  24. active_learning_step-2026.10.14/active_learning_step/samplers.py +171 -0
  25. active_learning_step-2026.10.14/active_learning_step/score.py +284 -0
  26. active_learning_step-2026.10.14/active_learning_step/selection.py +550 -0
  27. active_learning_step-2026.10.14/active_learning_step/substep.py +99 -0
  28. active_learning_step-2026.10.14/active_learning_step/threads.py +74 -0
  29. active_learning_step-2026.10.14/active_learning_step/thresholds.py +168 -0
  30. active_learning_step-2026.10.14/active_learning_step/tk_active_learning.py +209 -0
  31. active_learning_step-2026.10.14/active_learning_step/train.py +588 -0
  32. active_learning_step-2026.10.14/active_learning_step.egg-info/PKG-INFO +140 -0
  33. active_learning_step-2026.10.14/active_learning_step.egg-info/SOURCES.txt +79 -0
  34. active_learning_step-2026.10.14/active_learning_step.egg-info/dependency_links.txt +1 -0
  35. active_learning_step-2026.10.14/active_learning_step.egg-info/entry_points.txt +8 -0
  36. active_learning_step-2026.10.14/active_learning_step.egg-info/requires.txt +8 -0
  37. active_learning_step-2026.10.14/active_learning_step.egg-info/top_level.txt +1 -0
  38. active_learning_step-2026.10.14/active_learning_step.egg-info/zip-safe +1 -0
  39. active_learning_step-2026.10.14/docs/Makefile +177 -0
  40. active_learning_step-2026.10.14/docs/_static/SEAMM Inverted 288x181.png +0 -0
  41. active_learning_step-2026.10.14/docs/_static/SEAMM logo.png +0 -0
  42. active_learning_step-2026.10.14/docs/_static/molssi_main_logo.png +0 -0
  43. active_learning_step-2026.10.14/docs/_static/molssi_main_logo_inverted_white.png +0 -0
  44. active_learning_step-2026.10.14/docs/_static/molssi_square.png +0 -0
  45. active_learning_step-2026.10.14/docs/_static/nsf.png +0 -0
  46. active_learning_step-2026.10.14/docs/api/index.rst +17 -0
  47. active_learning_step-2026.10.14/docs/authors.rst +1 -0
  48. active_learning_step-2026.10.14/docs/conf.py +310 -0
  49. active_learning_step-2026.10.14/docs/developer_guide/campaigns/YYYY-MM-DD/index.rst +16 -0
  50. active_learning_step-2026.10.14/docs/developer_guide/campaigns/index.rst +17 -0
  51. active_learning_step-2026.10.14/docs/developer_guide/contributing.rst +1 -0
  52. active_learning_step-2026.10.14/docs/developer_guide/index.rst +28 -0
  53. active_learning_step-2026.10.14/docs/developer_guide/installation.rst +54 -0
  54. active_learning_step-2026.10.14/docs/developer_guide/usage.rst +23 -0
  55. active_learning_step-2026.10.14/docs/getting_started/index.rst +36 -0
  56. active_learning_step-2026.10.14/docs/history.rst +1 -0
  57. active_learning_step-2026.10.14/docs/index.rst +79 -0
  58. active_learning_step-2026.10.14/docs/make.bat +242 -0
  59. active_learning_step-2026.10.14/docs/user_guide/index.rst +20 -0
  60. active_learning_step-2026.10.14/docs/user_guide/seamm_al.rst +223 -0
  61. active_learning_step-2026.10.14/requirements.txt +5 -0
  62. active_learning_step-2026.10.14/requirements_dev.txt +10 -0
  63. active_learning_step-2026.10.14/requirements_install.txt +4 -0
  64. active_learning_step-2026.10.14/setup.cfg +27 -0
  65. active_learning_step-2026.10.14/setup.py +95 -0
  66. active_learning_step-2026.10.14/tests/__init__.py +3 -0
  67. active_learning_step-2026.10.14/tests/data/seamm_pool.sdf +109 -0
  68. active_learning_step-2026.10.14/tests/test_active_learning_step.py +19 -0
  69. active_learning_step-2026.10.14/tests/test_check.py +466 -0
  70. active_learning_step-2026.10.14/tests/test_committee.py +532 -0
  71. active_learning_step-2026.10.14/tests/test_engine.py +192 -0
  72. active_learning_step-2026.10.14/tests/test_folds.py +73 -0
  73. active_learning_step-2026.10.14/tests/test_lammps_data.py +92 -0
  74. active_learning_step-2026.10.14/tests/test_molecules.py +166 -0
  75. active_learning_step-2026.10.14/tests/test_molsystem_rule.py +178 -0
  76. active_learning_step-2026.10.14/tests/test_samplers.py +115 -0
  77. active_learning_step-2026.10.14/tests/test_select.py +408 -0
  78. active_learning_step-2026.10.14/tests/test_threads.py +39 -0
  79. active_learning_step-2026.10.14/tests/test_train.py +350 -0
  80. active_learning_step-2026.10.14/versioneer.py +1883 -0
@@ -0,0 +1,5 @@
1
+ Development Team
2
+ ----------------
3
+
4
+ * Paul Saxe <psaxe@molssi.org> (Lead)
5
+ * Why don't you join the team? Become a contributor!
@@ -0,0 +1,113 @@
1
+ .. highlight:: shell
2
+
3
+ ============
4
+ Contributing
5
+ ============
6
+
7
+ Contributions are welcome, and they are greatly appreciated! Every
8
+ little bit helps, and credit will always be given.
9
+
10
+ You can contribute in many ways:
11
+
12
+ Types of Contributions
13
+ ----------------------
14
+
15
+ Report Bugs
16
+ ~~~~~~~~~~~
17
+
18
+ Report bugs at https://github.com/molssi-seamm/active_learning_step/issues.
19
+
20
+ If you are reporting a bug, please include:
21
+
22
+ * Your operating system name and version.
23
+ * Any details about your local setup that might be helpful in troubleshooting.
24
+ * Detailed steps to reproduce the bug.
25
+
26
+ Fix Bugs
27
+ ~~~~~~~~
28
+
29
+ Look through the GitHub issues for bugs. Anything tagged with "bug"
30
+ and "help wanted" is open to whoever wants to implement it.
31
+
32
+ Implement Features
33
+ ~~~~~~~~~~~~~~~~~~
34
+
35
+ Look through the GitHub issues for features. Anything tagged with "enhancement"
36
+ and "help wanted" is open to whoever wants to implement it.
37
+
38
+ Write Documentation
39
+ ~~~~~~~~~~~~~~~~~~~
40
+
41
+ Active Learning Step could always use more documentation, whether as part of the
42
+ official Active Learning Step docs, in docstrings, or even on the web in blog posts,
43
+ articles, and such.
44
+
45
+ Submit Feedback
46
+ ~~~~~~~~~~~~~~~
47
+
48
+ The best way to send feedback is to file an issue at https://github.com/molssi-seamm/active_learning_step/issues.
49
+
50
+ If you are proposing a feature:
51
+
52
+ * Explain in detail how it would work.
53
+ * Keep the scope as narrow as possible, to make it easier to implement.
54
+ * Remember that this is a volunteer-driven project, and that contributions
55
+ are welcome :)
56
+
57
+ Get Started!
58
+ ------------
59
+
60
+ Ready to contribute? Here's how to set up `active_learning_step` for local development.
61
+
62
+ 1. Fork the `active_learning_step` repo on GitHub.
63
+ 2. Clone your fork locally::
64
+
65
+ $ git clone git@github.com:your_name_here/active_learning_step.git
66
+
67
+ 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
68
+
69
+ $ mkvirtualenv active_learning_step
70
+ $ cd active_learning_step/
71
+ $ python setup.py develop
72
+
73
+ 4. Create a branch for local development::
74
+
75
+ $ git checkout -b name-of-your-bugfix-or-feature
76
+
77
+ Now you can make your changes locally.
78
+
79
+ 5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::
80
+
81
+ $ flake8 active_learning_step tests
82
+ $ python setup.py test or py.test
83
+ $ tox
84
+
85
+ To get flake8 and tox, just pip install them into your virtualenv.
86
+
87
+ 6. Commit your changes and push your branch to GitHub::
88
+
89
+ $ git add .
90
+ $ git commit -m "Your detailed description of your changes."
91
+ $ git push origin name-of-your-bugfix-or-feature
92
+
93
+ 7. Submit a pull request through the GitHub website.
94
+
95
+ Pull Request Guidelines
96
+ -----------------------
97
+
98
+ Before you submit a pull request, check that it meets these guidelines:
99
+
100
+ 1. The pull request should include tests.
101
+ 2. If the pull request adds functionality, the docs should be updated. Put
102
+ your new functionality into a function with a docstring, and add the
103
+ feature to the list in README.rst.
104
+ 3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for PyPy. Check
105
+ https://travis-ci.org/molssi-seamm/active_learning_step/pull_requests
106
+ and make sure that the tests pass for all supported Python versions.
107
+
108
+ Tips
109
+ ----
110
+
111
+ To run a subset of tests::
112
+
113
+ $ py.test tests.test_active_learning_step
@@ -0,0 +1,28 @@
1
+ =======
2
+ History
3
+ =======
4
+
5
+ 2026.10.14 -- Initial release: query-by-committee active learning for MLFFs
6
+ * A committee of machine-learned force fields, trained on different folds of the
7
+ data, disagrees where the model is likely wrong; the seamm-al command uses that
8
+ disagreement to choose what to label next. This first release provides the
9
+ library and the command line; the SEAMM flowchart step is a placeholder.
10
+ * seamm-al score: the committee's spreads (energy, forces, the largest per-atom
11
+ force spread, atomic and molecular pressure) for every frame of extxyz or SEAMM
12
+ SDF pools, with the total charge passed to the models. Molecules follow SEAMM's
13
+ own rule (molsystem's bond perception, ions on their own), applied without
14
+ SEAMM in MLFF environments, or a SEAMM structure's own bonds.
15
+ * seamm-al select: rank the frames, or keep those past thresholds, and take them
16
+ within a core-hour budget, with costs per kind or group, caps per column and
17
+ exclusions; or draw at random (optionally stratified) before any committee
18
+ exists. The chosen frames are copied byte for byte from the input files.
19
+ * seamm-al train: train the k members of a committee from an xnn recipe, with
20
+ stratified folds, a fixed share of cell batches and a manifest of the folds,
21
+ seeds, data and code versions. Requires xnn 0.13 or later.
22
+ * seamm-al check: whether the spreads predict the out-of-fold errors (Spearman
23
+ correlations, threshold calibration) and the health of each member (losses,
24
+ errors, leave-one-out spreads), with an option to drop a member.
25
+ * seamm-al engine: the committee mean as one MDI engine for LAMMPS, writing the
26
+ spreads every N steps and flagging frames past a threshold.
27
+ * seamm-al data: check a LAMMPS data file for what atom_style atomic can read.
28
+
@@ -0,0 +1,31 @@
1
+
2
+ BSD 3-Clause License
3
+
4
+ Copyright (c) 2026, Paul Saxe
5
+ All rights reserved.
6
+
7
+ Redistribution and use in source and binary forms, with or without
8
+ modification, are permitted provided that the following conditions are met:
9
+
10
+ 1. Redistributions of source code must retain the above copyright notice, this
11
+ list of conditions and the following disclaimer.
12
+
13
+ 2. Redistributions in binary form must reproduce the above copyright notice,
14
+ this list of conditions and the following disclaimer in the documentation
15
+ and/or other materials provided with the distribution.
16
+
17
+ 3. Neither the name of the copyright holder nor the names of its
18
+ contributors may be used to endorse or promote products derived from
19
+ this software without specific prior written permission.
20
+
21
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+
@@ -0,0 +1,14 @@
1
+ include AUTHORS.rst
2
+ include CONTRIBUTING.rst
3
+ include HISTORY.rst
4
+ include LICENSE
5
+ include README.rst
6
+ include requirements*
7
+ include versioneer.py
8
+
9
+ recursive-include active_learning_step/data *
10
+ recursive-include tests *
11
+ recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
12
+
13
+ recursive-exclude * __pycache__
14
+ recursive-exclude * *.py[co]
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.4
2
+ Name: active_learning_step
3
+ Version: 2026.10.14
4
+ Summary: A SEAMM plug-in for Active Learning
5
+ Home-page: https://github.com/molssi-seamm/active_learning_step
6
+ Author: Paul Saxe
7
+ Author-email: psaxe@molssi.org
8
+ License: BSD-3-Clause
9
+ Keywords: SEAMM,SEAMMplugin,flowchart
10
+ Platform: Linux
11
+ Platform: Mac OS-X
12
+ Platform: Unix
13
+ Platform: Windows
14
+ Classifier: Environment :: Plugins
15
+ Classifier: Development Status :: 2 - Pre-Alpha
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
18
+ Classifier: Topic :: Scientific/Engineering :: Physics
19
+ Classifier: License :: OSI Approved :: BSD License
20
+ Classifier: Natural Language :: English
21
+ Classifier: Programming Language :: Python :: 3 :: Only
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Requires-Python: >=3.12
24
+ Description-Content-Type: text/x-rst
25
+ License-File: LICENSE
26
+ License-File: AUTHORS.rst
27
+ Requires-Dist: ase
28
+ Requires-Dist: numpy
29
+ Requires-Dist: seamm
30
+ Requires-Dist: seamm-util
31
+ Requires-Dist: seamm-widgets
32
+ Provides-Extra: score
33
+ Requires-Dist: xnns>=0.11.1; extra == "score"
34
+ Dynamic: author
35
+ Dynamic: author-email
36
+ Dynamic: classifier
37
+ Dynamic: description
38
+ Dynamic: description-content-type
39
+ Dynamic: home-page
40
+ Dynamic: keywords
41
+ Dynamic: license
42
+ Dynamic: license-file
43
+ Dynamic: platform
44
+ Dynamic: provides-extra
45
+ Dynamic: requires-dist
46
+ Dynamic: requires-python
47
+ Dynamic: summary
48
+
49
+ =============================
50
+ SEAMM Active Learning Plug-in
51
+ =============================
52
+
53
+ .. image:: https://img.shields.io/github/issues-pr-raw/molssi-seamm/active_learning_step
54
+ :target: https://github.com/molssi-seamm/active_learning_step/pulls
55
+ :alt: GitHub pull requests
56
+
57
+ .. image:: https://github.com/molssi-seamm/active_learning_step/workflows/CI/badge.svg
58
+ :target: https://github.com/molssi-seamm/active_learning_step/actions
59
+ :alt: Build Status
60
+
61
+ .. image:: https://codecov.io/gh/molssi-seamm/active_learning_step/branch/master/graph/badge.svg
62
+ :target: https://codecov.io/gh/molssi-seamm/active_learning_step
63
+ :alt: Code Coverage
64
+
65
+ .. image:: https://github.com/molssi-seamm/active_learning_step/workflows/CodeQL/badge.svg
66
+ :target: https://github.com/molssi-seamm/active_learning_step/security/code-scanning
67
+ :alt: Code Quality
68
+
69
+ .. image:: https://github.com/molssi-seamm/active_learning_step/workflows/Release/badge.svg
70
+ :target: https://molssi-seamm.github.io/active_learning_step/index.html
71
+ :alt: Documentation Status
72
+
73
+ .. image:: https://img.shields.io/pypi/v/active_learning_step.svg
74
+ :target: https://pypi.python.org/pypi/active_learning_step
75
+ :alt: PyPi VERSION
76
+
77
+ A SEAMM plug-in for query-by-committee active learning of machine-learned force
78
+ fields: a committee of models trained on different folds of the data disagrees where
79
+ the model is likely wrong, so only the frames it flags need labelling.
80
+
81
+ * Free software: BSD-3-Clause
82
+ * Documentation: https://molssi-seamm.github.io/active_learning_step/index.html
83
+ * Code: https://github.com/molssi-seamm/active_learning_step
84
+
85
+ Features
86
+ --------
87
+
88
+ * ``active_learning_step.committee``: a committee of xnn potentials and its spreads
89
+ (energy, force, per-atom force, atomic and molecular pressure), for molecules,
90
+ ions and charged systems.
91
+ * ``seamm-al score``: the committee's spreads for every frame of extxyz or SDF pools.
92
+ * ``seamm-al select``: rank the frames and take them within a core-hour budget, with
93
+ caps per group and exclusions, writing the chosen frames as a verbatim subset of
94
+ the input files.
95
+
96
+ Acknowledgements
97
+ ----------------
98
+
99
+ This package was created with the `molssi-seamm/cookiecutter-seamm-plugin`_ tool, which
100
+ is based on the excellent Cookiecutter_.
101
+
102
+ .. _Cookiecutter: https://github.com/audreyr/cookiecutter
103
+ .. _`molssi-seamm/cookiecutter-seamm-plugin`: https://github.com/molssi-seamm/cookiecutter-seamm-plugin
104
+
105
+ Developed by the Molecular Sciences Software Institute (MolSSI_),
106
+ which receives funding from the `National Science Foundation`_ under
107
+ award CHE-2136142.
108
+
109
+ .. _MolSSI: https://molssi.org
110
+ .. _`National Science Foundation`: https://www.nsf.gov
111
+
112
+
113
+ =======
114
+ History
115
+ =======
116
+
117
+ 2026.10.14 -- Initial release: query-by-committee active learning for MLFFs
118
+ * A committee of machine-learned force fields, trained on different folds of the
119
+ data, disagrees where the model is likely wrong; the seamm-al command uses that
120
+ disagreement to choose what to label next. This first release provides the
121
+ library and the command line; the SEAMM flowchart step is a placeholder.
122
+ * seamm-al score: the committee's spreads (energy, forces, the largest per-atom
123
+ force spread, atomic and molecular pressure) for every frame of extxyz or SEAMM
124
+ SDF pools, with the total charge passed to the models. Molecules follow SEAMM's
125
+ own rule (molsystem's bond perception, ions on their own), applied without
126
+ SEAMM in MLFF environments, or a SEAMM structure's own bonds.
127
+ * seamm-al select: rank the frames, or keep those past thresholds, and take them
128
+ within a core-hour budget, with costs per kind or group, caps per column and
129
+ exclusions; or draw at random (optionally stratified) before any committee
130
+ exists. The chosen frames are copied byte for byte from the input files.
131
+ * seamm-al train: train the k members of a committee from an xnn recipe, with
132
+ stratified folds, a fixed share of cell batches and a manifest of the folds,
133
+ seeds, data and code versions. Requires xnn 0.13 or later.
134
+ * seamm-al check: whether the spreads predict the out-of-fold errors (Spearman
135
+ correlations, threshold calibration) and the health of each member (losses,
136
+ errors, leave-one-out spreads), with an option to drop a member.
137
+ * seamm-al engine: the committee mean as one MDI engine for LAMMPS, writing the
138
+ spreads every N steps and flagging frames past a threshold.
139
+ * seamm-al data: check a LAMMPS data file for what atom_style atomic can read.
140
+
@@ -0,0 +1,62 @@
1
+ =============================
2
+ SEAMM Active Learning Plug-in
3
+ =============================
4
+
5
+ .. image:: https://img.shields.io/github/issues-pr-raw/molssi-seamm/active_learning_step
6
+ :target: https://github.com/molssi-seamm/active_learning_step/pulls
7
+ :alt: GitHub pull requests
8
+
9
+ .. image:: https://github.com/molssi-seamm/active_learning_step/workflows/CI/badge.svg
10
+ :target: https://github.com/molssi-seamm/active_learning_step/actions
11
+ :alt: Build Status
12
+
13
+ .. image:: https://codecov.io/gh/molssi-seamm/active_learning_step/branch/master/graph/badge.svg
14
+ :target: https://codecov.io/gh/molssi-seamm/active_learning_step
15
+ :alt: Code Coverage
16
+
17
+ .. image:: https://github.com/molssi-seamm/active_learning_step/workflows/CodeQL/badge.svg
18
+ :target: https://github.com/molssi-seamm/active_learning_step/security/code-scanning
19
+ :alt: Code Quality
20
+
21
+ .. image:: https://github.com/molssi-seamm/active_learning_step/workflows/Release/badge.svg
22
+ :target: https://molssi-seamm.github.io/active_learning_step/index.html
23
+ :alt: Documentation Status
24
+
25
+ .. image:: https://img.shields.io/pypi/v/active_learning_step.svg
26
+ :target: https://pypi.python.org/pypi/active_learning_step
27
+ :alt: PyPi VERSION
28
+
29
+ A SEAMM plug-in for query-by-committee active learning of machine-learned force
30
+ fields: a committee of models trained on different folds of the data disagrees where
31
+ the model is likely wrong, so only the frames it flags need labelling.
32
+
33
+ * Free software: BSD-3-Clause
34
+ * Documentation: https://molssi-seamm.github.io/active_learning_step/index.html
35
+ * Code: https://github.com/molssi-seamm/active_learning_step
36
+
37
+ Features
38
+ --------
39
+
40
+ * ``active_learning_step.committee``: a committee of xnn potentials and its spreads
41
+ (energy, force, per-atom force, atomic and molecular pressure), for molecules,
42
+ ions and charged systems.
43
+ * ``seamm-al score``: the committee's spreads for every frame of extxyz or SDF pools.
44
+ * ``seamm-al select``: rank the frames and take them within a core-hour budget, with
45
+ caps per group and exclusions, writing the chosen frames as a verbatim subset of
46
+ the input files.
47
+
48
+ Acknowledgements
49
+ ----------------
50
+
51
+ This package was created with the `molssi-seamm/cookiecutter-seamm-plugin`_ tool, which
52
+ is based on the excellent Cookiecutter_.
53
+
54
+ .. _Cookiecutter: https://github.com/audreyr/cookiecutter
55
+ .. _`molssi-seamm/cookiecutter-seamm-plugin`: https://github.com/molssi-seamm/cookiecutter-seamm-plugin
56
+
57
+ Developed by the Molecular Sciences Software Institute (MolSSI_),
58
+ which receives funding from the `National Science Foundation`_ under
59
+ award CHE-2136142.
60
+
61
+ .. _MolSSI: https://molssi.org
62
+ .. _`National Science Foundation`: https://www.nsf.gov
@@ -0,0 +1,34 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ """
4
+ active_learning_step
5
+ A SEAMM plug-in for Active Learning
6
+ """
7
+
8
+ # Bring up the classes so that they appear to be directly in
9
+ # the active_learning_step package.
10
+ #
11
+ # The library (committee, molecules, pool, selection) and the seamm-al command also
12
+ # run in MLFF environments that have torch and xnn but not SEAMM, so the step's
13
+ # classes are only imported when SEAMM is there.
14
+ try:
15
+ import seamm # noqa: F401
16
+ except ImportError:
17
+ pass
18
+ else:
19
+ from .active_learning import ActiveLearning # noqa: F401, E501
20
+ from .active_learning_parameters import ActiveLearningParameters # noqa: F401, E501
21
+ from .active_learning_step import ActiveLearningStep # noqa: F401, E501
22
+ from .tk_active_learning import TkActiveLearning # noqa: F401, E501
23
+
24
+ from .metadata import metadata # noqa: F401
25
+
26
+ # Handle versioneer
27
+ from ._version import get_versions
28
+
29
+ __author__ = "Paul Saxe"
30
+ __email__ = "psaxe@molssi.org"
31
+ versions = get_versions()
32
+ __version__ = versions["version"]
33
+ __git_revision__ = versions["full-revisionid"]
34
+ del get_versions, versions
@@ -0,0 +1,21 @@
1
+
2
+ # This file was generated by 'versioneer.py' (0.18) from
3
+ # revision-control system data, or from the parent directory name of an
4
+ # unpacked source archive. Distribution tarballs contain a pre-generated copy
5
+ # of this file.
6
+
7
+ import json
8
+
9
+ version_json = '''
10
+ {
11
+ "date": "2026-10-14T06:21:42-0400",
12
+ "dirty": false,
13
+ "error": null,
14
+ "full-revisionid": "1644bd1a7793ed3ca65d488119b41a5d0a7d1180",
15
+ "version": "2026.10.14"
16
+ }
17
+ ''' # END VERSION_JSON
18
+
19
+
20
+ def get_versions():
21
+ return json.loads(version_json)
@@ -0,0 +1,209 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ """Non-graphical part of the Active Learning step in a SEAMM flowchart"""
4
+
5
+ import logging
6
+ from pathlib import Path
7
+ import importlib.resources
8
+ import pprint # noqa: F401
9
+
10
+ import active_learning_step
11
+ import molsystem
12
+ import seamm
13
+ from seamm_util import ureg, Q_ # noqa: F401
14
+ import seamm_util.printing as printing
15
+ from seamm_util.printing import FormattedText as __
16
+
17
+ # In addition to the normal logger, two logger-like printing facilities are
18
+ # defined: "job" and "printer". "job" send output to the main job.out file for
19
+ # the job, and should be used very sparingly, typically to echo what this step
20
+ # will do in the initial summary of the job.
21
+ #
22
+ # "printer" sends output to the file "step.out" in this steps working
23
+ # directory, and is used for all normal output from this step.
24
+
25
+ logger = logging.getLogger(__name__)
26
+ job = printing.getPrinter()
27
+ printer = printing.getPrinter("Active Learning")
28
+
29
+ # Add this module's properties to the standard properties
30
+ path = importlib.resources.files("active_learning_step") / "data"
31
+ csv_file = path / "properties.csv"
32
+ if path.exists():
33
+ molsystem.add_properties_from_file(csv_file)
34
+
35
+
36
+ class ActiveLearning(seamm.Node):
37
+ """
38
+ The non-graphical part of a Active Learning step in a flowchart.
39
+
40
+ Attributes
41
+ ----------
42
+ parser : configargparse.ArgParser
43
+ The parser object.
44
+
45
+ options : tuple
46
+ It contains a two item tuple containing the populated namespace and the
47
+ list of remaining argument strings.
48
+
49
+ subflowchart : seamm.Flowchart
50
+ A SEAMM Flowchart object that represents a subflowchart, if needed.
51
+
52
+ parameters : ActiveLearningParameters
53
+ The control parameters for Active Learning.
54
+
55
+ See Also
56
+ --------
57
+ TkActiveLearning,
58
+ ActiveLearning, ActiveLearningParameters
59
+ """
60
+
61
+ def __init__(
62
+ self, flowchart=None, title="Active Learning", extension=None, logger=logger
63
+ ):
64
+ """A step for Active Learning in a SEAMM flowchart.
65
+
66
+ You may wish to change the title above, which is the string displayed
67
+ in the box representing the step in the flowchart.
68
+
69
+ Parameters
70
+ ----------
71
+ flowchart: seamm.Flowchart
72
+ The non-graphical flowchart that contains this step.
73
+
74
+ title: str
75
+ The name displayed in the flowchart.
76
+ extension: None
77
+ Not yet implemented
78
+ logger : Logger = logger
79
+ The logger to use and pass to parent classes
80
+
81
+ Returns
82
+ -------
83
+ None
84
+ """
85
+ logger.debug(f"Creating Active Learning {self}")
86
+
87
+ super().__init__(
88
+ flowchart=flowchart,
89
+ title="Active Learning",
90
+ extension=extension,
91
+ module=__name__,
92
+ logger=logger,
93
+ ) # yapf: disable
94
+
95
+ self._metadata = active_learning_step.metadata
96
+ self.parameters = active_learning_step.ActiveLearningParameters()
97
+
98
+ @property
99
+ def version(self):
100
+ """The semantic version of this module."""
101
+ return active_learning_step.__version__
102
+
103
+ @property
104
+ def git_revision(self):
105
+ """The git version of this module."""
106
+ return active_learning_step.__git_revision__
107
+
108
+ def description_text(self, P=None):
109
+ """Create the text description of what this step will do.
110
+ The dictionary of control values is passed in as P so that
111
+ the code can test values, etc.
112
+
113
+ Parameters
114
+ ----------
115
+ P: dict
116
+ An optional dictionary of the current values of the control
117
+ parameters.
118
+ Returns
119
+ -------
120
+ str
121
+ A description of the current step.
122
+ """
123
+ if not P:
124
+ P = self.parameters.values_to_dict()
125
+
126
+ text = (
127
+ "Please replace this with a short summary of the "
128
+ "Active Learning step, including key parameters."
129
+ )
130
+
131
+ return self.header + "\n" + __(text, **P, indent=4 * " ").__str__()
132
+
133
+ def run(self):
134
+ """Run a Active Learning step.
135
+
136
+ Parameters
137
+ ----------
138
+ None
139
+
140
+ Returns
141
+ -------
142
+ seamm.Node
143
+ The next node object in the flowchart.
144
+ """
145
+ next_node = super().run(printer)
146
+ # Get the values of the parameters, dereferencing any variables
147
+ P = self.parameters.current_values_to_dict(
148
+ context=seamm.flowchart_variables._data
149
+ )
150
+
151
+ # Print what we are doing
152
+ printer.important(__(self.description_text(P), indent=self.indent))
153
+
154
+ directory = Path(self.directory)
155
+ directory.mkdir(parents=True, exist_ok=True)
156
+
157
+ # Get the current system and configuration (ignoring the system...)
158
+ _, configuration = self.get_system_configuration(None)
159
+
160
+ # Results data
161
+ data = {}
162
+
163
+ # Temporary code just to print the parameters. You will need to change
164
+ # this!
165
+ for key in P:
166
+ print("{:>15s} = {}".format(key, P[key]))
167
+ printer.normal(
168
+ __(
169
+ "{key:>15s} = {value}",
170
+ key=key,
171
+ value=P[key],
172
+ indent=4 * " ",
173
+ wrap=False,
174
+ dedent=False,
175
+ )
176
+ )
177
+
178
+ # Analyze the results
179
+ self.analyze()
180
+ # Put any requested results into variables or tables
181
+ self.store_results(
182
+ configuration=configuration,
183
+ data=data,
184
+ )
185
+ # Add other citations here or in the appropriate place in the code.
186
+ # Add the bibtex to data/references.bib, and add a self.reference.cite
187
+ # similar to the above to actually add the citation to the references.
188
+
189
+ return next_node
190
+
191
+ def analyze(self, indent="", **kwargs):
192
+ """Do any analysis of the output from this step.
193
+
194
+ Also print important results to the local step.out file using
195
+ "printer".
196
+
197
+ Parameters
198
+ ----------
199
+ indent: str
200
+ An extra indentation for the output
201
+ """
202
+ printer.normal(
203
+ __(
204
+ "This is a placeholder for the results from the Active Learning step",
205
+ indent=4 * " ",
206
+ wrap=True,
207
+ dedent=False,
208
+ )
209
+ )