materialsproject / pymatgen

Python Materials Genomics (pymatgen) is a robust materials analysis code that defines classes for structures and molecules with support for many electronic structure codes. It powers the Materials Project.
https://pymatgen.org
Other
1.48k stars 850 forks source link

String representation of Spin enum #3590

Open R1j1t opened 7 months ago

R1j1t commented 7 months ago

Should the string representations for Spin.up/Spin.down be "up" and "down" respectively?

https://github.com/materialsproject/pymatgen/blob/ac8a7e9cd93ba9f7afeaced45dc28af6d4e151d4/pymatgen/electronic_structure/core.py#L29-L30

Similar to OrbitalType:

https://github.com/materialsproject/pymatgen/blob/ac8a7e9cd93ba9f7afeaced45dc28af6d4e151d4/pymatgen/electronic_structure/core.py#L42-L43

mkhorton commented 7 months ago

Changing the __repr__ would be a safer option than changing __str__ if we want something more readable.