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

Convert documentation to Google-style strings and give it a full look over #21

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gcassella
Copy link
Contributor

I've used docconvert (https://github.com/cbillingham/docconvert) to autoconvert our docstrings from reStructuredText to Google style docstrings. There are a few other things we should do before merging the PR:

  • Look over all the docstrings and tidy them up. Try and conform to google style: the first line of the docstring should be a single line (you can have additional paragraphs below) and explain briefly what the function returns.
  • Add module level docstrings to the top of files (explaining what kind of functions can be found in that module / should be placed there)
  • Make sure the docstrings all actually match the function signatures

If we want to go full Google, here is our bible: https://google.github.io/styleguide/pyguide.html

@codecov-commenter
Copy link

codecov-commenter commented Jul 30, 2022

Codecov Report

Merging #21 (22d4c00) into main (cb52dcc) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #21   +/-   ##
=======================================
  Coverage   76.28%   76.28%           
=======================================
  Files          15       15           
  Lines        1324     1324           
=======================================
  Hits         1010     1010           
  Misses        314      314           
Impacted Files Coverage Δ
src/koala/chern_number.py 100.00% <ø> (ø)
src/koala/example_graphs.py 64.95% <ø> (ø)
src/koala/flux_finder/flux_finder.py 82.60% <ø> (ø)
src/koala/flux_finder/pathfinding.py 92.98% <ø> (ø)
src/koala/graph_color.py 89.39% <ø> (ø)
src/koala/graph_utils.py 48.27% <ø> (ø)
src/koala/hamiltonian.py 100.00% <ø> (ø)
src/koala/lattice.py 98.44% <ø> (ø)
src/koala/phase_diagrams.py 0.00% <ø> (ø)
src/koala/phase_space.py 95.55% <ø> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb52dcc...22d4c00. Read the comment docs.

@gcassella
Copy link
Contributor Author

I might also take this opportunity to snipe any linting errors and add pylint to our CI pipeline

@gcassella
Copy link
Contributor Author

for future reference, these changes can be summarized by the commands:

pip install docconvert yapf pylint
docconvert --in-place --input rest --output google --threads 4 ./src/koala/
wget https://raw.githubusercontent.com/Imperial-CMTH/koala/documentation_station/pylintrc
yapf -i --style google ./src/koala/
pylint ./src/koala/

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.

2 participants