-
Notifications
You must be signed in to change notification settings - Fork 12
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
piecewise handling fails #112
Comments
is there a way to reproduce this? (preferably code) |
sbml_fn = "00190-sbml-l3v2.xml"
ml = readSBML(sbml_fn, doc -> begin
set_level_and_version(3, 2)(doc)
convert_simplify_math(doc)
end)
convert(Num, ml.reactions["reaction1"].kinetic_math) |
that works for me. What precise model is that? |
aaaaaah I didn't see the link. Better always supply the download code or something. :D |
So it looks that piecewise can actually accept |
OK I fixed the piecewise argument order, now there's a bit more general problem: using Symbolics
@variables a b
Core.ifelse(a < b, 2, 1) ...gives
what's the correct |
IfElse.ifelse. |
also, you should return the function without evaluating it. it should only be evaluated when the simulator calls it. in your example neither |
the I see ifelse.ifelse is correctly overloaded, good, I totally missed that fact the last time. |
there was no |
ok then I have no idea what eval you are talking about |
I was not talking about
|
anyway I guess this is it? (pls ack in the PR)
Yeah the problem with Num is obvious, I was stuffing Num into the bad ifelse that can't support it. Evaluation order doesn't have much to do with that (it's just extra confusing). |
I don't see where the
|
nah that was my testcase. 00190 produces |
Unfortunately, I found a case where piecewise still fails: using SBML
using Symbolics
url = "https://raw.githubusercontent.com/sbmlteam/sbml-test-suite/master/cases/semantic/00191/00191-sbml-l3v2.xml"
tmpfile = download(url)
try
ml = readSBML(tmpfile)
convert(Num, ml.reactions["reaction1"].kinetic_math) # works
convert(Num, ml.reactions["reaction2"].kinetic_math) # fails
finally
rm(tmpfile)
end
|
@paulflang please open new issues for newly found failing test cases. This doesn't look like piecewise problem, it says "unknown SBML function". The only actual function I see in test 191 is |
case 000190 gives me the following error:
In #40 we used
But could also have to do with handling of Booleans.
cc @anandijain
The text was updated successfully, but these errors were encountered: