-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Refactor "src/dsl.jl" file #985
Conversation
3f92a31
to
b6ba044
Compare
src/dsl.jl
Outdated
variables = vcat(variables_declared, vars_extracted) | ||
|
||
# handle independent variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of the organisations so that options are handled together (in two sets, some before and some after the reactions are considered, depending on whichever is possible for which option)
src/dsl.jl
Outdated
symvec = gensym() | ||
ex = quote | ||
$symvec = $ex | ||
expr = quote |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in some places we used ex and some expr, here I just made it uniform
This should be ready now. However, Plots fails on precompilation, so have to wait until that is fixed. Not high priority though, doesn't actually change anything (but should make further updates to the DSL easier). Once this PR is merged, I will have a follow-up one which reorders the option handling functions to follow the order with which they are called. |
…to src___refactoring___dsl_file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check that non-scalarization is still working ok for vector parameters, and ensure there isn't a performance regression. See the examples in #1051
exsys = Catalyst.make_reaction_system(ex) | ||
sys = @eval Catalyst $exsys | ||
@test sys isa ReactionSystem | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this added by someone though who wanted a test to check they could get the expressions out and evaluate them? If so we should probably keep some kind of variation on this checking such a process works.
exsys = Catalyst.make_reaction_system(ex) | ||
sys = @eval Catalyst $exsys | ||
@test sys isa ReactionSystem | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we modify the test to eval within a new module? Maybe that would avoid the observed
issue?
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Ahh, nevermind that comment. For some reason Github showed me an old version of the code... Looks good to me. |
Also does the "src/expression_utils.jl" file, as that primarily support the dsl file (the other relevant file is the chemistry one).
Primarily four types of changes:
@reaction_network
and@network_component
macros reuse minimal amount of code (where as previously it the second was basically ctrl+copied versions of the first.I also add some tests of all the various ways to create models via the DSL, mostly stuff that was not tested before.