Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
SBML.jl
Commits
7f1506c8
Commit
7f1506c8
authored
Jun 17, 2021
by
Miroslav Kratochvil
Browse files
clean up documentation and types
parent
6d555903
Changes
4
Hide whitespace changes
Inline
Side-by-side
docs/src/index.md
View file @
7f1506c8
...
...
@@ -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]
...
...
src/SBML.jl
View file @
7f1506c8
...
...
@@ -16,6 +16,6 @@ include("symbolics.jl")
sbml
=
(
sym
::
Symbol
)
->
dlsym
(
SBML_jll
.
libsbml_handle
,
sym
)
export
SBMLVersion
,
readSBML
,
getS
,
getLBs
,
getUBs
,
getOCs
export
conver
t_level_and_version
,
libsbml_convert
,
convert_simplify_math
export
se
t_level_and_version
,
libsbml_convert
,
convert_simplify_math
end
# module
src/readsbml.jl
View file @
7f1506c8
...
...
@@ -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`](@
R
ef), but returns `nothing` instead of throwing an
Like [`get_string`](@
r
ef), 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
[`
conver
t_level_and_version`](@ref), [`libsbml_convert`](@ref), and
[`
se
t_level_and_version`](@ref), [`libsbml_convert`](@ref), and
[`convert_simplify_math`](@ref).
# Example
...
...
src/symbolics.jl
View file @
7f1506c8
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
)
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment