Skip to content

Commit 3c22459

Browse files
simplify test files
1 parent e244c89 commit 3c22459

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

tests/analysis/fstar/test_fstar.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,26 @@
99

1010
class Test_FStarDiagram(PymatgenTest):
1111
def setUp(self):
12-
self.cif_gz = tarfile.open(f"{TEST_FILES_DIR}/fstar/fstar.tar.gz", "r")
1312
self.struct_list = [
14-
CifParser.from_str(self.cif_gz.extractfile(file).read().decode("utf-8")).get_structures(
15-
primitive=False, symmetrized=True, check_occu=False
16-
)[0]
17-
for file in self.cif_gz.getnames()
13+
CifParser(f"{TEST_FILES_DIR}/rhomb_3478.cif").get_structures(primitive=False, symmeterized=True)[0]
1814
]
1915
self.fstar = FStarDiagram(structures=self.struct_list)
2016

2117
def test_edit_fstar_diagram(self):
22-
assert self.fstar.site_labels == ["[0. 0. 0.25]O", "[0. 0. 0.5]Co", "[0. 0. 0.]Li"]
18+
assert self.fstar.site_labels == ["[0.890001 0.890001 0.890001]O", "[0. 0. 0.]Cu", "[0.5 0.5 0.5]Al"]
2319
new = FStarDiagram(structures=self.struct_list)
2420
assert self.fstar.plot == new.plot
25-
new.combine_sites(site_lists=[["[0. 0. 0.5]Co", "[0. 0. 0.]Li"]])
21+
new.combine_sites(site_lists=[["[0. 0. 0.]Cu", "[0.5 0.5 0.5]Al"]])
2622
assert new.site_labels == [
27-
"[0. 0. 0.25]O",
28-
"[0. 0. 0.5]Co",
29-
"[0. 0. 0.]Li",
30-
"['[0. 0. 0.5]Co', '[0. 0. 0.]Li']",
23+
"[0.890001 0.890001 0.890001]O",
24+
"[0. 0. 0.]Cu",
25+
"[0.5 0.5 0.5]Al",
26+
"['[0. 0. 0.]Cu', '[0.5 0.5 0.5]Al']",
3127
]
32-
assert list(new.fstar_coords["['[0. 0. 0.5]Co', '[0. 0. 0.]Li']"].to_numpy()) == list(
33-
self.fstar.fstar_coords["[0. 0. 0.]Li"].to_numpy() + self.fstar.fstar_coords["[0. 0. 0.5]Co"].to_numpy()
28+
assert list(new.fstar_coords["['[0. 0. 0.]Cu', '[0.5 0.5 0.5]Al']"].to_numpy()) == list(
29+
self.fstar.fstar_coords["[0. 0. 0.]Cu"].to_numpy() + self.fstar.fstar_coords["[0.5 0.5 0.5]Al"].to_numpy()
3430
)
35-
new.set_plot_list(site_list=["[0. 0. 0.5]Co", "[0. 0. 0.25]O", "[0. 0. 0.]Li"])
31+
new.set_plot_list(site_list=["[0. 0. 0.]Cu", "[0.890001 0.890001 0.890001]O", "[0.5 0.5 0.5]Al"])
3632
assert self.fstar.plot_list != new.plot_list
3733
new.make_plot()
3834
assert self.fstar.plot != new.plot

tests/files/fstar/fstar.tar.gz

-3.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)