-
Notifications
You must be signed in to change notification settings - Fork 865
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
Add types for core.periodic_table/bonds/composition/ion/lattice/libxcfunc
, new type MillerIndex
and fix Lattice hash
#3814
Conversation
Note Reviews PausedUse the following commands to manage reviews:
WalkthroughThe updates to Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai ignore |
core.periodic_table
types and docstringcore.periodic_table/composition
types and docstring
This comment was marked as outdated.
This comment was marked as outdated.
core.periodic_table/bonds/composition/ion/lattice/libxcfunc
core.periodic_table/bonds/composition/ion/lattice/libxcfunc
, new type MillerIndex
and fix Lattice hash
This reverts commit 7930238.
Please review this one as well @janosh. Appreciate your time! |
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.
thanks @DanielYang59, lgtm! 👍
Thanks for reviewing @janosh! Do you have any comments on the "Need Confirmation" section of the PR summary #3814 (comment)? Regarding (1), I noticed multiple part of For example (not exhaustive): pymatgen/pymatgen/core/lattice.py Lines 111 to 112 in 578d29c
pymatgen/pymatgen/core/lattice.py Lines 201 to 204 in 578d29c
Is it related to: pymatgen/pymatgen/core/lattice.py Line 44 in 578d29c
|
using the attribute directly instead of the property method doesn't add to the call stack and so saves small amount of work. but you can't lazy-load an attribute like you can a property. same with caching. that's probably what "Properties lazily generated for efficiency. " is referring to
not that i'm aware. your way makes more sense imo |
i think that's safe to remove |
Thanks for the input. It's very helpful. I would do them in a future PR. Also worth north is the pymatgen/dev_scripts/regen_libxcfunc.py Lines 107 to 111 in 578d29c
pymatgen/pymatgen/core/libxcfunc.py Lines 34 to 408 in 578d29c
|
Summary
Add types annotations for:
core.periodic_table
core.bonds
core.composition
core.ion
core.lattice
core.libxcfunc
New custom type:
MillerIndex = tuple[int, int, int]
Bug fixes:
HO
exists and replace them withOH
. So the condition should beif (self.composition.get("H") and self.composition.get("O")) is not None:
, fixed in b4a70ee:pymatgen/pymatgen/core/ion.py
Lines 144 to 145 in 2e1c301
Lattice
fixed in 88e4eda:pymatgen/pymatgen/core/lattice.py
Lines 837 to 838 in 2e1c301
Need confirmation:
Lattice._pbc
has been redirected toLattice.pbc
, with asetter
method. Wondering if there is any reason for the previous implementation?pymatgen/pymatgen/core/libxcfunc.py
Lines 502 to 504 in 2e1c301