Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: change CifWriter to save only the element symbol, and not the entire species string #3071

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions pymatgen/io/cif.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import copy
import math
import os
import re
Expand Down Expand Up @@ -1355,7 +1356,9 @@ def __init__(
if symprec is None:
for site in struct:
for sp, occu in sorted(site.species.items()):
atom_site_type_symbol.append(str(sp))
sp_no_prop = copy.deepcopy(sp)
sp_no_prop._properties = {}
atom_site_type_symbol.append(str(sp_no_prop))
atom_site_symmetry_multiplicity.append("1")
atom_site_fract_x.append(format_str.format(site.a))
atom_site_fract_y.append(format_str.format(site.b))
Expand Down Expand Up @@ -1403,7 +1406,9 @@ def __init__(
),
):
for sp, occu in site.species.items():
atom_site_type_symbol.append(str(sp))
sp_no_prop = copy.deepcopy(sp)
sp_no_prop._properties = {}
atom_site_type_symbol.append(str(sp_no_prop))
atom_site_symmetry_multiplicity.append(f"{mult}")
atom_site_fract_x.append(format_str.format(site.a))
atom_site_fract_y.append(format_str.format(site.b))
Expand Down