Skip to content

CIF parsing does not work when pdb flags are used #4583

@Andrew-S-Rosen

Description

@Andrew-S-Rosen

Python version

3.12

Pymatgen version

2025.10.7

Operating system version

No response

Current behavior

The Pymatgen CIF parser cannot properly parse CIFs where the pdb formatting flags are used. Most parsers can't, although the official CCDC Mercury GUI can. This is a horrible format, and I'm not suggesting someone waste their time to fix it, but I'm reporting it anyway.

demo.cif.txt

from pymatgen.core import Structure

s = Structure.from_file('demo.cif')

Expected Behavior

CIF should be parsed.

Minimal example

Relevant files to reproduce this bug

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions