|
1 | | -# -*- coding: utf-8 -*- |
2 | 1 | """ |
3 | 2 | Adapt from aiida-sssp-workflow as prototype |
4 | 3 | Will in here refactoring it so no need to use the aiida datatype as inputs. |
@@ -137,9 +136,9 @@ def calculate_eta_and_max_diff( |
137 | 136 | weight_a = bandsdata_a.get("weights") |
138 | 137 | weight_b = bandsdata_b.get("weights") |
139 | 138 | weight = weight_a |
140 | | - assert np.allclose( |
141 | | - weight_a, weight_b |
142 | | - ), "Different weight of kpoints of two calculation." |
| 139 | + assert np.allclose(weight_a, weight_b), ( |
| 140 | + "Different weight of kpoints of two calculation." |
| 141 | + ) |
143 | 142 |
|
144 | 143 | bands_a = bandsdata_a.get("bands") |
145 | 144 | bands_b = bandsdata_b.get("bands") |
@@ -229,10 +228,11 @@ def get_bands_distance( |
229 | 228 | # swap to make sure a is less electrons pseudo |
230 | 229 | bandsdata_a, bandsdata_b = bandsdata_b, bandsdata_a |
231 | 230 |
|
232 | | - assert ( |
233 | | - int(bandsdata_b["number_of_electrons"]) |
234 | | - >= int(bandsdata_a["number_of_electrons"]) |
235 | | - ), f"Need to be less num_bands in a {bandsdata_a['number_of_electrons']} than b {bandsdata_b['number_of_electrons']}" |
| 231 | + assert int(bandsdata_b["number_of_electrons"]) >= int( |
| 232 | + bandsdata_a["number_of_electrons"] |
| 233 | + ), ( |
| 234 | + f"Need to be less num_bands in a {bandsdata_a['number_of_electrons']} than b {bandsdata_b['number_of_electrons']}" |
| 235 | + ) |
236 | 236 |
|
237 | 237 | num_electrons_a = int(bandsdata_a["number_of_electrons"]) |
238 | 238 | num_electrons_b = int(bandsdata_b["number_of_electrons"]) |
@@ -262,9 +262,9 @@ def get_bands_distance( |
262 | 262 |
|
263 | 263 | # after cut and align in retrive band, the shapes are same now |
264 | 264 | # import ipdb; ipdb.set_trace() |
265 | | - assert np.shape(bandsdata_a["bands"]) == np.shape( |
266 | | - bandsdata_b["bands"] |
267 | | - ), f'{np.shape(bandsdata_a["bands"])} != {np.shape(bandsdata_b["bands"])}' |
| 265 | + assert np.shape(bandsdata_a["bands"]) == np.shape(bandsdata_b["bands"]), ( |
| 266 | + f"{np.shape(bandsdata_a['bands'])} != {np.shape(bandsdata_b['bands'])}" |
| 267 | + ) |
268 | 268 |
|
269 | 269 | # eta_v |
270 | 270 | fermi_shift_v = 0.0 |
|
0 commit comments