[Dev] Better type annotations #3724
Closed
DanielYang59
started this conversation in
General
Replies: 1 comment
-
sorry for the lack of reply, i completely missed this. are there any open questions left here? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As we're pushing towards more (static) type annotation coverage across the code base, I'm experiencing multiple issues and I would like to hear about your suggestions on the best practice here.
For example the following
Kpoint
class annotated thekpts_shift
arg asVector3D
(tuple[float, float, float]
):pymatgen/pymatgen/io/vasp/inputs.py
Lines 1024 to 1042 in 2500664
As a result codes that returns a
list[float]
would be flagged as having wrong types, for example multiple lines in the following that generate alist[float]
instead oftuple[float, float, float]
:pymatgen/pymatgen/io/vasp/inputs.py
Lines 1371 to 1479 in 2500664
None
), for example in 3b293bf andpymatgen/pymatgen/io/vasp/optics.py
Lines 139 to 193 in 2500664
None
, which would surely make the code more robust (but more "messy" as well).Any advice would be appreciated. @janosh
Beta Was this translation helpful? Give feedback.
All reactions