Skip to content

Commit 1774538

Browse files
Merge pull request #632 from ArnoStrouwen/formatter
reapply formatting
2 parents 158b757 + f6e94bf commit 1774538

File tree

78 files changed

+2108
-1873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2108
-1873
lines changed

.JuliaFormatter.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
style = "sciml"
1+
style = "sciml"
2+
format_markdown = true
3+
format_docstrings = true

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![codecov](https://codecov.io/gh/SciML/SciMLBase.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SciML/SciMLBase.jl)
77
[![Build Status](https://github.com/SciML/SciMLBase.jl/workflows/CI/badge.svg)](https://github.com/SciML/SciMLBase.jl/actions?query=workflow%3ACI)
88

9-
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
9+
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
1010
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)
1111

1212
SciMLBase.jl is the core interface definition of the SciML ecosystem. It is a
@@ -17,11 +17,11 @@ supply the common interface and allow for interexchange of mathematical problems
1717

1818
The breaking changes in v2.0 are:
1919

20-
* `IntegralProblem` has moved to an interface with `IntegralFunction` and `BatchedIntegralFunction` which requires specifying `prototype`s for the values to be modified
21-
instead of `nout` and `batch`. https://github.com/SciML/SciMLBase.jl/pull/497
22-
* `ODEProblem` was made temporarily into a `mutable struct` to allow for EnzymeRules support. Using the mutation throws a warning that this is only experimental and should not be relied on.
23-
https://github.com/SciML/SciMLBase.jl/pull/501
24-
* `BVProblem` now has a new interface for `TwoPointBVProblem` which splits the bc terms for the two sides, forcing a true two-point BVProblem to allow for further specializations and to allow
25-
for wrapping Fortran solvers in the interface. https://github.com/SciML/SciMLBase.jl/pull/477
26-
* `SDEProblem` constructor was changed to remove an anti-pattern which required passing the diffusion function `g` twice, i.e. `SDEProblem(SDEFunction(f,g),g, ...)`.
27-
Now this is simply `SDEProblem(SDEFunction(f,g),...)`. https://github.com/SciML/SciMLBase.jl/pull/489
20+
- `IntegralProblem` has moved to an interface with `IntegralFunction` and `BatchedIntegralFunction` which requires specifying `prototype`s for the values to be modified
21+
instead of `nout` and `batch`. https://github.com/SciML/SciMLBase.jl/pull/497
22+
- `ODEProblem` was made temporarily into a `mutable struct` to allow for EnzymeRules support. Using the mutation throws a warning that this is only experimental and should not be relied on.
23+
https://github.com/SciML/SciMLBase.jl/pull/501
24+
- `BVProblem` now has a new interface for `TwoPointBVProblem` which splits the bc terms for the two sides, forcing a true two-point BVProblem to allow for further specializations and to allow
25+
for wrapping Fortran solvers in the interface. https://github.com/SciML/SciMLBase.jl/pull/477
26+
- `SDEProblem` constructor was changed to remove an anti-pattern which required passing the diffusion function `g` twice, i.e. `SDEProblem(SDEFunction(f,g),g, ...)`.
27+
Now this is simply `SDEProblem(SDEFunction(f,g),...)`. https://github.com/SciML/SciMLBase.jl/pull/489

docs/pages.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ pages = [
1212
"interfaces/Common_Keywords.md",
1313
"interfaces/Differentiation.md",
1414
"interfaces/PDE.md"],
15-
"Fundamentals" => Any["fundamentals/FAQ.md"],
15+
"Fundamentals" => Any["fundamentals/FAQ.md"]
1616
]

docs/src/fundamentals/FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ See [ColPrac: Contributor's Guide on Collaborative Practices for Community Packa
1616

1717
## Are there developer programs to help fund parties interested in helping develop SciML?
1818

19-
Yes! See [the SciML Developer Programs](https://sciml.ai/dev/) webpage.
19+
Yes! See [the SciML Developer Programs](https://sciml.ai/dev/) webpage.

docs/src/index.md

Lines changed: 167 additions & 124 deletions
Large diffs are not rendered by default.

docs/src/interfaces/Algorithms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
`SciMLAlgorithms` are defined as types which have dispatches to the function signature:
66

77
```julia
8-
CommonSolve.solve(prob::AbstractSciMLProblem,alg::AbstractSciMLAlgorithm;kwargs...)
8+
CommonSolve.solve(prob::AbstractSciMLProblem, alg::AbstractSciMLAlgorithm; kwargs...)
99
```
1010

1111
### Algorithm-Specific Arguments

docs/src/interfaces/Array_and_Number.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ the rules which are required on container and number types which are allowable
55
in SciML tools.
66

77
!!! warn
8-
8+
99
In general as of 2023, strict adherence to this interface is an early work-in-progress.
1010
If anything does not conform to the documented interface, please open an issue.
1111

1212
!!! note
13-
13+
1414
There are many types which can work with a specific solver that do satisfy this
1515
interface. Many times as part of prototyping you may want to side-step the
1616
high level interface checks in order to simply test whether a new type is working.
@@ -35,45 +35,45 @@ independent variables (`t` or `tspan`). These two types can be different, and ca
3535
different restrictions depending on the type of solver which is employed. The following
3636
rules for a Number type are held in general:
3737

38-
* Number types can be used in SciML directly or in containers. If a problem defines a value like `u0`
39-
using a Number type, the out-of-place form must be used for the problem definition.
40-
* `x::T + y::T = z::T`
41-
* `x::T * y::T = z::T`
42-
* `oneunit(x::T)::T`
43-
* `one(x::T) * oneunit(x::T) = z::T`
44-
* `t::T2 * x::T + y::T = z::T` for `T2` a time type and `T` the dependent variable type (this includes the
45-
`muladd` equivalent form).
38+
- Number types can be used in SciML directly or in containers. If a problem defines a value like `u0`
39+
using a Number type, the out-of-place form must be used for the problem definition.
40+
- `x::T + y::T = z::T`
41+
- `x::T * y::T = z::T`
42+
- `oneunit(x::T)::T`
43+
- `one(x::T) * oneunit(x::T) = z::T`
44+
- `t::T2 * x::T + y::T = z::T` for `T2` a time type and `T` the dependent variable type (this includes the
45+
`muladd` equivalent form).
4646

4747
Additionally, the following rules apply to subsets of uses:
4848

4949
### Adaptive Number Types
5050

51-
* `x::T / y::T = z::T`
52-
* Default choices of norms can assume `sqrt(x::T)::T` exists. If `internalnorm` is overridden then this
53-
may not be required (for example, changing the norm to inf-norm).
54-
* `x::T ^ y::T = z::T`
51+
- `x::T / y::T = z::T`
52+
- Default choices of norms can assume `sqrt(x::T)::T` exists. If `internalnorm` is overridden then this
53+
may not be required (for example, changing the norm to inf-norm).
54+
- `x::T ^ y::T = z::T`
5555

5656
### Time Types (Independent Variables)
5757

58-
* If a solver is time adaptive, the time type must be a floating point number. `Rational` is only allowed
59-
for non-adaptive solves.
58+
- If a solver is time adaptive, the time type must be a floating point number. `Rational` is only allowed
59+
for non-adaptive solves.
6060

6161
## SciML Container (Array) Types
6262

63-
Container types are types which hold number types. They can be used to define objects like the state vector
63+
Container types are types which hold number types. They can be used to define objects like the state vector
6464
(`u0`) of a problem. The following operations are required in a container type to be used with SciML
6565
solvers:
6666

67-
* Broadcast is defined [according to the Julia broadcast interface](https://docs.julialang.org/en/v1/manual/interfaces/#man-interfaces-broadcasting).
68-
* The container type correctly defines [interface overloads to satisfy the ArrayInterface.jl specification](https://docs.sciml.ai/ArrayInterface/stable/).
69-
* `ArrayInterface.zeromatrix(x::T)::T2` defines a compatible matrix type (see below)
70-
* `eltype(x::T)::T2` is a compatible Number type.
71-
* `x::T .+ y::T = z::T` (i.e. broadcast similar is defined to be type-presurving)
72-
* Indexing is only required if `ArrayInterface.fast_scalar_indexing(x::T)==true`. If true,
73-
scalar indexing `x[i]` is assumed to be defined and run through all variables.
67+
- Broadcast is defined [according to the Julia broadcast interface](https://docs.julialang.org/en/v1/manual/interfaces/#man-interfaces-broadcasting).
68+
- The container type correctly defines [interface overloads to satisfy the ArrayInterface.jl specification](https://docs.sciml.ai/ArrayInterface/stable/).
69+
- `ArrayInterface.zeromatrix(x::T)::T2` defines a compatible matrix type (see below)
70+
- `eltype(x::T)::T2` is a compatible Number type.
71+
- `x::T .+ y::T = z::T` (i.e. broadcast similar is defined to be type-presurving)
72+
- Indexing is only required if `ArrayInterface.fast_scalar_indexing(x::T)==true`. If true,
73+
scalar indexing `x[i]` is assumed to be defined and run through all variables.
7474

7575
!!! note
76-
76+
7777
"`eltype(x::T)::T2` is a compatible Number type" excludes `Array{Array{T}}` types of types. However, recursive
7878
vectors can conformed to the interface with zero overhead using tools from RecursiveArrayTools.jl such as
7979
`VectorOfArray(x)`. Since this greatly simplifies the interfaces and the ability to check for correctness,
@@ -83,21 +83,21 @@ Additionally, the following rules apply to subsets of uses:
8383

8484
### SciML Mutable Array Types
8585

86-
* `similar(x::T)::T`
87-
* `zero(x::T)::T`
88-
* `z::T .= x::T .+ y::T` is defined
89-
* `z::T .= x::T .* y::T` is defined
90-
* `z::T .= t::T2 .* x::T` where `T2` is the time type (a Number) and `T` is the container type.
91-
* (Optional) `Base.resize!(x,i)` is required for `resize!(integrator,i)` to be supported.
86+
- `similar(x::T)::T`
87+
- `zero(x::T)::T`
88+
- `z::T .= x::T .+ y::T` is defined
89+
- `z::T .= x::T .* y::T` is defined
90+
- `z::T .= t::T2 .* x::T` where `T2` is the time type (a Number) and `T` is the container type.
91+
- (Optional) `Base.resize!(x,i)` is required for `resize!(integrator,i)` to be supported.
9292

9393
### SciML Matrix (Operator) Type
9494

9595
Note that the matrix type may not match the type of the initial container `u0`. An example is `ComponentMatrix`
9696
as the matrix structure corresponding to a `ComponentArray`. However, the following actions are assumed
9797
to hold on the resulting matrix type:
9898

99-
* `solve(LinearProblem(A::T,b::T2),linsolve)` must be defined for a solver to work on a given SciML matrix
100-
type `T2`.
101-
* If the matrix is an operator, i.e. a lazy construct, it should conform to the
102-
[SciMLOperators](https://docs.sciml.ai/SciMLOperators/stable/) interface.
103-
* If not a SciMLOperator, `diagind(W::T)` should be defined and `@view(A[idxs])=@view(A[idxs]) + λ::T`
99+
- `solve(LinearProblem(A::T,b::T2),linsolve)` must be defined for a solver to work on a given SciML matrix
100+
type `T2`.
101+
- If the matrix is an operator, i.e. a lazy construct, it should conform to the
102+
[SciMLOperators](https://docs.sciml.ai/SciMLOperators/stable/) interface.
103+
- If not a SciMLOperator, `diagind(W::T)` should be defined and `@view(A[idxs])=@view(A[idxs]) + λ::T`

0 commit comments

Comments
 (0)