Skip to content

Commit f8fd454

Browse files
AntObiAnthonyjanosh
authored
Fix for incorrect file path in tests/io/test_zeopp.py (#3784)
* Fix filepaths to test files in zeopp tests * format * fix ruff 0.4.2: pymatgen/util/due.py:54:46: UP031 Use format specifiers instead of percent format --------- Co-authored-by: Anthony <[email protected]> Co-authored-by: Janosh Riebesell <[email protected]>
1 parent b04c43e commit f8fd454

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

pymatgen/core/structure.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4291,8 +4291,7 @@ def perturb(self, distance: float, min_distance: float | None = None) -> Self:
42914291
symmetries. Modifies the structure in place.
42924292
42934293
Args:
4294-
distance (float): Distance in angstroms by which to perturb each
4295-
site.
4294+
distance (float): Distance in angstroms by which to perturb each site.
42964295
min_distance (None, int, or float): if None, all displacements will
42974296
be equal amplitude. If int or float, perturb each site a
42984297
distance drawn from the uniform distribution between

pymatgen/util/due.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _donothing_func(*args, **kwargs):
5151
raise RuntimeError("Imported due lacks .cite. DueCredit is now disabled")
5252
except Exception as exc:
5353
if not isinstance(exc, ImportError):
54-
logging.getLogger("duecredit").error("Failed to import duecredit due to %s" % str(exc))
54+
logging.getLogger("duecredit").error(f"Failed to import duecredit due to {exc}")
5555
# Initiate due stub
5656
due = InactiveDueCreditCollector()
5757
BibTeX = Doi = Url = Text = _donothing_func

tests/analysis/test_graphs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ def test_mul(self):
339339
assert nio_struct_graph.get_coordination_of_site(n) == 6
340340

341341
@pytest.mark.skipif(
342-
pygraphviz is None or not (which("neato") and which("fdp")), reason="graphviz executables not present"
342+
pygraphviz is None or not (which("neato") and which("fdp")),
343+
reason="graphviz executables not present",
343344
)
344345
def test_draw(self):
345346
# draw MoS2 graph

tests/io/test_zeopp.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
__date__ = "Aug 2, 2013"
3333

3434

35-
@pytest.mark.skipif(zeo is None, reason="zeo not present.")
35+
@pytest.mark.skipif(zeo is None, reason="zeo not present")
3636
class TestZeoCssr(TestCase):
3737
def setUp(self):
3838
filepath = f"{VASP_IN_DIR}/POSCAR"
@@ -70,12 +70,12 @@ def test_str(self):
7070
assert str(self.zeo_cssr) == expected_string
7171

7272
def test_from_file(self):
73-
filename = f"{TEST_FILES_DIR}/cssr/EDI.cssr"
73+
filename = f"{TEST_FILES_DIR}/io/cssr/EDI.cssr"
7474
zeo_cssr = ZeoCssr.from_file(filename)
7575
assert isinstance(zeo_cssr.structure, Structure)
7676

7777

78-
@pytest.mark.skipif(zeo is None, reason="zeo not present.")
78+
@pytest.mark.skipif(zeo is None, reason="zeo not present")
7979
class TestZeoCssrOxi(TestCase):
8080
def setUp(self):
8181
filepath = f"{VASP_IN_DIR}/POSCAR"
@@ -114,12 +114,12 @@ def test_str(self):
114114
assert str(self.zeo_cssr) == expected_string
115115

116116
def test_from_file(self):
117-
filename = f"{TEST_FILES_DIR}/cssr/EDI_oxistate_decorated.cssr"
117+
filename = f"{TEST_FILES_DIR}/io/cssr/EDI_oxistate_decorated.cssr"
118118
zeocssr = ZeoCssr.from_file(filename)
119119
assert isinstance(zeocssr.structure, Structure)
120120

121121

122-
@pytest.mark.skipif(zeo is None, reason="zeo not present.")
122+
@pytest.mark.skipif(zeo is None, reason="zeo not present")
123123
class TestZeoVoronoiXYZ(TestCase):
124124
def setUp(self):
125125
coords = [
@@ -150,7 +150,7 @@ def test_from_file(self):
150150
assert isinstance(voronoi.molecule, Molecule)
151151

152152

153-
@pytest.mark.skipif(zeo is None, reason="zeo not present.")
153+
@pytest.mark.skipif(zeo is None, reason="zeo not present")
154154
class TestGetVoronoiNodes(TestCase):
155155
def setUp(self):
156156
filepath = f"{VASP_IN_DIR}/POSCAR"
@@ -189,7 +189,7 @@ def test_get_free_sphere_params(self):
189189
assert free_sph_params["inc_sph_along_free_sph_path_max_dia"] == approx(2.58251, abs=1e-1)
190190

191191

192-
@pytest.mark.skipif(zeo is None, reason="zeo not present.")
192+
@pytest.mark.skipif(zeo is None, reason="zeo not present")
193193
class TestGetHighAccuracyVoronoiNodes(TestCase):
194194
def setUp(self):
195195
filepath = f"{VASP_IN_DIR}/POSCAR"
@@ -209,7 +209,7 @@ def test_get_voronoi_nodes(self):
209209
assert isinstance(vor_node_struct, Structure)
210210

211211

212-
@pytest.mark.skipif(zeo is None, reason="zeo not present.")
212+
@pytest.mark.skipif(zeo is None, reason="zeo not present")
213213
class TestGetVoronoiNodesMultiOxi(TestCase):
214214
def setUp(self):
215215
filepath = f"{VASP_IN_DIR}/POSCAR"

0 commit comments

Comments
 (0)