Skip to content

Commit

Permalink
Merge pull request #268 from ArnoStrouwen/canon
Browse files Browse the repository at this point in the history
canonify docs
  • Loading branch information
ChrisRackauckas committed Oct 16, 2022
2 parents 23aa6ac + 49d5015 commit 3425b16
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 53 deletions.
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# JumpProcesses.jl

[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged)
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](http://jump.sciml.ai/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](http://jump.sciml.ai/dev/)
[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/dev/modules/JumpProcesses/)
[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/JumpProcesses/stable/)

[![Coverage Status](https://coveralls.io/repos/github/SciML/JumpProcesses.jl/badge.svg?branch=master)](https://coveralls.io/github/SciML/JumpProcesses.jl?branch=master)
[![codecov](https://codecov.io/gh/SciML/JumpProcesses.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SciML/JumpProcesses.jl)
Expand All @@ -25,18 +23,18 @@ and one of the core solver libraries included in
[DifferentialEquations.jl](https://github.com/JuliaDiffEq/DifferentialEquations.jl).

For information on using the package,
[see the stable documentation](http://jump.sciml.ai/stable/). Use the
[in-development documentation](http://jump.sciml.ai/dev/) for the version of
[see the stable documentation](https://docs.sciml.ai/JumpProcesses/stable/). Use the
[in-development documentation](https://docs.sciml.ai/JumpProcesses/dev/) for the version of
the documentation, which contains the unreleased features.

The documentation includes
- [a tutorial on simulating basic Poisson processes](https://jump.sciml.ai/stable/tutorials/simple_poisson_process/)
- [a tutorial and details on using JumpProcesses to simulate jump processes via SSAs (i.e. Gillespie methods)](https://jump.sciml.ai/stable/tutorials/discrete_stochastic_example/),
- [a tutorial on simulating jump-diffusion processes](https://jump.sciml.ai/stable/tutorials/jump_diffusion/),
- [a reference on the types of jumps and available simulation methods](https://jump.sciml.ai/stable/jump_types/),
- [a reference on jump time stepping methods](https://jump.sciml.ai/stable/jump_solve/),
- [a FAQ](https://jump.sciml.ai/stable/faq) with information on changing parameters between simulations and using callbacks,
- [the JumpProcesses.jl API documentation](https://jump.sciml.ai/stable/api/).
- [a tutorial on simulating basic Poisson processes](https://docs.sciml.ai/JumpProcesses/stable/tutorials/simple_poisson_process/)
- [a tutorial and details on using JumpProcesses to simulate jump processes via SSAs (i.e. Gillespie methods)](https://docs.sciml.ai/JumpProcesses/stable/tutorials/discrete_stochastic_example/),
- [a tutorial on simulating jump-diffusion processes](https://docs.sciml.ai/JumpProcesses/stable/tutorials/jump_diffusion/),
- [a reference on the types of jumps and available simulation methods](https://docs.sciml.ai/JumpProcesses/stable/jump_types/),
- [a reference on jump time stepping methods](https://docs.sciml.ai/JumpProcesses/stable/jump_solve/),
- [a FAQ](https://docs.sciml.ai/JumpProcesses/stable/faq) with information on changing parameters between simulations and using callbacks,
- [the JumpProcesses.jl API documentation](https://docs.sciml.ai/JumpProcesses/stable/api/).

## Installation
There are two ways to install `JumpProcesses.jl`. First, users may install the meta
Expand All @@ -48,7 +46,7 @@ the facilities for developing and solving Jump problems.

To install the `DifferentialEquations.jl` package, refer to the following link
for complete [installation
details](https://docs.sciml.ai/dev/modules/DiffEqDocs/).
details](https://docs.sciml.ai/DiffEqDocs/stable/).

If the user wishes to separately install the `JumpProcesses.jl` library, which is a
lighter dependency than `DifferentialEquations.jl`, then the following code will
Expand Down
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ makedocs(sitename = "JumpProcesses.jl",
doctest = false,
format = Documenter.HTML(; analytics = "UA-90474609-3",
assets = ["assets/favicon.ico"],
canonical = "https://jump.sciml.ai/stable/",
canonical = "https://docs.sciml.ai/JumpProcesses/",
prettyurls = (get(ENV, "CI", nothing) == "true"),
mathengine),
pages = pages)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ of `u[1]`, giving

## How can I access earlier solution values in callbacks?
When using an ODE or SDE time-stepper that conforms to the [integrator
interface](https://docs.sciml.ai/dev/modules/DiffEqDocs/basics/integrator/) one
interface](https://docs.sciml.ai/DiffEqDocs/stable/basics/integrator/) one
can simply use `integrator.uprev`. For efficiency reasons, the pure jump
[`SSAStepper`](@ref) integrator does not have such a field. If one needs
solution components at earlier times one can save them within the callback
Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jump-ODE and jump-SDE models, including jump diffusions.

JumpProcesses is a component package in the [SciML](https://sciml.ai/) ecosystem,
and one of the core solver libraries included in
[DifferentialEquations.jl](https://github.com/JuliaDiffEq/DifferentialEquations.jl).
[DifferentialEquations.jl](https://docs.sciml.ai/DiffEqDocs/stable/).

The documentation includes
- [a tutorial on simulating basic Poisson processes](@ref poisson_proc_tutorial)
Expand All @@ -28,7 +28,7 @@ the facilities for developing and solving Jump problems.

To install the `DifferentialEquations.jl` package, refer to the following link
for complete [installation
details](https://docs.sciml.ai/dev/modules/DiffEqDocs/).
details](https://docs.sciml.ai/DiffEqDocs/stable).

If the user wishes to separately install the `JumpProcesses.jl` library, which is a
lighter dependency than `DifferentialEquations.jl`, then the following code will
Expand Down
8 changes: 4 additions & 4 deletions docs/src/jump_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ MassActionJump(reactant_stoich, net_stoich; scale_rates = true, param_idxs=nothi
```
is preferred over
```julia
reactant_stoich = [[3 => 1, 1 => 2, 4 = > 2], [3 => 2, 2 => 2]]
reactant_stoich = [[3 => 1, 1 => 2, 4 => 2], [3 => 2, 2 => 2]]
```


Expand Down Expand Up @@ -236,7 +236,7 @@ jump-jump dependency graph, passed through the named parameter `dep_graph`. i.e.
JumpProblem(prob,DirectCR(),jump1,jump2; dep_graph=your_dependency_graph)
```
For systems with only `MassActionJump`s, or those generated from a
[Catalyst](https://github.com/SciML/Catalyst.jl) `reaction_network`, this graph
[Catalyst](https://docs.sciml.ai/Catalyst/stable/) `reaction_network`, this graph
will be auto-generated. Otherwise you must construct the dependency graph
manually. Dependency graphs are represented as a `Vector{Vector{Int}}`, with the
`i`th vector containing the indices of the jumps for which rates must be
Expand All @@ -253,7 +253,7 @@ through the following `JumpProblem` kwargs:
of variable indices. The corresponding variables are those that have their
value, `u[i]`, altered when the jump occurs.

For systems generated from a [Catalyst](https://github.com/SciML/Catalyst.jl)
For systems generated from a [Catalyst](https://docs.sciml.ai/Catalyst/stable/)
`reaction_network` these will be auto-generated. Otherwise you must explicitly
construct and pass in these mappings.

Expand All @@ -274,7 +274,7 @@ For representing and aggregating constant rate jumps
In general, for systems with sparse dependency graphs if `Direct` is slow, one
of `SortingDirect`, `RSSA` or `RSSACR` will usually offer substantially better
performance. See
[DiffEqBenchmarks.jl](https://github.com/JuliaDiffEq/DiffEqBenchmarks.jl) for
[DiffEqBenchmarks.jl](https://docs.sciml.ai/SciMLBenchmarksOutput/stable/) for
benchmarks on several example networks.

## Remaking `JumpProblem`s
Expand Down
26 changes: 13 additions & 13 deletions docs/src/tutorials/discrete_stochastic_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ tutorial](@ref poisson_proc_tutorial). We will illustrate

!!! note

This tutorial assumes you have read the [Ordinary Differential Equations tutorial](https://docs.sciml.ai/dev/modules/DiffEqDocs/tutorials/ode_example/) in [`DifferentialEquations.jl`](https://docs.sciml.ai/dev/modules/DiffEqDocs/).
This tutorial assumes you have read the [Ordinary Differential Equations tutorial](https://docs.sciml.ai/DiffEqDocs/stable/tutorials/ode_example/) in [`DifferentialEquations.jl`](https://docs.sciml.ai/DiffEqDocs/stable).

We begin by demonstrating how to build jump processes using
[JumpProcesses.jl](https://github.com/SciML/JumpProcesses.jl)'s different jump types,
[JumpProcesses.jl](https://docs.sciml.ai/JumpProcesses/stable/)'s different jump types,
which encode the rate functions (i.e. transition rates, intensities, or
propensities) and state changes when a given jump occurs.

Note, the SIR model considered here is a type of stochastic chemical kinetics
jump process model, and as such the biological modeling functionality of
[Catalyst.jl](https://github.com/SciML/Catalyst.jl) can be used to easily
[Catalyst.jl](https://docs.sciml.ai/Catalyst/stable/) can be used to easily
specify the model and automatically calculate inputs needed for JumpProcesses's
optimized simulation algorithms. We summarize this alternative approach at the
beginning for users who may be interested in modeling chemical systems, but note
Expand All @@ -40,7 +40,7 @@ reaction, and necessary data structures for the simulation algorithms, such as
dependency graphs, are automatically calculated.

We'll make use of the
[DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl)
[DifferentialEquations.jl](https://docs.sciml.ai/DiffEqDocs/stable/)
meta package, which includes JumpProcesses and ODE/SDE solvers, Plots.jl, and
(optionally) Catalyst.jl in this tutorial. If not already installed they can be
added as follows
Expand Down Expand Up @@ -97,9 +97,9 @@ created, and the probability per time some infected individual recovers.
For those less-familiar with the time-change representation, we next give a more
intuitive explanation of the model as a collection of chemical reactions, and
then demonstrate how these reactions can be written in
[Catalyst.jl](https://github.com/SciML/Catalyst.jl) and seamlessly converted
[Catalyst.jl](https://docs.sciml.ai/Catalyst/stable/) and seamlessly converted
into a form that can be used with the
[JumpProcesses.jl](https://github.com/SciML/JumpProcesses.jl) solvers. Users
[JumpProcesses.jl](https://docs.sciml.ai/JumpProcesses/stable/) solvers. Users
interested in how to directly define jumps using the lower-level JumpProcesses
interface can skip to [Building and Simulating the Jump Process Using the
JumpProcesses Low-Level Interface](@ref).
Expand Down Expand Up @@ -164,7 +164,7 @@ frequently jumps should occur, and an `affect!` function for how the state
should change when that jump type occurs.
## Building and Simulating the Jump Processes from Catalyst Models
Using [Catalyst.jl](https://github.com/SciML/Catalyst.jl) we can input our full
Using [Catalyst.jl](https://docs.sciml.ai/Catalyst/stable/) we can input our full
reaction network in a form that can be easily used with JumpProcesses's solvers
```@example tut2
using Catalyst
Expand All @@ -175,7 +175,7 @@ end β ν
```
To build a pure jump process model of the reaction system, where the state is
constant between jumps, we will use a
[`DiscreteProblem`](https://docs.sciml.ai/dev/modules/DiffEqDocs/types/discrete_types/).
[`DiscreteProblem`](https://docs.sciml.ai/DiffEqDocs/stable/types/discrete_types/).
This encodes that the state only changes at the jump times. We do this by giving
the constructor `u₀`, the initial condition, and `tspan`, the timespan. Here, we
will start with `999` susceptible people, `1` infected person, and `0` recovered
Expand Down Expand Up @@ -270,7 +270,7 @@ jump = ConstantRateJump(rate, affect!)
where `rate` is a function `rate(u,p,t)` and `affect!` is a function of the
integrator `affect!(integrator)` (for details on the integrator, see the
[integrator interface
docs](https://docs.sciml.ai/dev/modules/DiffEqDocs/basics/integrator/)). Here
docs](https://docs.sciml.ai/DiffEqDocs/stable/basics/integrator/)). Here
`u` corresponds to the current state vector of the system; for our SIR model
`u[1] = S(t)`, `u[2] = I(t)` and `u[3] = R(t)`. `p` corresponds to the parameters of
the model, just as used for passing parameters to derivative functions in ODE
Expand Down Expand Up @@ -309,7 +309,7 @@ people in the different states.*
Since we want the system state to change only at the discrete jump times, we
will build a
[`DiscreteProblem`](https://docs.sciml.ai/dev/modules/DiffEqDocs/types/discrete_types/)
[`DiscreteProblem`](https://docs.sciml.ai/DiffEqDocs/stable/types/discrete_types/)
```@example tut2
prob = DiscreteProblem(u₀, tspan, p)
```
Expand Down Expand Up @@ -390,22 +390,22 @@ problems involving only `ConstantRateJump`s and `MassActionJump`s.
## [Reducing Memory Use: Controlling Saving Behavior](@id save_positions_docs)
Note that jumps act via DifferentialEquations.jl's [callback
interface](https://docs.sciml.ai/dev/modules/DiffEqDocs/features/callback_functions/),
interface](https://docs.sciml.ai/DiffEqDocs/stable/features/callback_functions/),
which defaults to saving at each event. This is required in order to accurately
resolve every discontinuity exactly (and this is what allows for perfectly
vertical lines in plots!). However, in many cases when using jump problems you
may wish to decrease the saving pressure given by large numbers of jumps. To do
this, you set the `save_positions` keyword argument to `JumpProblem`. Just like
for other
[callbacks](https://docs.sciml.ai/dev/modules/DiffEqDocs/features/callback_functions/),
[callbacks](https://docs.sciml.ai/DiffEqDocs/stable/features/callback_functions/),
this is a tuple `(bool1, bool2)` which sets whether to save before or after a
jump. If we do not want to save at every jump, we would thus pass:
```@example tut2
jump_prob = JumpProblem(prob, Direct(), jump, jump2; save_positions = (false, false))
```
Now the saving controls associated with the integrator should specified, see the
main [SciML
Docs](https://docs.sciml.ai/dev/modules/DiffEqDocs/basics/common_solver_opts/)
Docs](https://docs.sciml.ai/DiffEqDocs/stable/basics/common_solver_opts/)
for saving options. For example, we can use `saveat = 10.0` to save at an evenly
spaced grid:
```@example tut2
Expand Down
6 changes: 3 additions & 3 deletions docs/src/tutorials/jump_diffusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

!!! note

This tutorial assumes you have read the [Ordinary Differential Equations tutorial](https://docs.sciml.ai/dev/modules/DiffEqDocs/tutorials/ode_example/) in [`DifferentialEquations.jl`](https://docs.sciml.ai/dev/modules/DiffEqDocs/).
This tutorial assumes you have read the [Ordinary Differential Equations tutorial](https://docs.sciml.ai/DiffEqDocs/stable/tutorials/ode_example/) in [`DifferentialEquations.jl`](https://docs.sciml.ai/DiffEqDocs/stable).

Jump Diffusion equations are stochastic differential equations with discontinuous
jumps. These can be written as:
Expand Down Expand Up @@ -67,9 +67,9 @@ value 2, we do:
rate(u, p, t) = 2
```
Now we define the `affect!` of the jump. This is the same as an `affect!` from a
[`DiscreteCallback`](https://docs.sciml.ai/dev/modules/DiffEqDocs/features/callback_functions/),
[`DiscreteCallback`](https://docs.sciml.ai/DiffEqDocs/stable/features/callback_functions/),
and thus acts directly on the
[integrator](https://docs.sciml.ai/dev/modules/DiffEqDocs/basics/integrator/).
[integrator](https://docs.sciml.ai/DiffEqDocs/stable/basics/integrator/).
Therefore, to make it halve the current value of `u`, we do:
```@example tut3
function affect!(integrator)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/tutorials/simple_poisson_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ parameters, and current time. Throughout this tutorial these are denoted by `u`,
`p` and `t`. Likewise, when a jump occurs any
DifferentialEquations.jl-compatible change to the current system state, as
encoded by a [DifferentialEquations.jl
integrator](https://docs.sciml.ai/dev/modules/DiffEqDocs/basics/integrator/), is
integrator](https://docs.sciml.ai/DiffEqDocs/stable/basics/integrator/), is
allowed. This includes changes to the current state or to parameter values.

This tutorial requires several packages, which can be added if not already
Expand Down Expand Up @@ -80,7 +80,7 @@ occurred (at time `integrator.t`)
affect!(integrator) = (integrator.u[1] += 1)
```
Here the convention is to take a [DifferentialEquations.jl
integrator](https://docs.sciml.ai/dev/modules/DiffEqDocs/basics/integrator/),
integrator](https://docs.sciml.ai/DiffEqDocs/stable/basics/integrator/),
and directly modify the current solution value it stores. i.e. `integrator.u` is
the current solution vector, with `integrator.u[1]` the first component of this
vector. In our case we will only have one unknown, so this will be the current
Expand Down
2 changes: 1 addition & 1 deletion src/SSA_stepper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jump_prob = JumpProblem(prob, Direct(), jump, jump2)
sol = solve(jump_prob, SSAStepper())
```
see the
[tutorial](https://jump.sciml.ai/stable/tutorials/discrete_stochastic_example/)
[tutorial](https://docs.sciml.ai/JumpProcesses/stable/tutorials/discrete_stochastic_example/)
for details.
"""
struct SSAStepper <: DiffEqBase.DEAlgorithm end
Expand Down
2 changes: 1 addition & 1 deletion src/extended_jump_array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $(TYPEDEF)
Extended state definition used within integrators when there are
`VariableRateJump`s in a system. For detailed examples and usage information see
the
- [Tutorial](https://jump.sciml.ai/stable/tutorials/discrete_stochastic_example/)
- [Tutorial](https://docs.sciml.ai/JumpProcesses/stable/tutorials/discrete_stochastic_example/)
### Fields
Expand Down
12 changes: 6 additions & 6 deletions src/jumps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Defines a jump process with a rate (i.e. hazard, intensity, or propensity) that
does not *explicitly* depend on time. More precisely, one where the rate
function is constant *between* the occurrence of jumps. For detailed examples
and usage information see the
- [Tutorial](https://jump.sciml.ai/stable/tutorials/discrete_stochastic_example/)
- [Tutorial](https://docs.sciml.ai/JumpProcesses/stable/tutorials/discrete_stochastic_example/)
## Fields
Expand Down Expand Up @@ -37,7 +37,7 @@ Defines a jump process with a rate (i.e. hazard, intensity, or propensity) that
may explicitly depend on time. More precisely, one where the rate function is
allowed to change *between* the occurrence of jumps. For detailed examples and
usage information see the
- [Tutorial](https://jump.sciml.ai/stable/tutorials/discrete_stochastic_example/)
- [Tutorial](https://docs.sciml.ai/JumpProcesses/stable/tutorials/discrete_stochastic_example/)
## Fields
Expand Down Expand Up @@ -124,8 +124,8 @@ Optimized representation for `ConstantRateJump`s that can be represented in mass
action form, offering improved performance within jump algorithms compared to
`ConstantRateJump`. For detailed examples and usage information see the
- [Main
Docs](https://jump.sciml.ai/stable/jump_types/#Defining-a-Mass-Action-Jump)
- [Tutorial](https://jump.sciml.ai/stable/tutorials/discrete_stochastic_example/)
Docs](https://docs.sciml.ai/JumpProcesses/stable/jump_types/#Defining-a-Mass-Action-Jump)
- [Tutorial](https://docs.sciml.ai/JumpProcesses/stable/tutorials/discrete_stochastic_example/)
### Constructors
- `MassActionJump(reactant_stoich, net_stoich; scale_rates=true,
Expand Down Expand Up @@ -175,10 +175,10 @@ jprob = JumpProblem(prob, Direct(), maj)
## Notes
- By default reaction rates are rescaled when constructing the `MassActionJump`
as explained in the [main
docs](https://jump.sciml.ai/stable/jump_types/#Defining-a-Mass-Action-Jump).
docs](https://docs.sciml.ai/JumpProcesses/stable/jump_types/#Defining-a-Mass-Action-Jump).
Disable this with the kwarg `scale_rates=false`.
- Also see the [main
docs](https://jump.sciml.ai/stable/jump_types/#Defining-a-Mass-Action-Jump)
docs](https://docs.sciml.ai/JumpProcesses/stable/jump_types/#Defining-a-Mass-Action-Jump)
for how to specify reactions with no products or no reactants.
Expand Down
Loading

0 comments on commit 3425b16

Please sign in to comment.