Skip to content

Commit d860b0a

Browse files
committed
_ prefix unused variables
bump ruff from 0.1.7 to 0.1.8
1 parent 3933e7d commit d860b0a

37 files changed

+87
-90
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ci:
88

99
repos:
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.1.7
11+
rev: v0.1.8
1212
hooks:
1313
- id: ruff
1414
args: [--fix]
@@ -47,7 +47,7 @@ repos:
4747
- id: blacken-docs
4848

4949
- repo: https://github.com/igorshubovych/markdownlint-cli
50-
rev: v0.37.0
50+
rev: v0.38.0
5151
hooks:
5252
- id: markdownlint
5353
# MD013: line too long

pymatgen/analysis/adsorption.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ def get_mi_vec(slab):
601601
def get_rot(slab):
602602
"""Gets the transformation to rotate the z axis into the miller index."""
603603
new_z = get_mi_vec(slab)
604-
a, b, c = slab.lattice.matrix
604+
a, _b, _c = slab.lattice.matrix
605605
new_x = a / np.linalg.norm(a)
606606
new_y = np.cross(new_z, new_x)
607607
x, y, z = np.eye(3)

pymatgen/analysis/chemenv/connectivity/connected_components.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def draw_network(env_graph, pos, ax, sg=None, periodicity_vectors=None):
3333
c = Circle(pos[n], radius=0.02, alpha=0.5)
3434
ax.add_patch(c)
3535
env_graph.node[n]["patch"] = c
36-
x, y = pos[n]
36+
_x, _y = pos[n]
3737
ax.annotate(str(n), pos[n], ha="center", va="center", xycoords="data")
3838
seen = {}
3939
e = None

pymatgen/analysis/chemenv/coordination_environments/chemenv_strategies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ def get_site_neighbors(self, site, isite=None, dequivsite=None, dthissite=None,
596596
if isite is None:
597597
isite, dequivsite, dthissite, mysym = self.equivalent_site_index_and_transform(site)
598598

599-
ce, cn_map = self.get_site_coordination_environment(
599+
_ce, cn_map = self.get_site_coordination_environment(
600600
site=site,
601601
isite=isite,
602602
dequivsite=dequivsite,

pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def find_rotation(points_distorted, points_perfect):
313313
The rotation matrix.
314314
"""
315315
H = np.matmul(points_distorted.T, points_perfect)
316-
U, S, Vt = svd(H)
316+
U, _S, Vt = svd(H)
317317
return np.matmul(Vt.T, U.T)
318318

319319

pymatgen/analysis/chemenv/coordination_environments/voronoi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def neighbors_surfaces_bounded(self, isite, surface_calculation_options=None):
495495
ap2 = angle_bounds[iap]
496496
if ap2 < minang or ap1 > maxang:
497497
continue
498-
intersection, interror = rectangle_surface_intersection(
498+
intersection, _interror = rectangle_surface_intersection(
499499
rectangle=((d1, d2), (ap1, ap2)),
500500
f_lower=f_lower,
501501
f_upper=f_upper,

pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ def from_npoints_least_square_distance(cls, points):
10371037
for ii, pp in enumerate(points):
10381038
for jj in range(3):
10391039
AA[ii, jj] = pp[jj] - mean_point[jj]
1040-
[UU, SS, Vt] = np.linalg.svd(AA)
1040+
_UU, SS, Vt = np.linalg.svd(AA)
10411041
imin = np.argmin(SS)
10421042
normal_vector = Vt[imin]
10431043
non_zeros = np.argwhere(normal_vector != 0.0)

pymatgen/analysis/chemenv/utils/graph_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def order(self, raise_on_fail=True):
225225
self.ordered = False
226226
return
227227

228-
min_index, min_node = min(enumerate(self.nodes), key=operator.itemgetter(1))
228+
min_index, _min_node = min(enumerate(self.nodes), key=operator.itemgetter(1))
229229
reverse = self.nodes[(min_index - 1) % len(self.nodes)] < self.nodes[(min_index + 1) % len(self.nodes)]
230230
if reverse:
231231
self.nodes = self.nodes[min_index::-1] + self.nodes[:min_index:-1]
@@ -413,7 +413,7 @@ def order(self, raise_on_fail=True):
413413
self.ordered = False
414414
return
415415

416-
min_index, min_node = min(enumerate(self.nodes), key=operator.itemgetter(1))
416+
min_index, _min_node = min(enumerate(self.nodes), key=operator.itemgetter(1))
417417

418418
# Special case when number of nodes is 2 because the two
419419
# edge_indices refer to the same pair of nodes

pymatgen/analysis/chempot_diagram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ def _get_3d_domain_simplexes_and_ann_loc(
466466
into 2-dimensional space so that ConvexHull can be used to identify the
467467
bounding polygon.
468468
"""
469-
points_2d, v, w = simple_pca(points_3d, k=2)
469+
points_2d, _v, w = simple_pca(points_3d, k=2)
470470
domain = ConvexHull(points_2d)
471471
centroid_2d = get_centroid_2d(points_2d[domain.vertices])
472472
ann_loc = centroid_2d @ w.T + np.mean(points_3d.T, axis=1)

pymatgen/analysis/dimensionality.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,11 @@ def get_dimensionality_cheon(
338338
structure = structure_raw
339339
structure_save = copy.copy(structure_raw)
340340
connected_list1 = find_connected_atoms(structure, tolerance=tolerance, ldict=ldict)
341-
max1, min1, clusters1 = find_clusters(structure, connected_list1)
341+
max1, min1, _clusters1 = find_clusters(structure, connected_list1)
342342
if larger_cell:
343343
structure.make_supercell([[3, 0, 0], [0, 3, 0], [0, 0, 3]])
344344
connected_list3 = find_connected_atoms(structure, tolerance=tolerance, ldict=ldict)
345-
max3, min3, clusters3 = find_clusters(structure, connected_list3)
345+
max3, min3, _clusters3 = find_clusters(structure, connected_list3)
346346
if min3 == min1:
347347
dim = "0D" if max3 == max1 else "intercalated molecule"
348348
else:
@@ -354,7 +354,7 @@ def get_dimensionality_cheon(
354354
else:
355355
structure.make_supercell([[2, 0, 0], [0, 2, 0], [0, 0, 2]])
356356
connected_list2 = find_connected_atoms(structure, tolerance=tolerance, ldict=ldict)
357-
max2, min2, clusters2 = find_clusters(structure, connected_list2)
357+
max2, min2, _clusters2 = find_clusters(structure, connected_list2)
358358
if min2 == 1:
359359
dim = "intercalated ion"
360360
elif min2 == min1:
@@ -367,7 +367,7 @@ def get_dimensionality_cheon(
367367
structure = copy.copy(structure_save)
368368
structure.make_supercell([[3, 0, 0], [0, 3, 0], [0, 0, 3]])
369369
connected_list3 = find_connected_atoms(structure, tolerance=tolerance, ldict=ldict)
370-
max3, min3, clusters3 = find_clusters(structure, connected_list3)
370+
max3, min3, _clusters3 = find_clusters(structure, connected_list3)
371371
if min3 == min2:
372372
dim = "0D" if max3 == max2 else "intercalated molecule"
373373
else:

0 commit comments

Comments
 (0)