-
Notifications
You must be signed in to change notification settings - Fork 4
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
Format UnfoldSim docstrings according to template #121
base: main
Are you sure you want to change the base?
Conversation
Current templates: Function docstring template"""
my_function(argument1:Type1; keyword_argument3::Type3 = value3)
my_function(argument1::Type1, optional_argument2::Type2; keyword_argument3::Type3 = value3)
One-line description using the imperative form ("Do this") instead of the third person and ending with a period.
If the one-line description is not sufficient, one can also write a short paragraph with additional information.
# Arguments (if needed)
- `argument1::Type1`: Description of argument1.
- `optional_argument2::Type2` (optional): Description of optional_argument2.
# Keyword arguments (if needed)
- `keyword_argument3::Type3 = value3`: Description of keyword_argument3.
# Returns
- `result::Type4` : Description of result.
# Examples
```julia-repl
julia> my_function(value1, value2)
result1
julia> my_function(value1; keyword_argument3 = value4)
result2
```
See also [`my_function2`](@ref), [`my_function3`](@ref).
""" Type docstring template"""
MyType <: MyAbstractType
One-line desciption of my type which ends with a period.
If the one-line description is not sufficient, one can also write a short paragraph with additional information.
# Fields
- `field1::Type1`: Description of field1.
- `optional_field2::Type2` (optional): Description of field2. If not provided, defaults to `value2`.
# Examples
```julia-repl
julia> MyType(field1, field2)
result1
```
See also [`MyType2`](@ref), [`my_function2`](@ref).
""" |
- `signal` : Generated signal. Depending on the design, on the components and on | ||
`return_epoched`, the output can be a 1-D, 2-D, 3-D or 4-D Array. | ||
For example, a 4-D Array would have the dimensions `channels x time x trials x subjects`. | ||
- `events`: Generated events. |
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.
- `events`: Generated events. | |
- `events`: Generated events dataframe with latencies. |
# Examples | ||
Adapted from the quickstart tutorial in the UnfoldSim docs. | ||
```julia-repl | ||
julia> using UnfoldSim |
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.
For the examples, you can omit the using UnfoldSim
since the examples are for UnfoldSim functions.
- `events`: Generated events. | ||
|
||
# Examples | ||
Adapted from the quickstart tutorial in the UnfoldSim docs. |
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.
Here you could put a link to the quickstart tutorial.
…nctions in the file.
…im.jl into improve-docstrings
As pointed out by @cbrnr (#106), some of the docstrings are still incomplete and do not follow a common docstring convention. @cbrnr thanks a lot for pointing this out and for your suggestions on how to make the docstrings more consistent.
The goal is to transform the docstrings such that they match the docstring template, that I came up with based on the Julia manual, the Blue style guide and by checking the docstrings of other Julia packages.
I will post the current templates for
Functions
andTypes
below. However, please note that they are still subject to change when we find something that does not match the template.@maanikmarathe, here is a list of all UnfoldSim.jl
src
files with docstrings. Once we are done with them, we can check the boxes. Also, feel free to post about docstrings for which you are unsure how to format them or where information is missing, either in this issue (#108) or by writing to me on Zulip. As discussed, I started from the top of the list and would like you to start from the bottom.