-
Notifications
You must be signed in to change notification settings - Fork 868
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
Reformat docstrings to Google style and add type annotations #3694
Reformat docstrings to Google style and add type annotations #3694
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
…en into format-docstr-google
…en into format-docstr-google
I guess it's not a good idea to reformat docstring and add type annotations (for modules I'm not quite familiar with especially) at the same time. I should focus on reformatting docstring for this PR and stop adding type annotations. I tried my best to fix most I pinged a few I'm having trouble with. Could you please give me a hand when you have time? @janosh. Thanks a ton in advance. 😄 |
thanks so much @DanielYang59! this looks like a lot of work! |
pymatgen/analysis/chemenv/coordination_environments/chemenv_strategies.py
Show resolved
Hide resolved
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 a lot @DanielYang59! 👍
@@ -82,7 +82,7 @@ def __init__( | |||
if edges is None: | |||
self.mol_graph = MoleculeGraph.with_local_env_strategy(molecule, OpenBabelNN()) | |||
else: | |||
_edges = {(edge[0], edge[1]): None for edge in edges} | |||
_edges: dict[tuple[int, int], dict | None] = {(edge[0], edge[1]): None for edge in edges} |
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.
This looks like magic to me. Didn't expect declaring the super set of its actual type would solve the problem.
Thanks for reviewing! Glad I can help. |
Ahh. I forgot to mention this but it seems we need to rebuild the |
Reformat docstrings to Google style and add type annotations
There should be no functional changes. Any change made to the code is to resolve
mypy
type errors.Tasks:
Arg/Return/Raise
with its plural formArgs/Returns/Raises
even when there is only oneArg/Return/Raise
. Reference.reStructuredText
format by searching for keywords::param
,:type
,:returns
,:rtype
,::
.Scipy/Numpy/Epytext
styled docstrings.