Skip to content

Commit 7614f89

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a93c69d commit 7614f89

File tree

1 file changed

+35
-19
lines changed

1 file changed

+35
-19
lines changed

README.md

+35-19
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ For this example to work, you will need:
6565
</ul>
6666
</details>
6767

68-
6968
### Converted Workflow with ZnTrack
7069

71-
To make this workflow reproducible, we convert it into a **directed graph structure** where each step is represented as a **Node**. Nodes define their inputs, outputs, and the computational logic to execute. Here's the graph structure for our example:
70+
To make this workflow reproducible, we convert it into a **directed graph
71+
structure** where each step is represented as a **Node**. Nodes define their
72+
inputs, outputs, and the computational logic to execute. Here's the graph
73+
structure for our example:
7274

7375
```mermaid
7476
flowchart LR
@@ -79,13 +81,17 @@ MACE_MP --> StructureOptimization
7981

8082
#### Node Definitions
8183

82-
In ZnTrack, each **Node** is defined as a Python class. The class attributes define the **inputs** (parameters and dependencies) and **outputs**, while the `run` method contains the computational logic to be executed.
84+
In ZnTrack, each **Node** is defined as a Python class. The class attributes
85+
define the **inputs** (parameters and dependencies) and **outputs**, while the
86+
`run` method contains the computational logic to be executed.
8387

84-
> [!NOTE]
85-
> ZnTrack uses Python dataclasses under the hood, providing an automatic `__init__` method. Starting from Python 3.11, most IDEs should reliably provide type hints for ZnTrack Nodes.
88+
> [!NOTE] ZnTrack uses Python dataclasses under the hood, providing an automatic
89+
> `__init__` method. Starting from Python 3.11, most IDEs should reliably
90+
> provide type hints for ZnTrack Nodes.
8691
87-
> [!TIP]
88-
> For files produced during the `run` method, ZnTrack provides a unique **Node Working Directory** (`zntrack.nwd`). Always use this directory to store files to ensure reproducibility and avoid conflicts.
92+
> [!TIP] For files produced during the `run` method, ZnTrack provides a unique
93+
> **Node Working Directory** (`zntrack.nwd`). Always use this directory to store
94+
> files to ensure reproducibility and avoid conflicts.
8995
9096
```python
9197
import zntrack
@@ -170,18 +176,22 @@ class StructureOptimization(zntrack.Node):
170176

171177
#### Building and Running the Workflow
172178

173-
Now that we’ve defined all the necessary Nodes, we can build and execute the workflow. Follow these steps:
179+
Now that we’ve defined all the necessary Nodes, we can build and execute the
180+
workflow. Follow these steps:
174181

175182
1. **Initialize a new directory** for your project:
183+
176184
```bash
177185
git init
178186
dvc init
179187
```
180188

181-
2. **Create a Python module** for the Node definitions:
189+
1. **Create a Python module** for the Node definitions:
190+
182191
- Create a file `src/__init__.py` and place the Node definitions inside it.
183192

184-
3. **Define and execute the workflow** in a `main.py` file:
193+
1. **Define and execute the workflow** in a `main.py` file:
194+
185195
```python
186196
import zntrack
187197
from src import MACE_MP, Smiles2Conformers, Pack, StructureOptimization
@@ -202,14 +212,18 @@ Now that we’ve defined all the necessary Nodes, we can build and execute the w
202212
project.repro()
203213
```
204214

205-
> **TIP**
206-
> If you don’t want to execute the graph immediately, use `project.build()` instead. You can run the graph later using `dvc repro` or the [paraffin](https://github.com/zincware/paraffin) package.
215+
> **TIP** If you don’t want to execute the graph immediately, use
216+
> `project.build()` instead. You can run the graph later using `dvc repro` or
217+
> the [paraffin](https://github.com/zincware/paraffin) package.
207218
208219
#### Accessing Results
209220

210-
Once the workflow has been executed, the results are stored in the respective files. For example, the optimized trajectory is saved in `nodes/StructureOptimization/frames.traj`.
221+
Once the workflow has been executed, the results are stored in the respective
222+
files. For example, the optimized trajectory is saved in
223+
`nodes/StructureOptimization/frames.traj`.
211224

212-
You can load the results directly using ZnTrack, without worrying about file paths or formats:
225+
You can load the results directly using ZnTrack, without worrying about file
226+
paths or formats:
213227

214228
```python
215229
import zntrack
@@ -221,15 +235,17 @@ optm = zntrack.from_rev(name="StructureOptimization")
221235
print(optm.frames)
222236
```
223237

224-
---
238+
______________________________________________________________________
225239

226240
### More Examples
227241

228-
For additional examples and advanced use cases, check out these packages built on top of ZnTrack:
229-
230-
- [MLIPx](https://mlipx.readthedocs.io/en/latest/) - Machine Learning Interatomic Potentials.
231-
- [IPSuite](https://github.com/zincware/IPSuite) - Interatomic Potential Suite for materials science.
242+
For additional examples and advanced use cases, check out these packages built
243+
on top of ZnTrack:
232244

245+
- [MLIPx](https://mlipx.readthedocs.io/en/latest/) - Machine Learning
246+
Interatomic Potentials.
247+
- [IPSuite](https://github.com/zincware/IPSuite) - Interatomic Potential Suite
248+
for materials science.
233249

234250
## Technical Details
235251

0 commit comments

Comments
 (0)