-
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
Add writeSBML
#143
Add writeSBML
#143
Conversation
Codecov Report
@@ Coverage Diff @@
## master #143 +/- ##
==========================================
+ Coverage 91.57% 93.50% +1.92%
==========================================
Files 9 10 +1
Lines 451 754 +303
==========================================
+ Hits 413 705 +292
- Misses 38 49 +11
Continue to review full report at Codecov.
|
6e30b7f
to
5526a7b
Compare
865a735
to
831bad8
Compare
76de7bb
to
5b2918f
Compare
e179814
to
91d8515
Compare
34a915e
to
01d7110
Compare
01d7110
to
e365300
Compare
c92b07b
to
69c1db8
Compare
25619c1
to
b9b63a0
Compare
07b232e
to
7ad6d13
Compare
These methods aren't needed by the package at the moment and we can avoid loading some extra packages (as small as they are). If we need, we can move the code back to the main package at any time.
This improves time-to-first `readSBML` a little bit, as the function is actually run and fully compiled. In particular, this reduces memory allocations a little bit. Without any precompilation: ``` julia> @time @eval using SBML 0.358911 seconds (774.55 k allocations: 56.314 MiB, 1.73% compilation time) julia> @time @eval m2 = readSBMLFromString(writeSBML(readSBML("Dasgupta2020.xml"))) 4.058562 seconds (3.89 M allocations: 253.997 MiB, 2.78% gc time, 98.77% compilation time) SBML.Model with 6 reactions, 2 species, and 8 parameters. julia> @time @eval m2 = readSBMLFromString(writeSBML(readSBML("Dasgupta2020.xml"))) 0.035276 seconds (3.74 k allocations: 174.250 KiB) SBML.Model with 6 reactions, 2 species, and 8 parameters. ``` Before this change: ``` julia> @time @eval using SBML 0.408944 seconds (864.25 k allocations: 62.282 MiB, 1.52% compilation time) julia> @time @eval m2 = readSBMLFromString(writeSBML(readSBML("Dasgupta2020.xml"))) 3.576220 seconds (1.78 M allocations: 115.261 MiB, 1.53% gc time, 98.38% compilation time) SBML.Model with 6 reactions, 2 species, and 8 parameters. julia> @time @eval m2 = readSBMLFromString(writeSBML(readSBML("Dasgupta2020.xml"))) 0.033041 seconds (5.38 k allocations: 199.828 KiB) SBML.Model with 6 reactions, 2 species, and 8 parameters. ``` After this change: ``` julia> @time @eval using SBML 0.432498 seconds (877.53 k allocations: 63.441 MiB, 1.43% compilation time) julia> @time @eval m2 = readSBMLFromString(writeSBML(readSBML("Dasgupta2020.xml"))) 3.197203 seconds (733.27 k allocations: 47.346 MiB, 0.72% gc time, 98.54% compilation time) SBML.Model with 6 reactions, 2 species, and 8 parameters. julia> @time @eval m2 = readSBMLFromString(writeSBML(readSBML("Dasgupta2020.xml"))) 0.034096 seconds (3.68 k allocations: 172.438 KiB) SBML.Model with 6 reactions, 2 species, and 8 parameters. ```
@giordano : would it be hard to merge the new Trigger struct and associated code before this whole PR is done? (Not super urgent, but would be nice to have) |
Rebasing on master would be highly non-fun, I had to do it a few times already and I'm not looking forward to doing it again. |
Alright. Then I'll wait and watch this space. |
@paulflang please open a PR with the code so that it stays in sight and we can see that we're not doing something that would break the code. Integrity of writeSBML merge is a kinda priority now (partly because how huge this PR is) -- I'll eventually do the gluing&rebasing with the Trigger code later. |
Depends on sbmlteam/libsbml#247 |
Full functionality depends on solving sbmlteam/libsbml#248 |
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.
🎉 C E L E B R A T I O N 🎉
I'll eventually need to check whether some of the smaller items that are now created by plain constructor (Something_create
) wouldn't be safer to get created by parent (inheriting XML props etc, ParentObject_addSomething
style). But that's a completely minor problem.
Let's roll out 1.0 asap.
This is a very preliminary draft, it only takes units into account
EDIT by @exaexa :
Looking at the "dependency order" of stuff in SBML, I guess the good implementation path is:
mostly done, but gene products need to be added to an FBC package, not directly to the modelnow done, but it requires [SBML] Add patch to add new functions to C API JuliaPackaging/Yggdrasil#5011)almost done, needs writing the formuladone and fully tested)Objective
struct #211)