From: Andy S. <and...@gm...> - 2014-12-24 06:40:10
|
Uploaded new beta8 to SF, binaries for Linux64 and Win32. This version has the newest libsbml 5.11 — no problems found yet. Adds reading matrix rows via row/column name: In [2]: r=RoadRunner("feedback.xml") Notice: Using LLVM symbol/value cache In [3]: mat = r.getFullStoichiometryMatrix() # print the mat In [4]: mat Out[4]: J0, J1, J2, J3, J4 S1 [[ 1, -1, 0, 0, 0], S2 [ 0, 1, -1, 0, 0], S3 [ 0, 0, 1, -1, 0], S4 [ 0, 0, 0, 1, -1]] # can look up by either row or col name, use a col name here In [5]: mat['J0'] Out[5]: array([ 1., 0., 0., 0.]) # row name here In [6]: mat['S4'] Out[6]: array([ 0., 0., 0., 1., -1.]) # if the arg does not match either the row or col names, it falls through to the Numpy mp_subscript function. # here bumpy pulls the 2nd row In [7]: mat[2] Out[7]: [ 0. 0. 1. -1. 0.] # standard bumpy error message if invalid subscript arg. In [8]: mat['xxx'] --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-8-1d4dda1fffaf> in <module>() ----> 1 mat['xxx'] ValueError: field named xxx not found. |