Skip to content

Commit c51f523

Browse files
committed
ENH: process CIFs with curly-bracket values
1 parent dfcb2aa commit c51f523

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/diffpy/structure/parsers/p_cif.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ def _parseCifDataSource(self, datasource):
309309
self.stru = None
310310
try:
311311
with _suppressCifParserOutput():
312-
self.ciffile = CifFile(datasource)
312+
# Use `grammar` option to digest values with curly-brackets.
313+
# Ref: https://bitbucket.org/jamesrhester/pycifrw/issues/19
314+
self.ciffile = CifFile(datasource, grammar='auto')
313315
for blockname in self.ciffile.keys():
314316
self._parseCifBlock(blockname)
315317
# stop after reading the first structure

src/diffpy/structure/tests/testp_cif.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ def test_adp_aniso_label(self):
344344
return
345345

346346

347-
@unittest.expectedFailure
348347
def test_curly_brace(self):
349348
"verify loading of a CIF file with unquoted curly brace"
350349
ptest = self.ptest

0 commit comments

Comments
 (0)