@@ -234,6 +234,45 @@ def test_pickle():
234234
235235 print ('arrow object pickled is {} bytes' .format (len (pickled_arrow )))
236236
237+ def test_flagella ():
238+ stoichiometry = np .array (
239+ [[ 0 , 0 , 0 , 0 , 0 , - 4 , - 2 , 0 , 0 , 0 , 0 ,
240+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
241+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 ,
242+ 0 , 0 , 0 ],
243+ [ - 26 , - 34 , - 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
244+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
245+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 ,
246+ 0 , 0 , 0 ],
247+ [ 0 , 0 , 0 , - 1 , - 1 , 0 , 0 , - 1 , - 1 , - 1 , - 1 ,
248+ - 1 , - 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
249+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
250+ 1 , 0 , 0 ],
251+ [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
252+ 0 , 0 , - 12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
253+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
254+ - 1 , 1 , 0 ],
255+ [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
256+ 0 , 0 , 0 , - 2 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 ,
257+ - 1 , - 1 , - 1 , 0 , 0 , 0 , 0 , 0 , 0 , - 1 , 0 ,
258+ 0 , 0 , 1 ],
259+ [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
260+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
261+ 0 , 0 , 0 , - 1 , - 1 , - 1 , - 5 , - 120 , 0 , 0 , 1 ,
262+ 0 , - 1 , - 1 ]])
263+
264+ substrate = np .array ([
265+ 21 , 1369 , 69 , 4 , 1 , 1674 , 0 , 48 , 53 , 49 , 61 , 7 ,
266+ 3 , 28 , 151 , 0 , 26 , 20 , 3 , 3 , 9 , 16 , 7 , 26 ,
267+ 280 , 26 , 64 , 67 , 310 , 13559 , 208 , 16 , 22 , 0 , 17 , 0 ], np .int64 )
268+
269+ rates = np .array ([1.e-05 , 1.e-05 , 1.e-05 , 1.e-05 , 1.e-05 , 1.e-05 ])
270+
271+ arrow = StochasticSystem (stoichiometry )
272+ result = arrow .evolve (1.0 , substrate , rates )
273+
274+ print ('flagella result: {}' .format (result ))
275+
237276
238277def main (args ):
239278 systems = (
@@ -254,6 +293,8 @@ def main(args):
254293 test_compare_runtime ()
255294 elif args .pickle :
256295 test_pickle ()
296+ elif args .flagella :
297+ test_flagella ()
257298 else :
258299 for system in systems :
259300 system ()
@@ -300,5 +341,6 @@ def main(args):
300341 parser .add_argument ('--memory' , action = 'store_true' )
301342 parser .add_argument ('--time' , action = 'store_true' )
302343 parser .add_argument ('--pickle' , action = 'store_true' )
344+ parser .add_argument ('--flagella' , action = 'store_true' )
303345
304346 main (parser .parse_args ())
0 commit comments