Commit 782e638
🐛 Protocols: Fix behaviour for
There are currently two bugs in the `PwBaseWorkChain.get_builder_from_protocol()`
method when the users overrides the `pw.pseudos` input:
1. For magnetic calculations, the `starting_magnetization` is still constructed based on
the number of valence electrons (`z_valence`) from the `pseudo_family`.
2. If the user overrides the `pseudos` input but doesn't override the cutoffs
(`SYSTEM.ecutrho`, `SYSTEM.ecutwfc`), these are still (silently) taken from the
`pseudo_family`.
Here we fix these two issues by
1. Passing the `z_valences` of the provides `pseudos` override to the
`get_magnetization` function.
2. Strictly checking the overrides: they should both (i) provide pseudo
potentials for _all_ the kinds in the input `structure` and (ii) provide both
energy cutoffs (`SYSTEM.ecutrho`, `SYSTEM.ecutwfc`) in case the `pseudos` are
overridden.
Moreover, if the user completely specifies the pseudos and cutoffs through the
overrides, it should be fine in case `pseudo_family` is None or False. This is important
in the context of adding custom pseudo potential functionality in the QEapp, see:
aiidalab/aiidalab-qe#1348
Co-authored-by: Edan Bainglass <edan.bainglass@gmail.com>pseudos overrides1 parent 722a542 commit 782e638
2 files changed
Lines changed: 131 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | 159 | | |
177 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
178 | 196 | | |
179 | 197 | | |
180 | | - | |
181 | | - | |
182 | 198 | | |
183 | | - | |
| 199 | + | |
184 | 200 | | |
185 | 201 | | |
186 | 202 | | |
| |||
191 | 207 | | |
192 | 208 | | |
193 | 209 | | |
194 | | - | |
| 210 | + | |
195 | 211 | | |
196 | | - | |
| 212 | + | |
197 | 213 | | |
198 | 214 | | |
199 | 215 | | |
| |||
217 | 233 | | |
218 | 234 | | |
219 | 235 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | 236 | | |
224 | 237 | | |
225 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
217 | 295 | | |
218 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
219 | 300 | | |
220 | 301 | | |
221 | 302 | | |
| |||
0 commit comments