alchemist-nrel 0.2.1__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.
- alchemist_nrel-0.2.1/LICENSE +13 -0
- alchemist_nrel-0.2.1/PKG-INFO +206 -0
- alchemist_nrel-0.2.1/README.md +148 -0
- alchemist_nrel-0.2.1/alchemist_core/__init__.py +63 -0
- alchemist_nrel-0.2.1/alchemist_core/acquisition/__init__.py +1 -0
- alchemist_nrel-0.2.1/alchemist_core/acquisition/base_acquisition.py +17 -0
- alchemist_nrel-0.2.1/alchemist_core/acquisition/botorch_acquisition.py +668 -0
- alchemist_nrel-0.2.1/alchemist_core/acquisition/skopt_acquisition.py +330 -0
- alchemist_nrel-0.2.1/alchemist_core/config.py +113 -0
- alchemist_nrel-0.2.1/alchemist_core/data/__init__.py +10 -0
- alchemist_nrel-0.2.1/alchemist_core/data/experiment_manager.py +155 -0
- alchemist_nrel-0.2.1/alchemist_core/data/search_space.py +169 -0
- alchemist_nrel-0.2.1/alchemist_core/events.py +211 -0
- alchemist_nrel-0.2.1/alchemist_core/models/__init__.py +0 -0
- alchemist_nrel-0.2.1/alchemist_core/models/ax_model.py +159 -0
- alchemist_nrel-0.2.1/alchemist_core/models/base_model.py +81 -0
- alchemist_nrel-0.2.1/alchemist_core/models/botorch_model.py +922 -0
- alchemist_nrel-0.2.1/alchemist_core/models/sklearn_model.py +717 -0
- alchemist_nrel-0.2.1/alchemist_core/session.py +603 -0
- alchemist_nrel-0.2.1/alchemist_core/utils/__init__.py +7 -0
- alchemist_nrel-0.2.1/alchemist_nrel.egg-info/PKG-INFO +206 -0
- alchemist_nrel-0.2.1/alchemist_nrel.egg-info/SOURCES.txt +61 -0
- alchemist_nrel-0.2.1/alchemist_nrel.egg-info/dependency_links.txt +1 -0
- alchemist_nrel-0.2.1/alchemist_nrel.egg-info/entry_points.txt +2 -0
- alchemist_nrel-0.2.1/alchemist_nrel.egg-info/requires.txt +34 -0
- alchemist_nrel-0.2.1/alchemist_nrel.egg-info/top_level.txt +4 -0
- alchemist_nrel-0.2.1/api/__init__.py +3 -0
- alchemist_nrel-0.2.1/api/dependencies.py +43 -0
- alchemist_nrel-0.2.1/api/example_client.py +192 -0
- alchemist_nrel-0.2.1/api/main.py +117 -0
- alchemist_nrel-0.2.1/api/middleware/__init__.py +17 -0
- alchemist_nrel-0.2.1/api/middleware/error_handlers.py +127 -0
- alchemist_nrel-0.2.1/api/models/__init__.py +52 -0
- alchemist_nrel-0.2.1/api/models/requests.py +202 -0
- alchemist_nrel-0.2.1/api/models/responses.py +292 -0
- alchemist_nrel-0.2.1/api/routers/__init__.py +5 -0
- alchemist_nrel-0.2.1/api/routers/acquisition.py +164 -0
- alchemist_nrel-0.2.1/api/routers/experiments.py +154 -0
- alchemist_nrel-0.2.1/api/routers/models.py +116 -0
- alchemist_nrel-0.2.1/api/routers/sessions.py +146 -0
- alchemist_nrel-0.2.1/api/routers/variables.py +317 -0
- alchemist_nrel-0.2.1/api/routers/visualizations.py +557 -0
- alchemist_nrel-0.2.1/api/services/__init__.py +5 -0
- alchemist_nrel-0.2.1/api/services/session_store.py +291 -0
- alchemist_nrel-0.2.1/main.py +8 -0
- alchemist_nrel-0.2.1/pyproject.toml +117 -0
- alchemist_nrel-0.2.1/setup.cfg +4 -0
- alchemist_nrel-0.2.1/tests/test_core_data.py +177 -0
- alchemist_nrel-0.2.1/tests/test_event_system.py +336 -0
- alchemist_nrel-0.2.1/tests/test_logging.py +70 -0
- alchemist_nrel-0.2.1/tests/test_session_api.py +209 -0
- alchemist_nrel-0.2.1/ui/__init__.py +34 -0
- alchemist_nrel-0.2.1/ui/acquisition_panel.py +878 -0
- alchemist_nrel-0.2.1/ui/custom_widgets.py +105 -0
- alchemist_nrel-0.2.1/ui/experiment_logger.py +205 -0
- alchemist_nrel-0.2.1/ui/gpr_panel.py +613 -0
- alchemist_nrel-0.2.1/ui/notifications.py +654 -0
- alchemist_nrel-0.2.1/ui/pool_viz.py +240 -0
- alchemist_nrel-0.2.1/ui/ui.py +1192 -0
- alchemist_nrel-0.2.1/ui/ui_utils.py +25 -0
- alchemist_nrel-0.2.1/ui/utils.py +33 -0
- alchemist_nrel-0.2.1/ui/variables_setup.py +496 -0
- alchemist_nrel-0.2.1/ui/visualizations.py +1424 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Alliance for Sustainable Energy, LLC
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
10
|
+
|
|
11
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
12
|
+
|
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS βAS ISβ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: alchemist-nrel
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Active learning and optimization toolkit for chemical and materials research
|
|
5
|
+
Author-email: Caleb Coatney <caleb.coatney@nrel.gov>
|
|
6
|
+
License: BSD-3-Clause
|
|
7
|
+
Project-URL: Homepage, https://github.com/NREL/ALchemist
|
|
8
|
+
Project-URL: Documentation, https://nrel.github.io/ALchemist/
|
|
9
|
+
Project-URL: Source, https://github.com/NREL/ALchemist
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/NREL/ALchemist/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/NREL/ALchemist/releases
|
|
12
|
+
Keywords: active learning,bayesian optimization,gaussian processes,materials science,chemistry
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy
|
|
26
|
+
Requires-Dist: pandas
|
|
27
|
+
Requires-Dist: scipy
|
|
28
|
+
Requires-Dist: matplotlib
|
|
29
|
+
Requires-Dist: mplcursors
|
|
30
|
+
Requires-Dist: scikit-learn
|
|
31
|
+
Requires-Dist: scikit-optimize
|
|
32
|
+
Requires-Dist: botorch
|
|
33
|
+
Requires-Dist: torch
|
|
34
|
+
Requires-Dist: gpytorch
|
|
35
|
+
Requires-Dist: ax-platform
|
|
36
|
+
Requires-Dist: customtkinter
|
|
37
|
+
Requires-Dist: tksheet
|
|
38
|
+
Requires-Dist: tabulate
|
|
39
|
+
Requires-Dist: ctkmessagebox
|
|
40
|
+
Requires-Dist: joblib
|
|
41
|
+
Requires-Dist: fastapi>=0.109.0
|
|
42
|
+
Requires-Dist: uvicorn[standard]>=0.27.0
|
|
43
|
+
Requires-Dist: pydantic>=2.5.0
|
|
44
|
+
Requires-Dist: python-multipart>=0.0.6
|
|
45
|
+
Provides-Extra: test
|
|
46
|
+
Requires-Dist: pytest>=8.0.0; extra == "test"
|
|
47
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
|
|
48
|
+
Requires-Dist: pytest-anyio>=0.0.0; extra == "test"
|
|
49
|
+
Requires-Dist: httpx>=0.25.0; extra == "test"
|
|
50
|
+
Requires-Dist: requests>=2.31.0; extra == "test"
|
|
51
|
+
Provides-Extra: dev
|
|
52
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
53
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
54
|
+
Requires-Dist: pytest-anyio>=0.0.0; extra == "dev"
|
|
55
|
+
Requires-Dist: httpx>=0.25.0; extra == "dev"
|
|
56
|
+
Requires-Dist: requests>=2.31.0; extra == "dev"
|
|
57
|
+
Dynamic: license-file
|
|
58
|
+
|
|
59
|
+
<img src="docs/assets/logo.png" alt="ALchemist" width="50%" />
|
|
60
|
+
|
|
61
|
+
**ALchemist: Active Learning Toolkit for Chemical and Materials Research**
|
|
62
|
+
|
|
63
|
+
ALchemist is a modular Python toolkit that brings active learning and Bayesian optimization to experimental design in chemical and materials research. It is designed for scientists and engineers who want to efficiently explore or optimize high-dimensional variable spacesβwithout writing codeβusing an intuitive graphical interface.
|
|
64
|
+
|
|
65
|
+
**NREL Software Record:** SWR-25-102
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## π Documentation
|
|
70
|
+
|
|
71
|
+
Full user guide and documentation:
|
|
72
|
+
[https://nrel.github.io/ALchemist/](https://nrel.github.io/ALchemist/)
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## π Overview
|
|
77
|
+
|
|
78
|
+
ALchemist accelerates discovery and optimization by combining:
|
|
79
|
+
|
|
80
|
+
- **Flexible variable space definition:** Real, integer, and categorical variables with bounds or discrete values.
|
|
81
|
+
- **Probabilistic surrogate modeling:** Gaussian process regression via BoTorch or scikit-optimize backends.
|
|
82
|
+
- **Advanced acquisition strategies:** Efficient sampling using qEI, qPI, qUCB, and qNegIntegratedPosteriorVariance.
|
|
83
|
+
- **Modern web interface:** React-based UI with FastAPI backend for seamless active learning workflows.
|
|
84
|
+
- **Experiment tracking:** CSV logging, reproducible random seeds, and error tracking.
|
|
85
|
+
- **Extensibility:** Abstract interfaces for models and acquisition functions enable future backend and workflow expansion.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## π§ Quick Start
|
|
90
|
+
|
|
91
|
+
### Web Application (Recommended)
|
|
92
|
+
|
|
93
|
+
**Development Mode:**
|
|
94
|
+
```bash
|
|
95
|
+
# Option 1: Manual start
|
|
96
|
+
python run_api.py # Terminal 1: Backend (port 8000)
|
|
97
|
+
cd alchemist-web && npm run dev # Terminal 2: Frontend (port 5173)
|
|
98
|
+
|
|
99
|
+
# Option 2: Automated start
|
|
100
|
+
scripts\dev_start.bat # Windows
|
|
101
|
+
./scripts/dev_start.sh # Linux/Mac
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Production Mode:**
|
|
105
|
+
```bash
|
|
106
|
+
# Build and run
|
|
107
|
+
scripts\build_production.bat # Windows
|
|
108
|
+
./scripts/build_production.sh # Linux/Mac
|
|
109
|
+
|
|
110
|
+
# Start production server
|
|
111
|
+
python run_api.py --production
|
|
112
|
+
|
|
113
|
+
# Access at: http://localhost:8000
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Docker Deployment:**
|
|
117
|
+
```bash
|
|
118
|
+
# Build frontend first
|
|
119
|
+
cd alchemist-web && npm run build && cd ..
|
|
120
|
+
|
|
121
|
+
# Run with Docker Compose
|
|
122
|
+
cd docker
|
|
123
|
+
docker-compose up --build
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Python Package Installation
|
|
127
|
+
|
|
128
|
+
Requirements: Python 3.9 or higher
|
|
129
|
+
|
|
130
|
+
We recommend using [Anaconda](https://www.anaconda.com/products/distribution) to manage your Python environments.
|
|
131
|
+
|
|
132
|
+
**1. Create a new environment:**
|
|
133
|
+
```bash
|
|
134
|
+
conda create -n alchemist-env python=3.12
|
|
135
|
+
conda activate alchemist-env
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**2. Install ALchemist:**
|
|
139
|
+
|
|
140
|
+
*Option A: Install directly from GitHub:*
|
|
141
|
+
```bash
|
|
142
|
+
python -m pip install git+https://github.com/NREL/ALchemist.git
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
*Option B: Clone and install (recommended for development):*
|
|
146
|
+
```bash
|
|
147
|
+
git clone https://github.com/NREL/ALchemist.git
|
|
148
|
+
cd ALchemist
|
|
149
|
+
python -m pip install -e .
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
All dependencies are specified in `pyproject.toml` and will be installed automatically.
|
|
153
|
+
|
|
154
|
+
For step-by-step instructions, see the [Getting Started](https://nrel.github.io/ALchemist/) section of the documentation.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## π Project Structure
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
ALchemist/
|
|
162
|
+
βββ alchemist_core/ # Core Python library
|
|
163
|
+
βββ alchemist-web/ # React frontend application
|
|
164
|
+
βββ api/ # FastAPI backend
|
|
165
|
+
βββ docker/ # Docker configuration files
|
|
166
|
+
βββ scripts/ # Build and development scripts
|
|
167
|
+
βββ tests/ # Test suite
|
|
168
|
+
βββ docs/ # Documentation (MkDocs)
|
|
169
|
+
βββ memory/ # Development notes and references
|
|
170
|
+
βββ run_api.py # API server entry point
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## π οΈ Development Status
|
|
176
|
+
|
|
177
|
+
ALchemist is under active development at NREL as part of the DataHub project within the ChemCatBio consortium. It is designed to be approachable for non-ML researchers and extensible for advanced users. Planned features include:
|
|
178
|
+
|
|
179
|
+
- Enhanced initial sampling and DoE methods
|
|
180
|
+
- Additional model types and acquisition strategies
|
|
181
|
+
- Improved visualization tools
|
|
182
|
+
- GUI reimplementation in PySide6 for broader compatibility
|
|
183
|
+
- Support for multi-output models and multi-objective optimization
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## π Issues & Troubleshooting
|
|
188
|
+
|
|
189
|
+
If you encounter any issues or have questions, please [open an issue on GitHub](https://github.com/NREL/ALchemist/issues) or contact ccoatney@nrel.gov.
|
|
190
|
+
|
|
191
|
+
For the latest known issues and troubleshooting tips, see the [Issues & Troubleshooting Log](docs/ISSUES_LOG.md).
|
|
192
|
+
|
|
193
|
+
We appreciate your feedback and bug reports to help improve ALchemist!
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## π License
|
|
198
|
+
|
|
199
|
+
This project is licensed under the BSD 3-Clause License. See the [LICENSE](LICENSE) file for details.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## π Repository
|
|
204
|
+
|
|
205
|
+
[https://github.com/NREL/ALchemist](https://github.com/NREL/ALchemist)
|
|
206
|
+
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<img src="docs/assets/logo.png" alt="ALchemist" width="50%" />
|
|
2
|
+
|
|
3
|
+
**ALchemist: Active Learning Toolkit for Chemical and Materials Research**
|
|
4
|
+
|
|
5
|
+
ALchemist is a modular Python toolkit that brings active learning and Bayesian optimization to experimental design in chemical and materials research. It is designed for scientists and engineers who want to efficiently explore or optimize high-dimensional variable spacesβwithout writing codeβusing an intuitive graphical interface.
|
|
6
|
+
|
|
7
|
+
**NREL Software Record:** SWR-25-102
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## π Documentation
|
|
12
|
+
|
|
13
|
+
Full user guide and documentation:
|
|
14
|
+
[https://nrel.github.io/ALchemist/](https://nrel.github.io/ALchemist/)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## π Overview
|
|
19
|
+
|
|
20
|
+
ALchemist accelerates discovery and optimization by combining:
|
|
21
|
+
|
|
22
|
+
- **Flexible variable space definition:** Real, integer, and categorical variables with bounds or discrete values.
|
|
23
|
+
- **Probabilistic surrogate modeling:** Gaussian process regression via BoTorch or scikit-optimize backends.
|
|
24
|
+
- **Advanced acquisition strategies:** Efficient sampling using qEI, qPI, qUCB, and qNegIntegratedPosteriorVariance.
|
|
25
|
+
- **Modern web interface:** React-based UI with FastAPI backend for seamless active learning workflows.
|
|
26
|
+
- **Experiment tracking:** CSV logging, reproducible random seeds, and error tracking.
|
|
27
|
+
- **Extensibility:** Abstract interfaces for models and acquisition functions enable future backend and workflow expansion.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## π§ Quick Start
|
|
32
|
+
|
|
33
|
+
### Web Application (Recommended)
|
|
34
|
+
|
|
35
|
+
**Development Mode:**
|
|
36
|
+
```bash
|
|
37
|
+
# Option 1: Manual start
|
|
38
|
+
python run_api.py # Terminal 1: Backend (port 8000)
|
|
39
|
+
cd alchemist-web && npm run dev # Terminal 2: Frontend (port 5173)
|
|
40
|
+
|
|
41
|
+
# Option 2: Automated start
|
|
42
|
+
scripts\dev_start.bat # Windows
|
|
43
|
+
./scripts/dev_start.sh # Linux/Mac
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Production Mode:**
|
|
47
|
+
```bash
|
|
48
|
+
# Build and run
|
|
49
|
+
scripts\build_production.bat # Windows
|
|
50
|
+
./scripts/build_production.sh # Linux/Mac
|
|
51
|
+
|
|
52
|
+
# Start production server
|
|
53
|
+
python run_api.py --production
|
|
54
|
+
|
|
55
|
+
# Access at: http://localhost:8000
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Docker Deployment:**
|
|
59
|
+
```bash
|
|
60
|
+
# Build frontend first
|
|
61
|
+
cd alchemist-web && npm run build && cd ..
|
|
62
|
+
|
|
63
|
+
# Run with Docker Compose
|
|
64
|
+
cd docker
|
|
65
|
+
docker-compose up --build
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Python Package Installation
|
|
69
|
+
|
|
70
|
+
Requirements: Python 3.9 or higher
|
|
71
|
+
|
|
72
|
+
We recommend using [Anaconda](https://www.anaconda.com/products/distribution) to manage your Python environments.
|
|
73
|
+
|
|
74
|
+
**1. Create a new environment:**
|
|
75
|
+
```bash
|
|
76
|
+
conda create -n alchemist-env python=3.12
|
|
77
|
+
conda activate alchemist-env
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**2. Install ALchemist:**
|
|
81
|
+
|
|
82
|
+
*Option A: Install directly from GitHub:*
|
|
83
|
+
```bash
|
|
84
|
+
python -m pip install git+https://github.com/NREL/ALchemist.git
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
*Option B: Clone and install (recommended for development):*
|
|
88
|
+
```bash
|
|
89
|
+
git clone https://github.com/NREL/ALchemist.git
|
|
90
|
+
cd ALchemist
|
|
91
|
+
python -m pip install -e .
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
All dependencies are specified in `pyproject.toml` and will be installed automatically.
|
|
95
|
+
|
|
96
|
+
For step-by-step instructions, see the [Getting Started](https://nrel.github.io/ALchemist/) section of the documentation.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## π Project Structure
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
ALchemist/
|
|
104
|
+
βββ alchemist_core/ # Core Python library
|
|
105
|
+
βββ alchemist-web/ # React frontend application
|
|
106
|
+
βββ api/ # FastAPI backend
|
|
107
|
+
βββ docker/ # Docker configuration files
|
|
108
|
+
βββ scripts/ # Build and development scripts
|
|
109
|
+
βββ tests/ # Test suite
|
|
110
|
+
βββ docs/ # Documentation (MkDocs)
|
|
111
|
+
βββ memory/ # Development notes and references
|
|
112
|
+
βββ run_api.py # API server entry point
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## π οΈ Development Status
|
|
118
|
+
|
|
119
|
+
ALchemist is under active development at NREL as part of the DataHub project within the ChemCatBio consortium. It is designed to be approachable for non-ML researchers and extensible for advanced users. Planned features include:
|
|
120
|
+
|
|
121
|
+
- Enhanced initial sampling and DoE methods
|
|
122
|
+
- Additional model types and acquisition strategies
|
|
123
|
+
- Improved visualization tools
|
|
124
|
+
- GUI reimplementation in PySide6 for broader compatibility
|
|
125
|
+
- Support for multi-output models and multi-objective optimization
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## π Issues & Troubleshooting
|
|
130
|
+
|
|
131
|
+
If you encounter any issues or have questions, please [open an issue on GitHub](https://github.com/NREL/ALchemist/issues) or contact ccoatney@nrel.gov.
|
|
132
|
+
|
|
133
|
+
For the latest known issues and troubleshooting tips, see the [Issues & Troubleshooting Log](docs/ISSUES_LOG.md).
|
|
134
|
+
|
|
135
|
+
We appreciate your feedback and bug reports to help improve ALchemist!
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## π License
|
|
140
|
+
|
|
141
|
+
This project is licensed under the BSD 3-Clause License. See the [LICENSE](LICENSE) file for details.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## π Repository
|
|
146
|
+
|
|
147
|
+
[https://github.com/NREL/ALchemist](https://github.com/NREL/ALchemist)
|
|
148
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ALchemist Core - Headless Bayesian Optimization Library
|
|
3
|
+
|
|
4
|
+
This package provides the core functionality for active learning and Bayesian
|
|
5
|
+
optimization workflows without UI dependencies.
|
|
6
|
+
|
|
7
|
+
Main Components:
|
|
8
|
+
- OptimizationSession: High-level API for optimization workflows
|
|
9
|
+
- SearchSpace: Define variable search spaces
|
|
10
|
+
- ExperimentManager: Manage experimental data
|
|
11
|
+
- Models: Surrogate modeling backends (sklearn, BoTorch)
|
|
12
|
+
- Acquisition: Acquisition function strategies
|
|
13
|
+
|
|
14
|
+
Example:
|
|
15
|
+
>>> from alchemist_core import OptimizationSession, SearchSpace, ExperimentManager
|
|
16
|
+
>>>
|
|
17
|
+
>>> # Create session
|
|
18
|
+
>>> session = OptimizationSession(
|
|
19
|
+
... search_space=SearchSpace.from_json("variables.json"),
|
|
20
|
+
... experiment_manager=ExperimentManager.from_csv("experiments.csv")
|
|
21
|
+
... )
|
|
22
|
+
>>>
|
|
23
|
+
>>> # Train model
|
|
24
|
+
>>> session.fit_model(backend="sklearn")
|
|
25
|
+
>>>
|
|
26
|
+
>>> # Get next experiment suggestion
|
|
27
|
+
>>> next_point = session.suggest_next(acq_func="ei")
|
|
28
|
+
|
|
29
|
+
Version: 0.2.0-dev (Core-UI Split)
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
__version__ = "0.2.0-dev"
|
|
33
|
+
__author__ = "Caleb Coatney"
|
|
34
|
+
__email__ = "caleb.coatney@nrel.gov"
|
|
35
|
+
|
|
36
|
+
# Core data structures
|
|
37
|
+
from alchemist_core.data.search_space import SearchSpace
|
|
38
|
+
from alchemist_core.data.experiment_manager import ExperimentManager
|
|
39
|
+
|
|
40
|
+
# Event system
|
|
41
|
+
from alchemist_core.events import EventEmitter
|
|
42
|
+
|
|
43
|
+
# Configuration and logging
|
|
44
|
+
from alchemist_core.config import configure_logging, get_logger, set_verbosity
|
|
45
|
+
|
|
46
|
+
# High-level session API
|
|
47
|
+
from alchemist_core.session import OptimizationSession
|
|
48
|
+
|
|
49
|
+
# Public API
|
|
50
|
+
__all__ = [
|
|
51
|
+
# High-level API (recommended entry point)
|
|
52
|
+
"OptimizationSession",
|
|
53
|
+
|
|
54
|
+
# Data structures
|
|
55
|
+
"SearchSpace",
|
|
56
|
+
"ExperimentManager",
|
|
57
|
+
|
|
58
|
+
# Events and logging
|
|
59
|
+
"EventEmitter",
|
|
60
|
+
"configure_logging",
|
|
61
|
+
"get_logger",
|
|
62
|
+
"set_verbosity",
|
|
63
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Acquisition functions package
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
|
|
3
|
+
class BaseAcquisition(ABC):
|
|
4
|
+
def __init__(self, search_space, model=None, random_state=42):
|
|
5
|
+
self.search_space = search_space
|
|
6
|
+
self.model = model
|
|
7
|
+
self.random_state = random_state
|
|
8
|
+
|
|
9
|
+
@abstractmethod
|
|
10
|
+
def update(self, X, y):
|
|
11
|
+
"""Update with training data"""
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def select_next(self, candidate_points=None):
|
|
16
|
+
"""Select the next point to evaluate"""
|
|
17
|
+
pass
|