-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Doc style #25
Comments
Documenter.jl is actually using what JuliaLang suggests. To adopt this style, change """
Constructor of an N-player NormalFormGame, consisting of payoffs all 0.
##### Arguments
- `T::Type` : Type of payoff values; defaults to `Float64` if not specified.
- `nums_actions::NTuple{N,Int}` : Numbers of actions of the N players.
"""
function NormalFormGame{N}(T::Type, nums_actions::NTuple{N,Int})
# TODO: can we still get inference to work but avoid the `::NTuple` below?
players::NTuple{N,Player{N,T}} =
ntuple(i -> Player(zeros(tuple(nums_actions[i:end]...,
nums_actions[1:i-1]...))),
N)
return NormalFormGame{N,T}(players, nums_actions)
end to """
NormalFormGame{N}(T::Type, nums_actions::NTuple{N,Int})
Constructor of an N-player NormalFormGame, consisting of payoffs all 0.
# Arguments
* `T::Type`: Type of payoff values; defaults to `Float64` if not specified.
* `nums_actions::NTuple{N,Int}`: Numbers of actions of the N players.
"""
function NormalFormGame{N}(T::Type, nums_actions::NTuple{N,Int})
# TODO: can we still get inference to work but avoid the `::NTuple` below?
players::NTuple{N,Player{N,T}} =
ntuple(i -> Player(zeros(tuple(nums_actions[i:end]...,
nums_actions[1:i-1]...))),
N)
return NormalFormGame{N,T}(players, nums_actions)
end |
That style looks good to me. I would vote that we add a new line between the header Also, I prefer |
+1 for adding a new line between the header |
I agree. We don't need to follow the Julia suggested style strictly, as it won't make difference to the output of Documenter.jl, while make the raw docstrings much nicer. |
This all looks really good. Thanks @shizejin! |
Two modifications to the doc style (discussed with @oyamad and @QBatista):
"""
NormalFormGame{N}(T, nums_actions)
Constructor of an N-player NormalFormGame, consisting of payoffs all 0.
# Arguments
- `T::Type`: Type of payoff values; defaults to `Float64` if not specified.
- `nums_actions::NTuple{N,Int}`: Numbers of actions of the N players.
"""
function NormalFormGame{N}(T::Type, nums_actions::NTuple{N,Int})
# TODO: can we still get inference to work but avoid the `::NTuple` below?
players::NTuple{N,Player{N,T}} =
ntuple(i -> Player(zeros(tuple(nums_actions[i:end]...,
nums_actions[1:i-1]...))),
N)
return NormalFormGame{N,T}(players, nums_actions)
end |
See #1 (comment).
The text was updated successfully, but these errors were encountered: