Closed pmrv closed 2 weeks ago
The modification in the symmetry.py
file involves changing the info
method of a class to use dataclasses.asdict
for converting the output of spglib.get_symmetry_dataset
into a dictionary format. This affects the output structure while maintaining the existing control flow and error handling.
File | Change Summary |
---|---|
structuretoolkit/analyse/symmetry.py |
Updated the info method to use dataclasses.asdict for converting the symmetry dataset output into a dictionary format. |
🐇 In the land of code where changes bloom,
A method transformed, dispelling the gloom.
From lists to dicts, a clearer sight,
Data now dances, oh what a delight!
With every new line, the rabbits cheer,
For structured data brings us near! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@pmrv As far as I understand dataclasses were only recently introduced in spglib
in 2.5.0
: https://github.com/spglib/spglib/releases - so this means we have to update the lower bound to 2.5.0 as well. The release is 1.5 months old, so I am fine with upgrading the lower bound we just have to check if it can have any other implications.
Right, I hadn't considered. I'll put a patch tomorrow so that old versions work too.
* Maintained existing error handling for cases where the symmetry dataset is `None`, ensuring stability
Note to myself: This is wrong, the commit actually introduces a new bug when the returned info is None
.
spglib.get_symmetry_dataset now returns a dataclass and throws warnings on getitem. This affects our Symmetry class when using the .info attribute.
Summary by CodeRabbit
New Features
Bug Fixes
None
, ensuring stability.