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

Add docstrings for names, size, and order #1814

Closed
wants to merge 7 commits into from

Conversation

ajwheeler
Copy link

closes #1265 unless I'm mistaken

Copy link
Member

@bkamins bkamins left a comment

Choose a reason for hiding this comment

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

Thank you for looking into it. I will give general comments as they apply to all docstrings to improve their consistency (I know not all docstrings strictly follow these recommendations, but for the future we should try to be consistent):

  • please use docstring formatting recommended in Base, i.e. first line should start with the signature, separate example with ### Examples header
  • please make sure that you document all relevant types, DataFrameRow in particular
  • an appropriate entry to docs/src/lib/functions.md should be added for each documented function

@@ -20,6 +20,14 @@ struct UserColOrdering{T<:ColumnIndex}
end

# This is exported, and lets a user define orderings for a particular column
"""
User defined order for a particular column. Used in conjuction with sort!(df::DataFrame, cols).
Copy link
Member

Choose a reason for hiding this comment

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

Please quote code in the text. Also it would be better if example were runnable. Finally if a function accepts some arguments they should be documented.

Copy link
Author

Choose a reason for hiding this comment

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

You are referring to the kwargs of order, correct? Are there any besides rev? I was a bit confused by the source.

Copy link
Author

Choose a reason for hiding this comment

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

Any by "runnable", do you mean that it should avoid undefined variables?

Copy link
Member

Choose a reason for hiding this comment

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

In the body of ordering(col_ord::UserColOrdering, lt::Function, by::Function, rev::Bool, order::Ordering) you have a list of accepted kwargs.

By "runnable" I mean that when we enable docstring testing during CI (which we plan in the future) the code should run without error (as otherwise CI will fail). In this case it means that the use of undefined variable. The additional benefit of ensuring "runnability" is that the user can copy-paste the code and test what it does.

@ajwheeler
Copy link
Author

Thanks for the notes. I'm not sure what you're referring to RE DataFrameRow. Could you spell that out for me? I don't see the connection to any of these methods.

@bkamins
Copy link
Member

bkamins commented May 21, 2019

DataFrameRow is a type defined by DataFrames.jl and it is exported. It supports size and names functions so it would be good to add appropriate docstrings in src/dataframerow/dataframerow.jl. Thank you!

Copy link
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

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

Thanks!

We should really clean our docstrings to follow the recommendations at https://docs.julialang.org/en/latest/manual/documentation/. For now I'd say it's OK to be consistent with our current style.

@bkamins
Copy link
Member

bkamins commented Jun 8, 2019

@ajwheeler - after this is merged I can do what @nalimilan proposes above, but maybe you would be interested in doing this?

@ajwheeler
Copy link
Author

ajwheeler commented Jun 17, 2019 via email

@bkamins
Copy link
Member

bkamins commented Sep 2, 2019

@nalimilan - you are better with docstrings than me 😄 . How do you advise to proceed with this?

@bkamins bkamins mentioned this pull request Jan 3, 2020
@bkamins
Copy link
Member

bkamins commented Jan 3, 2020

I have opened #2077 instead of this PR.

@bkamins bkamins closed this Jan 3, 2020
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.

Functions that need docstrings
3 participants