From 0c6da3e9f390c8a616418bbf31d6a2d8d9395456 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Thu, 9 Jul 2026 18:05:20 -0400 Subject: [PATCH] Document public API: add docstrings + docs entries `SteadyState` is exported (public API) but had neither a docstring nor a rendered-docs entry; it only appeared inside method signatures on the Main API page. Add a docstring to the `struct SteadyState end` marker type describing its role as the steady-state dispatch tag, and add a standalone `@docs SteadyState` entry to docs/src/mainapi.md so it is rendered. Verified: package loads, `@doc SteadyState` is non-empty, and the docs build (docs/make.jl, Documenter default checkdocs, no warnonly) completes cleanly with the new entry rendered in mainapi.html. Co-Authored-By: Chris Rackauckas --- docs/src/mainapi.md | 3 ++- src/build_rhs_ss.jl | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/src/mainapi.md b/docs/src/mainapi.md index f3bb370..1ea66cf 100644 --- a/docs/src/mainapi.md +++ b/docs/src/mainapi.md @@ -23,9 +23,10 @@ DiffEqBase.ODEProblem(::FSPSystem, u0, tmax, p) ## Steady-State Problems -Computing steady-state distributions can be done using the SteadyStateDiffEq.jl package. At the moment FiniteStateProjection.jl adjusts the rate matrix so that reactions leaving the truncated state space have propensity 0. +Computing steady-state distributions can be done using the SteadyStateDiffEq.jl package. At the moment FiniteStateProjection.jl adjusts the rate matrix so that reactions leaving the truncated state space have propensity 0. Pass a [`SteadyState`](@ref) instance to the conversion methods to request this steady-state formulation. ```@docs +SteadyState Base.convert(::Type{ODEFunction}, ::FSPSystem, ::SteadyState) DiffEqBase.SteadyStateProblem(::FSPSystem, u0, p) ``` diff --git a/src/build_rhs_ss.jl b/src/build_rhs_ss.jl index d6f662d..81fb7ad 100644 --- a/src/build_rhs_ss.jl +++ b/src/build_rhs_ss.jl @@ -1,3 +1,18 @@ +""" + struct SteadyState end + +Marker type used to select the steady-state formulation of the Chemical +Master Equation. Passing a `SteadyState()` instance to the conversion and +matrix-building methods requests the right-hand side in which transitions +out of the truncated state space are dropped (their propensity is set to +zero), as required for solving for the stationary distribution rather than +the time-dependent one. + +It is used as a dispatch tag by +[`Base.convert(::Type{ODEFunction}, ::FSPSystem, ::SteadyState)`](@ref), +[`SparseArrays.SparseMatrixCSC(::FSPSystem, ::NTuple, ps, ::SteadyState)`](@ref) +and [`DiffEqBase.SteadyStateProblem(::FSPSystem, u0, p)`](@ref). +""" struct SteadyState end """