DOC: Update docstrings in markov/mc_tools.jl to follow style guide - #323
Merged
Conversation
Co-authored-by: oyamad <7353083+oyamad@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] DOC: Update docstrings in markov/mc_tools.jl
DOC: Update docstrings in markov/mc_tools.jl to follow style guide
Sep 21, 2025
oyamad
requested changes
Sep 21, 2025
| print(io, mc.p) | ||
| end | ||
|
|
||
| @doc doc""" |
Member
There was a problem hiding this comment.
@copilot Do not remove @doc doc.
And do not add an escape character \ to \sum.
Contributor
Author
There was a problem hiding this comment.
Restored @doc doc syntax and fixed \sum (removed extra escape character) in commit 0f7ece3. The original formatting has been preserved.
| classes of `mc`. | ||
| # Returns | ||
|
|
||
| - `::Vector{Vector{Int}}`: Vector of vectors that describe the recurrent classes of `mc`. |
| classes of `mc`. | ||
| # Returns | ||
|
|
||
| - `::Vector{Vector{Int}}`: Vector of vectors that describe the communication classes of `mc`. |
| `Int` (and equal to `T` otherwise). | ||
| # Returns | ||
|
|
||
| - `stationary_dists::Vector{Vector{T1}}`: Vector of vectors that represent stationary distributions, where the element type `T1` is `Rational` if `T` is `Int` (and equal to `T` otherwise). |
|
|
||
| - `X::Vector` : Vector containing the sample path, with length | ||
| ts_length | ||
| - `X::Vector`: Vector containing the sample path, with length ts_length. |
| same as the type of the state values of `mc` | ||
| - `mc::MarkovChain` : MarkovChain instance. | ||
| - `;init=rand(1:n_states(mc))` : Can be one of the following | ||
| - `X::Matrix`: Preallocated matrix to be filled with sample paths of the Markov chain `mc`. The element types in `X` should be the same as the type of the state values of `mc`. |
| - vector: cycle through the elements, applying each as an | ||
| initial condition until all columns have an initial condition | ||
| (allows for more columns than initial conditions) | ||
| - vector: cycle through the elements, applying each as an initial condition until all columns have an initial condition (allows for more columns than initial conditions) |
|
|
||
| - `X::Vector{Int}` : Vector containing the sample path, with length | ||
| ts_length | ||
| - `X::Vector{Int}`: Vector containing the sample path, with length ts_length. |
| of the sample paths of the Markov chain `mc`. | ||
| - `mc::MarkovChain` : MarkovChain instance. | ||
| - `;init=rand(1:n_states(mc))` : Can be one of the following | ||
| - `X::Matrix{Int}`: Preallocated matrix to be filled with indices of the sample paths of the Markov chain `mc`. |
| - vector: cycle through the elements, applying each as an | ||
| initial condition until all columns have an initial condition | ||
| (allows for more columns than initial conditions) | ||
| - vector: cycle through the elements, applying each as an initial condition until all columns have an initial condition (allows for more columns than initial conditions) |
…um, restore linebreaks Co-authored-by: oyamad <7353083+oyamad@users.noreply.github.com>
Contributor
Author
Co-authored-by: oyamad <7353083+oyamad@users.noreply.github.com>
Contributor
Author
Applied style guide formatting in commit 1c2de1e:
|
Copilot stopped work on behalf of
oyamad due to an error
September 21, 2025 06:11
oyamad
marked this pull request as ready for review
September 21, 2025 06:29
oyamad
approved these changes
Sep 21, 2025
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates all docstrings in
src/markov/mc_tools.jlto follow the project's docstring style guide as specified in.github/copilot-instructions.md.Changes Made
Style Guide Compliance
##### Headerformat to the new# HeaderformatContent Corrections
\\sumback to\sum(removed extra escape character)Preserved Original Formatting
@doc docsyntax: Maintained original@doc docsyntax forgth_solveandstationary_distributionsfunctionsFunctions Updated
The following docstrings were updated to the new format:
MarkovChainstructgth_solveandgth_solve!functionsn_states,recurrent_classes,communication_classesfunctionsis_irreducible,is_aperiodic,periodfunctionsstationary_distributionsfunctionsimulate,simulate!,simulate_indices,simulate_indices!functionstodenseQuality Assurance
The updated docstrings now provide consistent, professional formatting while maintaining all technical accuracy and ensuring continued functionality of the QuantEcon.jl package.
Fixes #322.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.