-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix type hints errors; add type checker #92
Conversation
This commit uses microsoft/pyright as a type checker. Several errors have been fixed. Sometimes the type of a varible is too "dynamic". It will be helpful to use `assert` to narrow types. Finally, one can add `# type: ignore` to skip type checker of a line.
Codecov ReportBase: 75.51% // Head: 75.48% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #92 +/- ##
==========================================
- Coverage 75.51% 75.48% -0.04%
==========================================
Files 62 62
Lines 2618 2631 +13
==========================================
+ Hits 1977 1986 +9
- Misses 641 645 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
dpgen2/fp/vasp.py
Outdated
@@ -37,7 +38,10 @@ def __init__( | |||
""" | |||
self.kspacing = kspacing | |||
self.kgamma = kgamma | |||
# TODO: not acctually optional |
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.
I agree with you. Could you please remove the Optional
of the incar_template_name
and potcar_names
? Thanks!
@@ -41,7 +41,7 @@ def __init__( | |||
run_train_op : OP, | |||
prep_config : dict = normalize_step_dict({}), | |||
run_config : dict = normalize_step_dict({}), | |||
upload_python_package : str = None, | |||
upload_python_package : Optional[List[os.PathLike]] = None, |
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.
Should be list
but used by dpgen2 as a str
. Will be fixed by a separate PR.
This commit uses microsoft/pyright as a type checker. Several errors have been fixed.
Sometimes the type of a variable is too "dynamic". It will be helpful to use
assert
to narrow the types. Finally, one can add# type: ignore
to skip the type checking of a line.