Skip to content
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

Merged
merged 6 commits into from
Oct 24, 2022

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Oct 24, 2022

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.

njzjz added 2 commits October 22, 2022 21:25
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-commenter
Copy link

codecov-commenter commented Oct 24, 2022

Codecov Report

Base: 75.51% // Head: 75.48% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (641f4f6) compared to base (c5bc4d6).
Patch coverage: 75.00% of modified lines in pull request are covered.

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     
Impacted Files Coverage Δ
dpgen2/entrypoint/download.py 0.00% <0.00%> (ø)
dpgen2/entrypoint/submit.py 0.00% <0.00%> (ø)
dpgen2/entrypoint/watch.py 66.66% <ø> (ø)
dpgen2/exploration/report/trajs_report.py 98.27% <ø> (ø)
...ion/scheduler/convergence_check_stage_scheduler.py 98.00% <ø> (ø)
dpgen2/exploration/selector/conf_filter.py 95.23% <ø> (ø)
dpgen2/exploration/selector/conf_selector_frame.py 100.00% <ø> (ø)
...pgen2/exploration/task/conf_sampling_task_group.py 100.00% <ø> (ø)
dpgen2/exploration/task/lmp_template_task_group.py 95.45% <ø> (ø)
dpgen2/exploration/task/npt_task_group.py 95.34% <ø> (ø)
... and 15 more

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -37,7 +38,10 @@ def __init__(
"""
self.kspacing = kspacing
self.kgamma = kgamma
# TODO: not acctually optional

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,
Copy link

@wanghan-iapcm wanghan-iapcm Oct 24, 2022

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.

@wanghan-iapcm wanghan-iapcm merged commit de21500 into deepmodeling:master Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants