-
Notifications
You must be signed in to change notification settings - Fork 34
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 exported functions and types #59
Conversation
Is this project still active? |
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.
Sorry no one gave you a review here. I'm quite peripheral to this package but it's very occasionally useful to me.
src/NIfTI.jl
Outdated
""" | ||
NIVolume{T<:Number,N,R} <: AbstractArray{T,N} | ||
An `N`-dimensional NIfTI volume, with raw data of type | ||
`R`. Note that if `raw <: Number`, it will be converted to `Float32`. Additionally, the header is automatically |
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.
`R`. Note that if `raw <: Number`, it will be converted to `Float32`. Additionally, the header is automatically | |
`R`. Note that if `R <: Number`, it will be converted to `Float32`. Additionally, the header is automatically |
Also there is no antecedant for "it"---presumably you're referring to T
but that hasn't been described. It's also confusing: if the user creates the type with a specific T
that T
must be used exactly as specified. I think you're conflating the type documentation with the constructor, which in the absence of a manually-specified T
does indeed use promotion to compute a type compatible with floating-point arithmetic.
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.
You're right, I was referring to the behavior of the constructor on line 131. Is it preferable to document constructor behavior in a separate docstring?
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.
I think it would be great to document the constructor too. But you can bundle it with the type into a single docstring, just cleanly specify whether you're talking about the type or the constructor.
Sometimes I just document the constructor and leave the type as an undocumented internal detail.
Co-authored-by: Tim Holy <[email protected]>
@timholy Thanks for the review! Julia is such a great language for neuroimaging work, and I'd love to help grow the ecosystem. |
How often are people actively mutating fields in the header? I'd prefer that users not muck around with the header unless they really know what is going on and I'd like to just remove this type and attach an immutable header to |
Added docstrings for the exported functions and types. This should make the package a bit more friendly to use, since currently the only way to access much of the documentation is by looking at the source comments.