-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from SciML/docs
Improve documentation structure
- Loading branch information
Showing
6 changed files
with
153 additions
and
87 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Simple Demonstration of a Symbolic System Structure | ||
|
||
In this tutorial we will show how to implement a system structure type for defining the | ||
symbolic indexing of a domain-specific language. This tutorial will show how the | ||
`SymbolCache` type is defined to take in arrays of symbols for its independent, dependent, | ||
and parameter variable names and uses that to define the symbolic indexing interface. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Defining Solution Wrapper Fallbacks | ||
|
||
The simplest case is when the type contains an object that already implements the interface. | ||
All its methods can simply be forwarded to that object. To do so, SymbolicIndexingInterface.jl | ||
provides the [`symbolic_container`](@ref) method. For example, | ||
|
||
```julia | ||
struct MySolutionWrapper{T<:SciMLBase.AbstractTimeseriesSolution} | ||
sol::T | ||
# other properties... | ||
end | ||
|
||
symbolic_container(sys::MySolutionWrapper) = sys.sol | ||
``` | ||
|
||
`MySolutionWrapper` wraps an `AbstractTimeseriesSolution` which already implements the interface. | ||
Since `symbolic_container` will return the wrapped solution, all method calls such as | ||
`is_parameter(sys::MySolutionWrapper, sym)` will be forwarded to `is_parameter(sys.sol, sym)`. | ||
|
||
In cases where some methods need to function differently than those of the wrapped type, they can be selectively | ||
defined. For example, suppose `MySolutionWrapper` does not support observed quantities. The following | ||
method can be defined (in addition to the one above): | ||
|
||
```julia | ||
is_observed(sys::MySolutionWrapper, sym) = false | ||
``` |
Oops, something went wrong.