Skip to content

Commit 1ad865f

Browse files
committed
fix
1 parent 6ef9db1 commit 1ad865f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/test_phonons_cli.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_phonons(tmp_path):
6666

6767
has_eigenvectors = False
6868
has_velocity = False
69-
with lzma.open(bands_path, mode="rt") as file:
69+
with open(bands_path) as file:
7070
for line in file:
7171
if "eigenvector" in line:
7272
has_eigenvectors = True
@@ -109,7 +109,7 @@ def test_phonons(tmp_path):
109109
def test_bands_simple(tmp_path):
110110
"""Test calculating force constants and reduced bands information."""
111111
file_prefix = tmp_path / "NaCl"
112-
autoband_results = tmp_path / "NaCl-auto_bands.yml.xz"
112+
autoband_results = tmp_path / "NaCl-auto_bands.yml"
113113
summary_path = tmp_path / "NaCl-phonons-summary.yml"
114114

115115
result = runner.invoke(
@@ -153,6 +153,7 @@ def test_hdf5(tmp_path):
153153
file_prefix = tmp_path / "test" / "NaCl"
154154
phonon_results = tmp_path / "test" / "NaCl-phonopy.yml"
155155
hdf5_results = tmp_path / "test" / "NaCl-force_constants.hdf5"
156+
bands_results = tmp_path / "test" / "NaCl-auto_bands.hdf5"
156157
summary_path = tmp_path / "test" / "NaCl-phonons-summary.yml"
157158
log_path = tmp_path / "test" / "NaCl-phonons-log.yml"
158159

@@ -164,6 +165,7 @@ def test_hdf5(tmp_path):
164165
DATA_PATH / "NaCl.cif",
165166
"--arch",
166167
"mace_mp",
168+
"--bands",
167169
"--file-prefix",
168170
file_prefix,
169171
"--hdf5",
@@ -172,6 +174,7 @@ def test_hdf5(tmp_path):
172174
assert result.exit_code == 0
173175
assert phonon_results.exists()
174176
assert hdf5_results.exists()
177+
assert bands_results.exists()
175178

176179
# Read phonons summary file
177180
with open(summary_path, encoding="utf8") as file:
@@ -180,7 +183,7 @@ def test_hdf5(tmp_path):
180183
output_files = {
181184
"params": phonon_results,
182185
"force_constants": hdf5_results,
183-
"bands": None,
186+
"bands": bands_results,
184187
"bands_plot": None,
185188
"dos": None,
186189
"dos_plot": None,
@@ -289,10 +292,10 @@ def test_plot(tmp_path):
289292
"""Test for plotting routines."""
290293
file_prefix = tmp_path / "NaCl"
291294
phonon_results = tmp_path / "NaCl-phonopy.yml"
292-
bands_path = tmp_path / "NaCl-auto_bands.yml.xz"
295+
bands_path = tmp_path / "NaCl-auto_bands.yml"
293296
pdos_results = tmp_path / "NaCl-pdos.dat"
294297
dos_results = tmp_path / "NaCl-dos.dat"
295-
autoband_results = tmp_path / "NaCl-auto_bands.yml.xz"
298+
autoband_results = tmp_path / "NaCl-auto_bands.yml"
296299
summary_path = tmp_path / "NaCl-phonons-summary.yml"
297300
log_path = tmp_path / "NaCl-phonons-log.yml"
298301
svgs = [
@@ -630,7 +633,7 @@ def test_paths(tmp_path):
630633
"""Test passing qpoint file."""
631634
file_prefix = tmp_path / "NaCl"
632635
qpoint_file = DATA_PATH / "paths.yml"
633-
band_results = tmp_path / "NaCl-bands.yml.xz"
636+
band_results = tmp_path / "NaCl-bands.yml"
634637

635638
result = runner.invoke(
636639
app,

0 commit comments

Comments
 (0)