-
Notifications
You must be signed in to change notification settings - Fork 21
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
How to set MathML string to libcellml component? #1024
Comments
We got this working, the issue were the correct namespaces on the MathML string. |
Would you mind clarifying which line the program segfaulted on. If it segfaulted on |
This was not a segfault. @aditya-ml got this wrong. The thing which happens is that the library just does not create the model if the namespace was missing on the MathML string. I.e. everything else in the component/model was not written out if the MathML was not correct.
I hope this makes sense. |
If you don't mind I will re-open this issue. I have found that I do get a segfault when printing out model using the output of The output of this function is not what is given above in the output but the following:
And this is definitely causing a segfault when attempting to print the model. |
I don't get a crash when setting the math to a component. At that point the math is only a string and nothing happens with it. It isn't until some action on the string is required that things go South, like printing it. |
libCellML has taken the point of view that we will let the user/modeller do what they want, putting as few restrictions in place as we are able. When setting something we are not returning success or failure states because it muddies the water when you are returning something that isn't a success or failure state. What we do have instead is the |
I can say that return values let you find errors much much faster than a post-hoc validation/analysis step. An analysis/validation tells you that something is wrong, not how something went wrong. |
I agree with Lucian here. Also it allows to directly react/log issues when using the library in the context of a larger project. I.e. I don't want to do a complete post-hoc validation after every step to check if things worked. |
Following on the discussion in issue #1017 I tried creating math equations using
libsbml.parseL3Formula
. However, my program crashes on the last line rather than set the equation to libcellml component.Snippet:
Output:
The text was updated successfully, but these errors were encountered: