Skip to content

Commit 27a4de9

Browse files
committed
test expected to fail
1 parent e3145c1 commit 27a4de9

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/test_coordinate_source.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import mrcfile
1010
import numpy as np
11+
import pytest
1112
from click.testing import CliRunner
1213
from pandas import DataFrame
1314

@@ -275,7 +276,7 @@ def createTestCtfFiles(self, index):
275276
starfile = StarFile(blocks=blocks)
276277
starfile.write(star_fp)
277278

278-
def createTestRelionCtfFile(self):
279+
def createTestRelionCtfFile(self, reverse_optics_block_rows=False):
279280
"""
280281
Creates example RELION-generated CTF file for a set of micrographs.
281282
"""
@@ -295,6 +296,11 @@ def createTestRelionCtfFile(self):
295296
["opticsGroup1", 1, 500.0, 700.0, 600.0, 400.0],
296297
["opticsGroup2", 2, 501.0, 701.0, 601.0, 401.0],
297298
]
299+
# Since optics block rows are self-contained,
300+
# reversing their order should have no affect anywhere.
301+
if reverse_optics_block_rows:
302+
optics_block = optics_block[::-1]
303+
298304
blocks["optics"] = DataFrame(optics_block, columns=optics_columns)
299305

300306
micrographs_columns = [
@@ -539,6 +545,16 @@ def testImportCtfFromRelion(self):
539545
self._testCtfFilters(src)
540546
self._testCtfMetadata(src)
541547

548+
@pytest.mark.xfail(strict=True)
549+
def testImportCtfFromRelionReverseOpticsGroup(self):
550+
self.relion_ctf_file = self.createTestRelionCtfFile(
551+
reverse_optics_block_rows=True
552+
)
553+
src = BoxesCoordinateSource(self.files_box)
554+
src.import_relion_ctf(self.relion_ctf_file)
555+
self._testCtfFilters(src)
556+
self._testCtfMetadata(src)
557+
542558
def testImportCtfFromRelionLegacy(self):
543559
src = BoxesCoordinateSource(self.files_box)
544560
src.import_relion_ctf(self.relion_legacy_ctf_file)

0 commit comments

Comments
 (0)