Commit 7f1506c8 authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

clean up documentation and types

parent 6d555903
......@@ -89,7 +89,14 @@ Modules = [SBML]
Pages = ["utils.jl"]
```
## Internal math manipulation
## Math and `Symbolics.jl` compatibility
```@autodocs
Modules = [SBML]
Pages = ["symbolics.jl"]
```
### Internal math helpers
```@autodocs
Modules = [SBML]
......
......@@ -16,6 +16,6 @@ include("symbolics.jl")
sbml = (sym::Symbol) -> dlsym(SBML_jll.libsbml_handle, sym)
export SBMLVersion, readSBML, getS, getLBs, getUBs, getOCs
export convert_level_and_version, libsbml_convert, convert_simplify_math
export set_level_and_version, libsbml_convert, convert_simplify_math
end # module
......@@ -2,7 +2,7 @@
const VPtr = Ptr{Cvoid}
"""
function get_string(x::VPtr, fn_sym)::Maybe{String}
get_string(x::VPtr, fn_sym)::Maybe{String}
C-call the SBML function `fn_sym` with a single parameter `x`, interpret the
result as a string and return it, or throw exception in case the pointer is
......@@ -18,9 +18,9 @@ function get_string(x::VPtr, fn_sym)::String
end
"""
function get_optional_string(x::VPtr, fn_sym)::Maybe{String}
get_optional_string(x::VPtr, fn_sym)::Maybe{String}
Like [`get_string`](@Ref), but returns `nothing` instead of throwing an
Like [`get_string`](@ref), but returns `nothing` instead of throwing an
exception.
This is used to get notes and annotations and several other things (see
......@@ -82,7 +82,7 @@ Read the SBML from a XML file in `fn` and return the contained `SBML.Model`.
The `sbml_conversion` is a function that does an in-place modification of the
single parameter, which is the C pointer to the loaded SBML document (C type
`SBMLDocument*`). Several functions for doing that are prepared, including
[`convert_level_and_version`](@ref), [`libsbml_convert`](@ref), and
[`set_level_and_version`](@ref), [`libsbml_convert`](@ref), and
[`convert_simplify_math`](@ref).
# Example
......
default_symbolics_mapping = Dict(
"""
default_symbolics_mapping :: Dict{String,Any}
Default mapping of SBML function names to Julia functions, represented as a
dictionary from Strings (SBML names) to anything `eval`uable as Julia&Symbolics
functions, such as symbols and expressions.
The default mapping only contains the basic SBML functions that are
unambiguously represented in Julia; it is supposed to be extended by the user
if more functions need to be supported.
"""
default_symbolics_mapping = Dict{String,Any}(
"+" => :+,
"-" => :-,
"*" => :*,
......@@ -12,7 +23,6 @@ default_symbolics_mapping = Dict(
"ceiling" => :ceil,
"floor" => :floor,
"piecewise" => :(Core.ifelse),
#TODO extend this in the future
)
allowed_sym(x, allowed_funs) =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment