Skip to content

Commit 76dadf4

Browse files
authored
Merge branch 'main' into sph_harm
2 parents 3897212 + 1c1fc14 commit 76dadf4

File tree

8 files changed

+16
-13
lines changed

8 files changed

+16
-13
lines changed

.ci_support/release.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def get_setup_version_and_pattern(setup_content):
1515
version_lst.append(dep.split("==")[1])
1616
depend_lst.append(dep.split("==")[0])
1717

18-
version_high_dict = {d: v for d, v in zip(depend_lst, version_lst)}
18+
version_high_dict = {d: v for d, v in zip(depend_lst, version_lst, strict=True)}
1919
return version_high_dict
2020

2121

@@ -30,7 +30,7 @@ def get_env_version(env_content):
3030
if len(lst) == 2:
3131
depend_lst.append(lst[0])
3232
version_lst.append(lst[1])
33-
return {d: v for d, v in zip(depend_lst, version_lst)}
33+
return {d: v for d, v in zip(depend_lst, version_lst, strict=True)}
3434

3535

3636
def update_dependencies(setup_content, version_low_dict, version_high_dict):

structuretoolkit/analyse/neighbors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def _contract(
294294
return value
295295
return [
296296
vv[: np.sum(dist < np.inf)]
297-
for vv, dist in zip(value, self.filled.distances)
297+
for vv, dist in zip(value, self.filled.distances, strict=True)
298298
]
299299

300300
def _allow_ragged_to_mode(self, new_bool: bool) -> str:
@@ -1321,7 +1321,7 @@ def get_cluster(
13211321
el_list = self._ref_structure.get_chemical_symbols()
13221322

13231323
ind_shell = []
1324-
for d, i in zip(dist, ind):
1324+
for d, i in zip(dist, ind, strict=True):
13251325
id_list = get_cluster(d[d < radius], i[d < radius])
13261326
ia_shells_dict = {}
13271327
for i_shell_list in id_list:

structuretoolkit/analyse/pyscal.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def get_steinhardt_parameters(
5555

5656
cl = cluster.KMeans(n_clusters=n_clusters)
5757

58-
ind = cl.fit(list(zip(*sysq))).labels_
58+
ind = cl.fit(list(zip(*sysq, strict=True))).labels_
5959
return sysq, ind
6060
else:
6161
return sysq
@@ -197,7 +197,10 @@ def get_adaptive_cna_descriptors(
197197
if not ovito_compatibility:
198198
return cna
199199
else:
200-
return {o: cna[p] for o, p in zip(ovito_parameter, pyscal_parameter)}
200+
return {
201+
o: cna[p]
202+
for o, p in zip(ovito_parameter, pyscal_parameter, strict=True)
203+
}
201204
else:
202205
cnalist = np.array(sys.atoms.structure)
203206
if mode == "numeric":

structuretoolkit/analyse/snap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ def _set_computes_snap(lmp, bispec_options: dict):
524524
kw_substrings = [f"{k} {v}" for k, v in kw_options.items()]
525525
kwargs = " ".join(kw_substrings)
526526

527-
for _op, base in zip(("b", "db", "vb"), (base_b, base_db, base_vb)):
527+
for _op, base in zip(("b", "db", "vb"), (base_b, base_db, base_vb), strict=True):
528528
command = f"{base} {radelem} {wj} {kwargs}"
529529
lmp.command(command)
530530

structuretoolkit/build/sqs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def transpose(it: Iterable[Iterable]) -> Iterable[tuple]:
154154
Iterable[tuple]: The transposed iterable.
155155
156156
"""
157-
return zip(*it)
157+
return zip(*it, strict=True)
158158

159159

160160
def sqs_structures(

structuretoolkit/visualize.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def _draw_box_plotly(fig: Any, structure: Atoms, px: Any, go: Any) -> Any:
195195
cell = get_cell(structure)
196196
data = fig.data
197197
for lines in _get_box_skeleton(cell):
198-
fig = px.line_3d(**dict(zip(["x", "y", "z"], lines.T)))
198+
fig = px.line_3d(**dict(zip(["x", "y", "z"], lines.T, strict=True)))
199199
fig.update_traces(line_color="#000000")
200200
data = fig.data + data
201201
return go.Figure(data=data)
@@ -462,7 +462,7 @@ def _plot3d(
462462
vector_color = np.ones((len(structure), 3)) * vector_color
463463

464464
if vector_field is not None:
465-
for arr, pos, col in zip(vector_field, positions, vector_color):
465+
for arr, pos, col in zip(vector_field, positions, vector_color, strict=True):
466466
view.shape.add_arrow(list(pos), list(pos + arr), list(col), 0.2)
467467

468468
if show_axes: # Add axes
@@ -689,7 +689,7 @@ def _add_colorscheme_spacefill(
689689
Returns:
690690
(nglview.NGLWidget): The modified widget.
691691
"""
692-
for elem, num in set(zip(elements, atomic_numbers)):
692+
for elem, num in set(zip(elements, atomic_numbers, strict=True)):
693693
view.add_spacefill(
694694
selection="#" + elem,
695695
radius_type="vdw",

tests/test_neighbors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def test_atom_numbers(self):
396396
neigh = stk.analyse.get_neighbors(
397397
structure=structure, cutoff_radius=r, num_neighbors=None, mode="ragged"
398398
)
399-
for i, (a, d) in enumerate(zip(neigh.atom_numbers, neigh.distances)):
399+
for i, (a, d) in enumerate(zip(neigh.atom_numbers, neigh.distances, strict=True)):
400400
self.assertEqual(np.sum(a - len(d) * [i]), 0)
401401
neigh = stk.analyse.get_neighbors(
402402
structure=structure, cutoff_radius=r, num_neighbors=None, mode="flattened"

tests/test_symmetry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def test_permutations(self):
285285
vec[neigh.indices[0]] = neigh.vecs[0]
286286
sym = stk.analyse.get_symmetry(structure=structure)
287287
all_vectors = np.einsum("ijk,ink->inj", sym.rotations, vec[sym.permutations])
288-
for i, v in zip(neigh.indices, neigh.vecs):
288+
for i, v in zip(neigh.indices, neigh.vecs, strict=True):
289289
vec = np.zeros_like(structure.positions)
290290
vec[i] = v
291291
self.assertAlmostEqual(

0 commit comments

Comments
 (0)