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 remaining docstrings to numpydoc style #66

Merged
merged 3 commits into from
Apr 9, 2024
Merged

Conversation

K-Meech
Copy link
Contributor

@K-Meech K-Meech commented Apr 8, 2024

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
Some docstrings are still in reST format.

What does this PR do?
Updates all remaining docstrings to numpydoc format.

References

For #19

How has this PR been tested?

All tests pass locally.

Is this a breaking change?

No

Does this PR require an update to the documentation?

No

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@K-Meech K-Meech requested a review from a team April 8, 2024 14:23
Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.15%. Comparing base (416069a) to head (82c0852).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #66      +/-   ##
==========================================
+ Coverage   89.07%   89.15%   +0.07%     
==========================================
  Files          35       35              
  Lines        1355     1355              
==========================================
+ Hits         1207     1208       +1     
+ Misses        148      147       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@willGraham01 willGraham01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problems with the changes, comments are things that I noticed I should've added to the docstrings when writing them in the first place 😅

Returns
-------
pd.DataFrame
Dataframe with Inf replaced with NaN.
"""
df = df.replace(np.inf, np.nan)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we have a whole function that creates a copy, assigns it to the input, then returns the input, but it was here before so I won't question it.

Though it does seem like overkill when

df.replace(np.inf, np.nan, inplace=True)

does literally the same thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does seem like overkill! I guess it is needed elsewhere in BrainGlobe

brainglobe_utils/pandas/misc.py Outdated Show resolved Hide resolved
@K-Meech K-Meech merged commit 17e5ebc into main Apr 9, 2024
12 checks passed
@K-Meech K-Meech deleted the image_docstrings branch April 9, 2024 11:31
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