@@ -99,9 +99,7 @@ class Smiles2Conformers(zntrack.Node):
99
99
frames_path: Path = zntrack.outs_path(zntrack.nwd / " frames.xyz" ) # Output file path
100
100
101
101
def run (self ) -> None :
102
- # Generate molecular conformers from a SMILES string
103
102
frames = smiles2conformers(smiles = self .smiles, numConfs = self .numConfs)
104
- # Save the frames to the output file
105
103
ase.io.write(frames, self .frames_path)
106
104
107
105
@ property
@@ -119,9 +117,7 @@ class Pack(zntrack.Node):
119
117
frames_path: Path = zntrack.outs_path(zntrack.nwd / " frames.xyz" ) # Output file path
120
118
121
119
def run (self ) -> None :
122
- # Pack the molecular frames into a periodic box
123
120
box = pack(data = self .data, counts = self .counts, density = self .density)
124
- # Save the packed structure to the output file
125
121
ase.io.write(box, self .frames_path)
126
122
127
123
@ property
@@ -140,7 +136,6 @@ class MACE_MP:
140
136
model: str = " medium" # Default model type
141
137
142
138
def get_calculator (self , ** kwargs ):
143
- # Return a MACE-MP calculator instance
144
139
return mace_mp(model = self .model)
145
140
146
141
@@ -153,11 +148,8 @@ class StructureOptimization(zntrack.Node):
153
148
frames_path: Path = zntrack.outs_path(zntrack.nwd / " frames.traj" ) # Output file path
154
149
155
150
def run (self ):
156
- # Select the structure to optimize
157
151
atoms = self .data[self .data_id]
158
- # Attach the MACE-MP calculator
159
152
atoms.calc = self .model.get_calculator()
160
- # Run the geometry optimization
161
153
dyn = LBFGS(atoms, trajectory = self .frames_path)
162
154
dyn.run(fmax = 0.5 )
163
155
@@ -194,15 +186,15 @@ Now that we’ve defined all the necessary Nodes, we can build and execute the w
194
186
195
187
# Build the workflow graph
196
188
with project:
197
- etoh = Smiles2Conformers(smiles = " CCO" , numConfs = 32 ) # Generate conformers
198
- box = Pack(data = [etoh.frames], counts = [32 ], density = 789 ) # Pack the structures
199
- optm = StructureOptimization(model = model, data = box.frames, data_id = - 1 , fmax = 0.5 ) # Optimize the structure
189
+ etoh = Smiles2Conformers(smiles = " CCO" , numConfs = 32 )
190
+ box = Pack(data = [etoh.frames], counts = [32 ], density = 789 )
191
+ optm = StructureOptimization(model = model, data = box.frames, data_id = - 1 , fmax = 0.5 )
200
192
201
193
# Execute the workflow
202
194
project.repro()
203
195
```
204
196
205
- > ** TIP**
197
+ > [ ! TIP]
206
198
> 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.
207
199
208
200
#### Accessing Results
0 commit comments