Skip to content

Commit 9cbbdaf

Browse files
ruff fixes
1 parent fbc2e32 commit 9cbbdaf

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

pymatgen/analysis/fstar/fstar.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def edit_fstar_diagram(self, combine_list=False, plot_list=False, **kwargs):
7676

7777
def get_site_labels(self):
7878
"""
79-
Generates unique site labels based on composition, order, and symetry equivalence in the structure object.
79+
Generates unique site labels based on composition, order, and symmetry equivalence in the structure object.
8080
Ex:
8181
Structure Summary
8282
Lattice
@@ -144,14 +144,10 @@ def get_fstar_coords(self):
144144
if n == str(sp.element):
145145
f_occ = float(NEUTRON_SCATTER_DF.loc[i]['Coh b']) * occ
146146
break
147-
else:
148-
continue
149147
else:
150148
if n == str(sp):
151149
f_occ = float(NEUTRON_SCATTER_DF.loc[i]['Coh b']) * occ
152150
break
153-
else:
154-
continue
155151
if self._scatter == 'Custom':
156152
if hasattr(sp, "element"):
157153
f_occ = self._custscat(str(sp.element), occ, ind1, ind2)

tests/analysis/fstar/test_fstar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def test_edit_fstar_diagram(self):
2323
new.edit_fstar_diagram(combine_list=[['[0. 0. 0.5]Co', '[0. 0. 0.]Li']])
2424
self.assertEqual(new.site_labels, ['[0. 0. 0.]Li', '[0. 0. 0.5]Co', '[0. 0. 0.25]O',
2525
"['[0. 0. 0.5]Co', '[0. 0. 0.]Li']"])
26-
self.assertEqual(list(new.coords["['[0. 0. 0.5]Co', '[0. 0. 0.]Li']"].values),
27-
list(self.fstar.coords['[0. 0. 0.]Li'].values+self.fstar.coords['[0. 0. 0.5]Co'].values))
26+
self.assertEqual(list(new.coords["['[0. 0. 0.5]Co', '[0. 0. 0.]Li']"].to_numpy()),
27+
list(self.fstar.coords['[0. 0. 0.]Li'].values+self.fstar.coords['[0. 0. 0.5]Co'].to_numpy()))
2828
self.assertEqual(self.fstar.plot, new.plot)
2929
new.edit_fstar_diagram(plot_list=['[0. 0. 0.5]Co', '[0. 0. 0.25]O', '[0. 0. 0.]Li'])
3030
self.assertTrue(self.fstar.plot != new.plot)

0 commit comments

Comments
 (0)