Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
COBREXA.jl
Manage
Activity
Members
Plan
External wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LCSB-BioCore
COBREXA.jl
Commits
dfa346eb
Commit
dfa346eb
authored
3 years ago
by
Miroslav Kratochvil
Browse files
Options
Downloads
Patches
Plain Diff
add unwrapping model modifications for Serialized model
parent
25d5eb53
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/base/macros/serialized.jl
+17
-0
17 additions, 0 deletions
src/base/macros/serialized.jl
src/reconstruction/SerializedModel.jl
+20
-0
20 additions, 0 deletions
src/reconstruction/SerializedModel.jl
with
37 additions
and
0 deletions
src/base/macros/serialized.jl
0 → 100644
+
17
−
0
View file @
dfa346eb
"""
_serialized_change_unwrap(fn::Symbol)
Creates a simple wrapper structure that calls a function transparently on the
internal precached model. Internal type is returned (because this would break
the consistency of serialization).
"""
macro
_serialized_change_unwrap
(
fn
::
Symbol
)
docstring
=
"""
$
fn(model::Serialized, ...)
Calls [
$
fn](@ref) of the internal serialized model type.
Returns the modified un-serialized model.
"""
:
(
@doc
$
docstring
$
fn
(
model
::
Serialized
,
args
...
;
kwargs
...
)
=
$
fn
(
unwrap_serialized
(
model
),
args
...
;
kwargs
...
))
end
This diff is collapsed.
Click to expand it.
src/reconstruction/SerializedModel.jl
0 → 100644
+
20
−
0
View file @
dfa346eb
# this just generates the necessary wrappers
@_serialized_change_unwrap
change_bound
@_serialized_change_unwrap
change_bounds
@_serialized_change_unwrap
add_reaction
@_serialized_change_unwrap
remove_reaction
@_serialized_change_unwrap
remove_reactions
@_serialized_change_unwrap
remove_metabolite
@_serialized_change_unwrap
remove_metabolites
"""
unwrap_serialized(model::Serialized)
Returns the model stored in the serialized structure.
"""
function
unwrap_serialized
(
model
::
Serialized
)
precache!
(
model
)
model
.
m
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment