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/libxcfunccore.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! |
|
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_tablecore.bondscore.compositioncore.ioncore.latticecore.libxcfuncNew custom type:
MillerIndex = tuple[int, int, int]Bug fixes:
HOexists 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
Latticefixed in 88e4eda:pymatgen/pymatgen/core/lattice.py
Lines 837 to 838 in 2e1c301
Need confirmation:
Lattice._pbchas been redirected toLattice.pbc, with asettermethod. Wondering if there is any reason for the previous implementation?pymatgen/pymatgen/core/libxcfunc.py
Lines 502 to 504 in 2e1c301