-
Notifications
You must be signed in to change notification settings - Fork 868
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
Propagate labels through various Structure operations #3183
Conversation
Thank you very much @stefsmeets, this is great! 🙏 Just to get an overview, are there more structure operations that are known to drop the site labels? Supercells, inserting/deleting sites, applying translations/rotations are all very important. Just want to leave a record here of what else might need doing in the future. |
@janosh Good point, I think these functions could still be updated:
I will update the PR with fixes for these today or tomorrow. There is also the CIF writer which drops the labels. I looked at this before, but I found it a bit tricky to update. |
Feel free to just leave a todo comment for CIFParser so that we know it should still be done at some point. |
I had a go at updating the I also updated Let me know what you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost ready to merge! Thanks for the great work. I think making label
a @property
was the right call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefsmeets Thanks a lot for this PR! You really went the extra mile.
I noticed that performing a |
I don't have any particular thoughts on this, but I can see how it would be confusing. What would you expect to happen? |
maybe update the label to |
I can have a go at this next week. I created a new issue out of it to keep track. |
I think this caused a regression in CIF output: #3761 |
Summary
This PR follows up from #3137 and makes sure that labels are propagated correctly throughout structure, for example, when making supercells, inserting/deleting sites, applying translations/rotations, etc.
This PR also fixes a bug where the labels were incorrectly assigned when the CIF contains multiple species with different names.
Major changes:
Checklist
ruff
.mypy
.duecredit
@due.dcite
decorators to reference relevant papers by DOI (example)Tip: Install
pre-commit
hooks to auto-check types and linting before every commit: