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

Format UnfoldSim docstrings according to template #121

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jschepers
Copy link
Collaborator

@jschepers jschepers commented Nov 11, 2024

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 and Types 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.

  • bases.jl (@jschepers)
  • component.jl (@jschepers)
  • design.jl
  • headmodel.jl
  • helper.jl
  • noise.jl
  • onset.jl
  • predefinedSimulations.jl
  • simulation.jl
  • types.jl

@jschepers jschepers added the documentation Improvements or additions to documentation label Nov 11, 2024
@jschepers
Copy link
Collaborator Author

jschepers commented Nov 11, 2024

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).
"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants