Skip to content

Conversation

@abhijithch
Copy link
Contributor

Basic inline documentation of the exported functions.

counter{T}(dct::Dict{T,Int}) = Accumulator{T,Int}(copy(dct))

"""
```

Choose a reason for hiding this comment

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

I haven't looked at the rest, but the ` are not needed. OTOH, add 4 spaces before code lines (such as signatures).

Copy link
Contributor

Choose a reason for hiding this comment

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

The convention is four spaces for the signature code block. Other code blocks can use `s.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be useful to point at an example, so here is one I was just digging through:

https://github.com/JuliaLang/julia/blob/master/base/sharedarray.jl#L38-L51

@kmsquire
Copy link
Member

@abhijithch, thanks for doing this! Not sure I'll have the chance to look soon, but hopefully you'll get a review and merge soon. @hayd, can you take a look?

src/deque.jl Outdated
### Args:
* `q`: A deque type datastructure.
Returns the first element of the deque `s`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be "Returns the first element of the deque q."?

@DanielArndt
Copy link
Collaborator

Hopefully some constructive comments there. Thanks for the PR!

@abhijithch
Copy link
Contributor Author

Thanks @DanielArndt for the comments, will update the PR.

@abhijithch
Copy link
Contributor Author

@nalimilan Is there any standard best practices for documentation available anywhere? Its just that I saw the tick in another package and assumed that would be the right way, anyways will change it to four spaces. Thanks.

"""
counter{T}(seq::AbstractArray{T})
### Args:

Choose a reason for hiding this comment

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

As I noted on the StatsBase PR, I think in most cases the argument list isn't useful. Here, seq is mentioned below anyway, and the signature gives the expected type.

@nalimilan
Copy link

@abhijithch Unfortunately, I don't know whether there's a style guide yet as regards the docs. I'm mostly taking example on what's in Julia Base.

@nalimilan
Copy link

I've just made a PR to try defining guidelines: JuliaLang/julia#15136

"""
OrderedDict
'OrderedDict's are simply dictionaries whose entries have a particular order. The order refers to insertion order, which allows deterministic iteration over the dictionary or set.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the intention here was to have ticks () instead of apostrophes (') so that OrderedDict` is rendered as code/monospace

Copy link
Collaborator

Choose a reason for hiding this comment

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

This should probably be broken into lines of 80 92 chars max

@DanielArndt
Copy link
Collaborator

Just a few more comments. This is looking really good!

src/queue.jl Outdated
"""
Queue(ty{T}[, blksize::Integer])
This is a constructor to create an object of a `Queue`.The block size `blksize` by default is `1024`.

Choose a reason for hiding this comment

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

Instead of "The block size blksize by default is 1024.", just write blksize::Integer=1024 in the signature.

src/queue.jl Outdated
"""
dequeue!(s::Queue)
Removes an element from the back of the queue `s`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similarly to how enqueue! was flipped, so is this.

dequeue! should (and does) remove an item from the front of the queue

@rawls238
Copy link
Contributor

rawls238 commented Mar 9, 2016

@nalimilan @DanielArndt @abhijithch should we merge this in?

@kmsquire
Copy link
Member

kmsquire commented Mar 9, 2016

It would be good if the commits were squashed, although that's probably less necessary with documentation commits (unless they break something).

@DanielArndt
Copy link
Collaborator

Sorry, this hadn't fallen off my radar, I've just been super overwhelmed lately. I wanted to give this the solid review it deserves instead of trickling in comments.

I think this can be merged as is. At some point I think it would be worth taking another stab at the compare documentation. It doesn't seem to follow the same tone as the other function docs, but I've been unsuccessful at rewording it so far.

Thanks a lot @abhijithch -- and sorry I slowly trickled in comments. I hope that wasn't too frustrating.

src/queue.jl Outdated
"""
Queue(T[, blksize::Integer=1024])
This is a constructor to create an object of a `Queue`.`T` specifies

Choose a reason for hiding this comment

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

Could simply be "Create a Queue objet containing elements of type T."

@nalimilan
Copy link

Thanks, this looks good to me after the handful of small points I commented on are fixed. Squashing is a good idea too.

@abhijithch
Copy link
Contributor Author

Will update based on @nalimilan 's comments. Thanks a lot for your guidance.

@abhijithch abhijithch closed this Mar 17, 2016
@abhijithch abhijithch deleted the inlinedoc branch March 17, 2016 11:06
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.

7 participants