Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reapply formatting #632

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
style = "sciml"
style = "sciml"
format_markdown = true
format_docstrings = true
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![codecov](https://codecov.io/gh/SciML/SciMLBase.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SciML/SciMLBase.jl)
[![Build Status](https://github.com/SciML/SciMLBase.jl/workflows/CI/badge.svg)](https://github.com/SciML/SciMLBase.jl/actions?query=workflow%3ACI)

[![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)
[![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)
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)

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

The breaking changes in v2.0 are:

* `IntegralProblem` has moved to an interface with `IntegralFunction` and `BatchedIntegralFunction` which requires specifying `prototype`s for the values to be modified
instead of `nout` and `batch`. https://github.com/SciML/SciMLBase.jl/pull/497
* `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.
https://github.com/SciML/SciMLBase.jl/pull/501
* `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
for wrapping Fortran solvers in the interface. https://github.com/SciML/SciMLBase.jl/pull/477
* `SDEProblem` constructor was changed to remove an anti-pattern which required passing the diffusion function `g` twice, i.e. `SDEProblem(SDEFunction(f,g),g, ...)`.
Now this is simply `SDEProblem(SDEFunction(f,g),...)`. https://github.com/SciML/SciMLBase.jl/pull/489
- `IntegralProblem` has moved to an interface with `IntegralFunction` and `BatchedIntegralFunction` which requires specifying `prototype`s for the values to be modified
instead of `nout` and `batch`. https://github.com/SciML/SciMLBase.jl/pull/497
- `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.
https://github.com/SciML/SciMLBase.jl/pull/501
- `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
for wrapping Fortran solvers in the interface. https://github.com/SciML/SciMLBase.jl/pull/477
- `SDEProblem` constructor was changed to remove an anti-pattern which required passing the diffusion function `g` twice, i.e. `SDEProblem(SDEFunction(f,g),g, ...)`.
Now this is simply `SDEProblem(SDEFunction(f,g),...)`. https://github.com/SciML/SciMLBase.jl/pull/489
2 changes: 1 addition & 1 deletion docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ pages = [
"interfaces/Common_Keywords.md",
"interfaces/Differentiation.md",
"interfaces/PDE.md"],
"Fundamentals" => Any["fundamentals/FAQ.md"],
"Fundamentals" => Any["fundamentals/FAQ.md"]
]
2 changes: 1 addition & 1 deletion docs/src/fundamentals/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ See [ColPrac: Contributor's Guide on Collaborative Practices for Community Packa

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

Yes! See [the SciML Developer Programs](https://sciml.ai/dev/) webpage.
Yes! See [the SciML Developer Programs](https://sciml.ai/dev/) webpage.
291 changes: 167 additions & 124 deletions docs/src/index.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/src/interfaces/Algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
`SciMLAlgorithms` are defined as types which have dispatches to the function signature:

```julia
CommonSolve.solve(prob::AbstractSciMLProblem,alg::AbstractSciMLAlgorithm;kwargs...)
CommonSolve.solve(prob::AbstractSciMLProblem, alg::AbstractSciMLAlgorithm; kwargs...)
```

### Algorithm-Specific Arguments
Expand Down
72 changes: 36 additions & 36 deletions docs/src/interfaces/Array_and_Number.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ the rules which are required on container and number types which are allowable
in SciML tools.

!!! warn

In general as of 2023, strict adherence to this interface is an early work-in-progress.
If anything does not conform to the documented interface, please open an issue.

!!! note

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

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

Additionally, the following rules apply to subsets of uses:

### Adaptive Number Types

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

### Time Types (Independent Variables)

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

## SciML Container (Array) Types

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

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

!!! note

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

### SciML Mutable Array Types

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

### SciML Matrix (Operator) Type

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

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