In [1]:
%load_ext autoreload
%autoreload 2
%matplotlib inline


The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload

In [2]:
import pyximport; pyximport.install()
import sys
import dill as pickle
from IPython.display import SVG

#BOXSIMU_PATH = '/home/aschi/Documents/MyPrivateRepo/boxsimu/'
#if not BOXSIMU_PATH in sys.path:
#    sys.path.append(BOXSIMU_PATH)
    
import boxsimu
from boxsimu import ur

In [3]:
# -*- coding: utf-8 -*-

import sys
import copy
import numpy as np
import pandas as pd
import datetime

from matplotlib import pyplot as plt

from simulations import boxmodelsystem3
from boxsimu import ur

system = boxmodelsystem3.get_system()

In [4]:
system.save_as_svg('test_svg')


corners [(330.0, 0.0), (630.0, 0.0), (630.0, 300.0), (330.0, 300.0)]
corners [(330.0, 0.0), (630.0, 0.0), (630.0, 300.0), (330.0, 300.0)]
corners [(-330.0, 4.0413344371862656e-14), (-30.0, 4.0413344371862656e-14), (-30.0, 300.00000000000006), (-330.0, 300.00000000000006)]
corners [(-330.0, 4.0413344371862656e-14), (-30.0, 4.0413344371862656e-14), (-30.0, 300.00000000000006), (-330.0, 300.00000000000006)]

In [5]:
sol = system.solve(200*ur.month, 0.5*ur.month)


Start solving the BoxModelSystem...
- total integration time: 200.0 month
- dt (time step): 0.5 month
- number of time steps: 400
10.0%
20.0%
30.0%
40.0%
50.0%
60.0%
70.0%
80.0%
90.0%
Function "solve(...)" used 11.727s

In [7]:
sol.save('mysaved_solution.pickle')

In [8]:
sol2 = boxsimu.Solution.load('mysaved_solution.pickle')
sol2.df


Out[8]:
Box box1 box2
Quantity mass volume A B C D mass volume A B C D
Timestep
0 100000.0 100.0 9.079167e-01 2.929306 0.061111 0.000000 100000.0 100.0 1.944583 0.909167 0.036667 0.000000
1 100000.0 100.0 8.243127e-01 2.872709 0.116569 0.000000 100000.0 100.0 1.894147 0.826668 0.070013 0.000000
2 100000.0 100.0 7.484072e-01 2.828909 0.166896 0.000000 100000.0 100.0 1.848235 0.751743 0.100344 0.000000
3 100000.0 100.0 6.794914e-01 2.796723 0.212562 0.000000 100000.0 100.0 1.806431 0.683698 0.127935 0.000000
4 100000.0 100.0 6.169216e-01 2.775080 0.253998 0.000000 100000.0 100.0 1.768358 0.621907 0.153039 0.000000
5 100000.0 100.0 5.601134e-01 2.763005 0.291593 0.000000 100000.0 100.0 1.733673 0.565796 0.175885 0.000000
6 100000.0 100.0 5.085363e-01 2.759614 0.325700 0.000000 100000.0 100.0 1.702065 0.514846 0.196679 0.000000
7 100000.0 100.0 4.617085e-01 2.764105 0.356642 0.000000 100000.0 100.0 1.673251 0.468588 0.215610 0.000000
8 100000.0 100.0 4.191929e-01 2.775748 0.384709 0.000000 100000.0 100.0 1.646974 0.426590 0.232850 0.000000
9 100000.0 100.0 3.805922e-01 2.793881 0.410166 0.000000 100000.0 100.0 1.623000 0.388465 0.248555 0.000000
10 100000.0 100.0 3.455460e-01 2.817904 0.433253 0.000000 100000.0 100.0 1.601117 0.353858 0.262866 0.000000
11 100000.0 100.0 3.137270e-01 2.847272 0.454190 0.000000 100000.0 100.0 1.581132 0.322448 0.275912 0.000000
12 100000.0 100.0 2.848379e-01 2.881488 0.473173 0.000000 100000.0 100.0 1.562869 0.293942 0.287810 0.000000
13 100000.0 100.0 2.586091e-01 2.920104 0.490382 0.000000 100000.0 100.0 1.546170 0.268075 0.298665 0.000000
14 100000.0 100.0 2.347955e-01 2.962711 0.505982 0.000000 100000.0 100.0 1.530889 0.244607 0.308574 0.000000
15 100000.0 100.0 2.131748e-01 3.008938 0.520095 0.000025 100000.0 100.0 1.516896 0.223317 0.317625 0.000000
16 100000.0 100.0 1.935449e-01 3.058449 0.532822 0.000109 100000.0 100.0 1.504070 0.204007 0.325898 0.000000
17 100000.0 100.0 1.757227e-01 3.110939 0.544291 0.000245 100000.0 100.0 1.492304 0.186496 0.333464 0.000000
18 100000.0 100.0 1.595415e-01 3.166130 0.554618 0.000430 100000.0 100.0 1.481498 0.170619 0.340390 0.000000
19 100000.0 100.0 1.448504e-01 3.223769 0.563909 0.000658 100000.0 100.0 1.471563 0.156227 0.346736 0.000000
20 100000.0 100.0 1.315121e-01 3.283630 0.572260 0.000924 100000.0 100.0 1.462418 0.143184 0.352554 0.000000
21 100000.0 100.0 1.194020e-01 3.345503 0.579757 0.001225 100000.0 100.0 1.453988 0.131368 0.357896 0.000000
22 100000.0 100.0 1.084071e-01 3.409200 0.586480 0.001557 100000.0 100.0 1.446207 0.120665 0.362805 0.000000
23 100000.0 100.0 9.842462e-02 3.474551 0.592500 0.001918 100000.0 100.0 1.439013 0.110974 0.367323 0.000000
24 100000.0 100.0 8.936135e-02 3.541399 0.597883 0.002303 100000.0 100.0 1.432350 0.102203 0.371486 0.000000
25 100000.0 100.0 8.113266e-02 3.609604 0.602687 0.002711 100000.0 100.0 1.426170 0.094267 0.375328 0.000000
26 100000.0 100.0 7.366169e-02 3.679039 0.606966 0.003139 100000.0 100.0 1.420425 0.087091 0.378879 0.000000
27 100000.0 100.0 6.687868e-02 3.749585 0.610769 0.003584 100000.0 100.0 1.415073 0.080604 0.382167 0.000000
28 100000.0 100.0 6.072027e-02 3.821138 0.614140 0.004046 100000.0 100.0 1.410078 0.074744 0.385218 0.000000
29 100000.0 100.0 5.512894e-02 3.893603 0.617119 0.004521 100000.0 100.0 1.405405 0.069454 0.388054 0.000000
... ... ... ... ... ... ... ... ... ... ... ... ...
370 100000.0 100.0 2.723088e-16 29.793428 0.496405 0.082949 100000.0 100.0 0.005071 0.338416 0.958836 0.260699
371 100000.0 100.0 2.472337e-16 29.864347 0.496198 0.082949 100000.0 100.0 0.004604 0.349914 0.957041 0.262502
372 100000.0 100.0 2.244676e-16 29.935237 0.495991 0.082949 100000.0 100.0 0.004180 0.361508 0.955226 0.264297
373 100000.0 100.0 2.037979e-16 30.006097 0.495785 0.082949 100000.0 100.0 0.003795 0.373192 0.953394 0.266084
374 100000.0 100.0 1.850315e-16 30.076928 0.495578 0.082949 100000.0 100.0 0.003446 0.384959 0.951546 0.267862
375 100000.0 100.0 1.679932e-16 30.147729 0.495372 0.082949 100000.0 100.0 0.003128 0.396805 0.949685 0.269632
376 100000.0 100.0 1.525238e-16 30.218501 0.495165 0.082949 100000.0 100.0 0.002840 0.408723 0.947813 0.271393
377 100000.0 100.0 1.384789e-16 30.289243 0.494959 0.082949 100000.0 100.0 0.002579 0.420710 0.945932 0.273146
378 100000.0 100.0 1.257273e-16 30.359956 0.494753 0.082949 100000.0 100.0 0.002341 0.432761 0.944044 0.274891
379 100000.0 100.0 1.141499e-16 30.430639 0.494547 0.082949 100000.0 100.0 0.002126 0.444873 0.942149 0.276626
380 100000.0 100.0 1.036386e-16 30.501293 0.494341 0.082949 100000.0 100.0 0.001930 0.457042 0.940251 0.278353
381 100000.0 100.0 9.409523e-17 30.571918 0.494135 0.082949 100000.0 100.0 0.001752 0.469266 0.938348 0.280072
382 100000.0 100.0 8.543063e-17 30.642513 0.493929 0.082949 100000.0 100.0 0.001591 0.481541 0.936444 0.281781
383 100000.0 100.0 7.756389e-17 30.713078 0.493723 0.082949 100000.0 100.0 0.001444 0.493865 0.934538 0.283482
384 100000.0 100.0 7.042155e-17 30.783615 0.493517 0.082949 100000.0 100.0 0.001311 0.506236 0.932632 0.285175
385 100000.0 100.0 6.393690e-17 30.854122 0.493312 0.082949 100000.0 100.0 0.001191 0.518651 0.930727 0.286859
386 100000.0 100.0 5.804938e-17 30.924599 0.493106 0.082949 100000.0 100.0 0.001081 0.531109 0.928823 0.288534
387 100000.0 100.0 5.270400e-17 30.995047 0.492901 0.082949 100000.0 100.0 0.000981 0.543607 0.926920 0.290200
388 100000.0 100.0 4.785084e-17 31.065466 0.492695 0.082949 100000.0 100.0 0.000891 0.556146 0.925021 0.291858
389 100000.0 100.0 4.344457e-17 31.135855 0.492490 0.082949 100000.0 100.0 0.000809 0.568722 0.923124 0.293508
390 100000.0 100.0 3.944405e-17 31.206215 0.492285 0.082949 100000.0 100.0 0.000735 0.581334 0.921231 0.295148
391 100000.0 100.0 3.581191e-17 31.276546 0.492080 0.082949 100000.0 100.0 0.000667 0.593983 0.919342 0.296781
392 100000.0 100.0 3.251423e-17 31.346847 0.491875 0.082949 100000.0 100.0 0.000605 0.606665 0.917457 0.298404
393 100000.0 100.0 2.952021e-17 31.417120 0.491670 0.082949 100000.0 100.0 0.000550 0.619381 0.915578 0.300019
394 100000.0 100.0 2.680189e-17 31.487362 0.491465 0.082949 100000.0 100.0 0.000499 0.632129 0.913703 0.301626
395 100000.0 100.0 2.433389e-17 31.557576 0.491260 0.082949 100000.0 100.0 0.000453 0.644909 0.911834 0.303224
396 100000.0 100.0 2.209314e-17 31.627760 0.491055 0.082949 100000.0 100.0 0.000411 0.657720 0.909970 0.304813
397 100000.0 100.0 2.005873e-17 31.697915 0.490851 0.082949 100000.0 100.0 0.000374 0.670562 0.908113 0.306395
398 100000.0 100.0 1.821166e-17 31.768041 0.490646 0.082949 100000.0 100.0 0.000339 0.683433 0.906261 0.307968
399 100000.0 100.0 1.653467e-17 31.838138 0.490442 0.082949 100000.0 100.0 0.000308 0.696333 0.904416 0.309532

400 rows × 12 columns


In [5]:
hash(system)


Out[5]:
8744577179091

In [4]:
hash(system.name)


Out[4]:
7384097551834160323

In [16]:
repr(system.name)


Out[16]:
"'Test System'"

In [13]:
import cProfile
import re
cProfile.run('system.solve(200*ur.month, 0.5*ur.month)', 'restats')


Start solving the BoxModelSystem...
- total integration time: 200.0 month
- dt (time step): 0.5 month
- number of time steps: 400
10.0%
20.0%
30.0%
40.0%
50.0%
60.0%
70.0%
80.0%
90.0%
Function "solve(...)" used 18.482s

In [9]:
import pstats
p = pstats.Stats('restats')

In [10]:
p.strip_dirs().sort_stats(-1).print_stats()


Thu Oct  5 13:22:24 2017    restats

         23315352 function calls (23182612 primitive calls) in 20.696 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     2022    0.002    0.000    0.003    0.000 <frozen importlib._bootstrap>:402(parent)
     8497    0.010    0.000    0.020    0.000 <frozen importlib._bootstrap>:989(_handle_fromlist)
        1    0.000    0.000   20.696   20.696 <string>:1(<module>)
        2    0.000    0.000    0.000    0.000 __init__.py:120(lzip)
      830    0.001    0.000    0.002    0.000 __init__.py:177(iteritems)
   422448    0.380    0.000    0.651    0.000 __init__.py:82(_to_magnitude)
   229035    0.158    0.000    0.214    0.000 _collections_abc.py:672(keys)
   218818    0.140    0.000    0.189    0.000 _collections_abc.py:676(items)
   447853    0.106    0.000    0.106    0.000 _collections_abc.py:698(__init__)
        4    0.000    0.000    0.000    0.000 _collections_abc.py:701(__len__)
   533679    0.234    0.000    0.381    0.000 _collections_abc.py:719(__iter__)
   396039    0.295    0.000    0.496    0.000 _collections_abc.py:742(__iter__)
        6    0.000    0.000    0.000    0.000 _methods.py:25(_amax)
        3    0.000    0.000    0.000    0.000 _methods.py:28(_amin)
     3200    0.002    0.000    0.028    0.000 _methods.py:31(_sum)
        2    0.000    0.000    0.000    0.000 _methods.py:34(_prod)
     7631    0.006    0.000    0.069    0.000 _methods.py:37(_any)
        1    0.000    0.000    0.000    0.000 _methods.py:40(_all)
        6    0.000    0.000    0.000    0.000 _validators.py:220(validate_bool_kwarg)
  1181445    0.535    0.000    0.535    0.000 _weakrefset.py:70(__contains__)
   750873    0.731    0.000    1.266    0.000 abc.py:178(__instancecheck__)
        5    0.000    0.000    0.000    0.000 algorithms.py:132(_reconstruct_data)
      410    0.001    0.000    0.001    0.000 algorithms.py:1342(_get_take_nd_function)
      410    0.006    0.000    0.032    0.000 algorithms.py:1375(take_nd)
        5    0.000    0.000    0.000    0.000 algorithms.py:158(_ensure_arraylike)
        5    0.000    0.000    0.000    0.000 algorithms.py:209(_get_data_algo)
       10    0.000    0.000    0.000    0.000 algorithms.py:42(_ensure_data)
        5    0.000    0.000    0.001    0.000 algorithms.py:429(safe_sort)
        5    0.000    0.000    0.002    0.000 algorithms.py:527(factorize)
        2    0.000    0.000    0.000    0.000 base.py:1000(astype)
        8    0.000    0.000    0.000    0.000 base.py:1058(_set_names)
        8    0.000    0.000    0.000    0.000 base.py:1066(set_names)
        6    0.000    0.000    0.000    0.000 base.py:111(_reset_cache)
        8    0.000    0.000    0.000    0.000 base.py:1125(rename)
        2    0.000    0.000    0.000    0.000 base.py:1184(is_monotonic)
      409    0.000    0.000    0.001    0.000 base.py:1258(is_unique)
     9624    0.006    0.000    0.006    0.000 base.py:1270(is_integer)
     4811    0.004    0.000    0.005    0.000 base.py:1291(holds_integer)
     9624    0.018    0.000    0.079    0.000 base.py:1303(_convert_scalar_indexer)
 1218/816    0.021    0.000    0.093    0.000 base.py:152(__new__)
      414    0.001    0.000    0.002    0.000 base.py:1537(_engine)
      414    0.000    0.000    0.002    0.000 base.py:1540(<lambda>)
        2    0.000    0.000    0.000    0.000 base.py:1566(inferred_type)
        2    0.000    0.000    0.000    0.000 base.py:1578(is_all_dates)
        5    0.000    0.000    0.000    0.000 base.py:1809(_isnan)
        8    0.000    0.000    0.000    0.000 base.py:1828(hasnans)
  403/402    0.002    0.000    0.009    0.000 base.py:1961(equals)
     5613    0.011    0.000    0.043    0.000 base.py:2435(get_loc)
  401/400    0.004    0.000    0.021    0.000 base.py:2564(get_indexer)
      401    0.002    0.000    0.003    0.000 base.py:2721(_maybe_promote)
      400    0.000    0.000    0.000    0.000 base.py:2819(_can_reindex)
      400    0.003    0.000    0.035    0.000 base.py:2838(reindex)
     5612    0.004    0.000    0.005    0.000 base.py:3360(_maybe_cast_indexer)
      400    0.004    0.000    0.119    0.000 base.py:3585(insert)
      830    0.003    0.000    0.007    0.000 base.py:367(_simple_new)
    11653    0.005    0.000    0.008    0.000 base.py:3999(_ensure_index)
      400    0.000    0.000    0.001    0.000 base.py:4037(_ensure_has_len)
       14    0.000    0.000    0.000    0.000 base.py:404(_shallow_copy)
      400    0.002    0.000    0.025    0.000 base.py:412(_shallow_copy_with_infer)
      403    0.000    0.000    0.000    0.000 base.py:502(is_)
      833    0.001    0.000    0.001    0.000 base.py:522(_reset_identity)
    16897    0.008    0.000    0.011    0.000 base.py:528(__len__)
      400    0.001    0.000    0.001    0.000 base.py:534(__array__)
      406    0.000    0.000    0.000    0.000 base.py:549(dtype)
     2055    0.002    0.000    0.003    0.000 base.py:559(values)
      804    0.000    0.000    0.002    0.000 base.py:564(get_values)
        1    0.000    0.000    0.000    0.000 base.py:634(_try_convert_to_int_index)
      804    0.001    0.000    0.001    0.000 base.py:685(_coerce_to_ndarray)
      814    0.003    0.000    0.004    0.000 base.py:701(_get_attributes_dict)
      814    0.001    0.000    0.001    0.000 base.py:703(<listcomp>)
      400    0.004    0.000    0.079    0.000 base.py:717(_coerce_scalar_to_index)
     1224    0.001    0.000    0.003    0.000 base.py:857(_values)
    16802    0.078    0.000    0.578    0.000 box.py:142(context)
      802    0.002    0.000    0.123    0.000 box.py:149(get_volume)
     2400    0.013    0.000    0.209    0.000 boxmodelsystem3.py:54(<lambda>)
     3200    0.038    0.000    0.783    0.000 boxmodelsystem3.py:63(<lambda>)
     3200    0.043    0.000    0.863    0.000 boxmodelsystem3.py:66(rr2)
      408    0.003    0.000    0.007    0.000 cast.py:251(maybe_promote)
       12    0.000    0.000    0.000    0.000 cast.py:336(infer_dtype_from_scalar)
       16    0.000    0.000    0.000    0.000 cast.py:528(coerce_indexer_dtype)
        5    0.000    0.000    0.000    0.000 cast.py:771(maybe_infer_to_datetimelike)
        5    0.000    0.000    0.003    0.001 categorical.py:2134(_factorize_from_iterable)
        2    0.000    0.000    0.004    0.002 categorical.py:2171(_factorize_from_iterables)
        2    0.000    0.000    0.003    0.002 categorical.py:2193(<listcomp>)
        8    0.000    0.000    0.003    0.000 categorical.py:251(__init__)
        3    0.000    0.000    0.000    0.000 categorical.py:449(from_codes)
       11    0.000    0.000    0.000    0.000 categorical.py:490(_get_codes)
       13    0.000    0.000    0.000    0.000 categorical.py:524(_validate_ordered)
       11    0.000    0.000    0.001    0.000 categorical.py:543(_validate_categories)
        8    0.000    0.000    0.000    0.000 categorical.py:600(_get_categories)
        5    0.000    0.000    0.000    0.000 categorical.py:650(set_ordered)
    20402    0.015    0.000    0.024    0.000 chainmap.py:95(__bool__)
        5    0.000    0.000    0.000    0.000 common.py:1419(is_string_like_dtype)
       36    0.000    0.000    0.000    0.000 common.py:1456(is_float_dtype)
       33    0.000    0.000    0.000    0.000 common.py:1508(is_bool_dtype)
    12822    0.008    0.000    0.010    0.000 common.py:1673(_get_dtype)
     4164    0.005    0.000    0.008    0.000 common.py:1722(_get_dtype_type)
      415    0.001    0.000    0.003    0.000 common.py:190(is_categorical)
     1228    0.001    0.000    0.006    0.000 common.py:222(is_datetimetz)
        2    0.000    0.000    0.000    0.000 common.py:245(_try_sort)
     1218    0.002    0.000    0.005    0.000 common.py:296(is_datetime64_dtype)
     2451    0.001    0.000    0.004    0.000 common.py:333(is_datetime64tz_dtype)
      415    0.002    0.000    0.009    0.000 common.py:353(_asarray_tuplesafe)
     1218    0.001    0.000    0.003    0.000 common.py:371(is_timedelta64_dtype)
     4812    0.002    0.000    0.003    0.000 common.py:406(is_null_slice)
       12    0.000    0.000    0.000    0.000 common.py:406(is_period_dtype)
     9624    0.004    0.000    0.006    0.000 common.py:435(_apply_if_callable)
     1633    0.002    0.000    0.008    0.000 common.py:439(is_interval_dtype)
     3286    0.002    0.000    0.009    0.000 common.py:475(is_categorical_dtype)
        7    0.000    0.000    0.000    0.000 common.py:508(is_string_dtype)
     6405    0.008    0.000    0.018    0.000 common.py:654(is_dtype_equal)
      407    0.001    0.000    0.001    0.000 common.py:740(is_integer_dtype)
      836    0.001    0.000    0.002    0.000 common.py:787(is_signed_integer_dtype)
       33    0.000    0.000    0.000    0.000 common.py:836(is_unsigned_integer_dtype)
      423    0.001    0.000    0.002    0.000 common.py:84(is_object_dtype)
     1218    0.001    0.000    0.009    0.000 common.py:972(is_datetime64_any_dtype)
    915/1    0.002    0.000    0.007    0.007 copy.py:132(deepcopy)
      624    0.000    0.000    0.000    0.000 copy.py:190(_deepcopy_atomic)
     15/6    0.000    0.000    0.005    0.001 copy.py:210(_deepcopy_list)
       10    0.000    0.000    0.003    0.000 copy.py:219(_deepcopy_tuple)
       10    0.000    0.000    0.003    0.000 copy.py:220(<listcomp>)
     71/1    0.001    0.000    0.007    0.007 copy.py:236(_deepcopy_dict)
        8    0.000    0.000    0.000    0.000 copy.py:246(_deepcopy_method)
      233    0.000    0.000    0.000    0.000 copy.py:252(_keep_alive)
     90/1    0.001    0.000    0.007    0.007 copy.py:268(_reconstruct)
      180    0.000    0.000    0.000    0.000 copy.py:273(<genexpr>)
       90    0.000    0.000    0.000    0.000 copyreg.py:87(__newobj__)
   385048    0.122    0.000    0.122    0.000 definitions.py:35(is_multiplicative)
     5200    0.003    0.000    0.004    0.000 descriptors.py:122(__get__)
   218823    0.096    0.000    0.180    0.000 descriptors.py:39(__get__)
     4003    0.012    0.000    0.209    0.000 descriptors.py:42(__set__)
     4000    0.007    0.000    0.216    0.000 descriptors.py:57(__set__)
   271226    0.099    0.000    0.174    0.000 descriptors.py:74(__get__)
       10    0.000    0.000    0.000    0.000 dictionary.py:28(__getstate__)
       10    0.000    0.000    0.000    0.000 dictionary.py:38(__setstate__)
      409    0.001    0.000    0.001    0.000 dtypes.py:145(construct_from_string)
        7    0.000    0.000    0.000    0.000 dtypes.py:183(__new__)
        7    0.000    0.000    0.000    0.000 dtypes.py:241(construct_from_string)
       12    0.000    0.000    0.000    0.000 dtypes.py:367(is_dtype)
      402    0.000    0.000    0.001    0.000 dtypes.py:456(construct_from_string)
     1633    0.003    0.000    0.007    0.000 dtypes.py:489(is_dtype)
     6959    0.007    0.000    0.012    0.000 dtypes.py:84(is_dtype)
      802    0.005    0.000    0.085    0.000 entities.py:126(get_volume)
     9600    0.012    0.000    0.223    0.000 entities.py:155(is_mobile)
    21206    0.017    0.000    0.033    0.000 entities.py:45(__hash__)
    68000    0.116    0.000    0.433    0.000 entities.py:48(__eq__)
        2    0.000    0.000    0.000    0.000 formatting.py:104(formatter)
        2    0.000    0.000    0.000    0.000 formatting.py:191(_parse_spec)
        2    0.000    0.000    0.000    0.000 formatting.py:208(format_unit)
        2    0.000    0.000    0.000    0.000 formatting.py:22(_join)
        2    0.000    0.000    0.000    0.000 formatting.py:270(remove_custom_flags)
        2    0.000    0.000    0.001    0.000 frame.py:1756(transpose)
      403    0.000    0.000    0.000    0.000 frame.py:250(_constructor)
      405    0.003    0.000    0.007    0.000 frame.py:261(__init__)
      400    0.003    0.000    0.157    0.000 frame.py:2735(reindex_axis)
        1    0.000    0.000    0.003    0.003 frame.py:3212(sort_index)
        2    0.000    0.000    0.001    0.000 frame.py:358(_init_dict)
        2    0.000    0.000    0.000    0.000 frame.py:409(<listcomp>)
        2    0.000    0.000    0.000    0.000 frame.py:413(_init_ndarray)
        2    0.000    0.000    0.000    0.000 frame.py:430(_get_axes)
     9624    0.007    0.000    0.007    0.000 frame.py:485(axes)
        2    0.000    0.000    0.000    0.000 frame.py:5489(_arrays_to_mgr)
        2    0.000    0.000    0.000    0.000 frame.py:5561(_prep_ndarray)
        2    0.000    0.000    0.000    0.000 frame.py:5787(_homogenize)
     2400    0.009    0.000    0.045    0.000 fromnumeric.py:1886(any)
        2    0.000    0.000    0.000    0.000 fromnumeric.py:2408(prod)
        8    0.000    0.000    0.000    0.000 frozen.py:101(_shallow_copy)
        8    0.000    0.000    0.000    0.000 frozen.py:145(_ensure_frozen)
    16083    0.026    0.000    0.034    0.000 frozen.py:38(__getitem__)
        2    0.000    0.000    0.000    0.000 function.py:259(validate_transpose_for_generic)
        5    0.000    0.000    0.000    0.000 function.py:38(__call__)
     7602    0.003    0.000    0.003    0.000 function.py:83(static_call)
     6400    0.019    0.000    2.272    0.000 function.py:87(dynamic_call)
    14002    0.019    0.000    2.295    0.000 function.py:95(__call__)
        1    0.000    0.000    0.000    0.000 function_base.py:13(_index_deprecate)
        1    0.000    0.000    0.000    0.000 function_base.py:25(linspace)
      405    0.002    0.000    0.002    0.000 generic.py:117(__init__)
      401    0.001    0.000    0.001    0.000 generic.py:159(_init_mgr)
     4812    0.003    0.000    0.005    0.000 generic.py:1607(_indexer)
     4812    0.003    0.000    0.019    0.000 generic.py:1685(_is_cached)
     4812    0.004    0.000    0.014    0.000 generic.py:1697(_is_view)
     5212    0.012    0.000    0.044    0.000 generic.py:1702(_maybe_update_cacher)
     5212    0.005    0.000    0.006    0.000 generic.py:1736(_clear_item_cache)
     4812    0.008    0.000    0.042    0.000 generic.py:1771(_check_is_chained_assignment_possible)
     5212    0.003    0.000    0.003    0.000 generic.py:1792(_check_setitem_copy)
      400    0.004    0.000    0.155    0.000 generic.py:2593(reindex_axis)
      400    0.006    0.000    0.109    0.000 generic.py:2606(_reindex_with_indexers)
        2    0.000    0.000    0.000    0.000 generic.py:281(_construct_axes_dict_from)
        2    0.000    0.000    0.000    0.000 generic.py:284(<listcomp>)
        2    0.000    0.000    0.000    0.000 generic.py:295(_construct_axes_from_arguments)
      403    0.001    0.000    0.001    0.000 generic.py:3050(__finalize__)
    10026    0.018    0.000    0.018    0.000 generic.py:3067(__getattr__)
    10829    0.024    0.000    0.025    0.000 generic.py:3083(__setattr__)
    10026    0.016    0.000    0.057    0.000 generic.py:3122(_protect_consolidate)
     5214    0.005    0.000    0.037    0.000 generic.py:3132(_consolidate_inplace)
     5214    0.010    0.000    0.023    0.000 generic.py:3135(f)
     4812    0.005    0.000    0.030    0.000 generic.py:3171(_is_mixed_type)
     4812    0.005    0.000    0.016    0.000 generic.py:3173(<lambda>)
        2    0.000    0.000    0.000    0.000 generic.py:3214(as_matrix)
        2    0.000    0.000    0.000    0.000 generic.py:3256(values)
        2    0.000    0.000    0.000    0.000 generic.py:327(<listcomp>)
      406    0.001    0.000    0.001    0.000 generic.py:342(_get_axis_number)
    30081    0.034    0.000    0.049    0.000 generic.py:355(_get_axis_name)
    29677    0.024    0.000    0.086    0.000 generic.py:368(_get_axis)
      401    0.001    0.000    0.002    0.000 generic.py:372(_get_block_manager_axis)
        2    0.000    0.000    0.000    0.000 generic.py:416(_info_axis)
     9625    0.008    0.000    0.015    0.000 generic.py:436(ndim)
        2    0.000    0.000    0.001    0.000 generic.py:496(transpose)
        2    0.000    0.000    0.000    0.000 generic.py:502(<listcomp>)
        2    0.000    0.000    0.000    0.000 generic.py:504(<listcomp>)
        2    0.000    0.000    0.000    0.000 generic.py:511(<listcomp>)
    35797    0.017    0.000    0.040    0.000 generic.py:7(_check)
     9624    0.039    0.000    0.337    0.000 indexing.py:1133(_convert_to_indexer)
     4812    0.014    0.000    0.423    0.000 indexing.py:144(_get_setitem_indexer)
     4812    0.032    0.000    1.863    0.000 indexing.py:173(__setitem__)
    14436    0.013    0.000    0.018    0.000 indexing.py:175(<genexpr>)
      400    0.000    0.000    0.001    0.000 indexing.py:1954(convert_missing_indexer)
     4812    0.009    0.000    0.029    0.000 indexing.py:2001(maybe_convert_ix)
      399    0.000    0.000    0.000    0.000 indexing.py:2017(is_nested_tuple)
      798    0.001    0.000    0.002    0.000 indexing.py:2031(is_list_like_indexer)
     4812    0.031    0.000    0.385    0.000 indexing.py:210(_convert_tuple)
     9624    0.021    0.000    0.148    0.000 indexing.py:232(_convert_scalar_indexer)
     4812    0.001    0.000    0.001    0.000 indexing.py:243(_has_valid_setitem_indexer)
     4812    0.143    0.000    1.388    0.000 indexing.py:273(_setitem_with_indexer)
     9624    0.008    0.000    0.011    0.000 indexing.py:599(<genexpr>)
        1    0.000    0.000    0.000    0.000 indexing.py:93(__init__)
    10461    0.005    0.000    0.014    0.000 inference.py:233(is_list_like)
     5214    0.013    0.000    0.023    0.000 internals.py:102(__init__)
      400    0.004    0.000    0.042    0.000 internals.py:1025(take_nd)
     4812    0.003    0.000    0.003    0.000 internals.py:125(is_view)
     9624    0.027    0.000    0.047    0.000 internals.py:1579(_can_hold_element)
    16042    0.004    0.000    0.004    0.000 internals.py:185(mgr_locs)
     4812    0.015    0.000    0.055    0.000 internals.py:196(make_block)
      400    0.001    0.000    0.005    0.000 internals.py:214(make_block_same_class)
     5214    0.003    0.000    0.004    0.000 internals.py:222(mgr_locs)
     5214    0.018    0.000    0.042    0.000 internals.py:2683(make_block)
     5217    0.022    0.000    0.403    0.000 internals.py:2779(__init__)
     5217    0.008    0.000    0.015    0.000 internals.py:2780(<listcomp>)
    10842    0.023    0.000    0.100    0.000 internals.py:2820(shape)
    32526    0.011    0.000    0.077    0.000 internals.py:2822(<genexpr>)
    15240    0.008    0.000    0.010    0.000 internals.py:2824(ndim)
     5217    0.105    0.000    0.315    0.000 internals.py:2876(_rebuild_blknos_and_blklocs)
      405    0.000    0.000    0.000    0.000 internals.py:2897(_get_items)
      402    0.000    0.000    0.000    0.000 internals.py:295(shape)
      405    0.002    0.000    0.011    0.000 internals.py:3001(_verify_integrity)
      807    0.001    0.000    0.001    0.000 internals.py:3003(<genexpr>)
     4812    0.054    0.000    0.630    0.000 internals.py:3013(apply)
    10426    0.003    0.000    0.003    0.000 internals.py:303(dtype)
     5214    0.013    0.000    0.015    0.000 internals.py:307(ftype)
     4812    0.001    0.000    0.001    0.000 internals.py:3072(<genexpr>)
     4812    0.012    0.000    0.642    0.000 internals.py:3202(setitem)
    20056    0.007    0.000    0.007    0.000 internals.py:3296(is_consolidated)
     5217    0.016    0.000    0.037    0.000 internals.py:3304(_consolidate_check)
     5217    0.005    0.000    0.020    0.000 internals.py:3305(<listcomp>)
     4812    0.006    0.000    0.011    0.000 internals.py:3309(is_mixed_type)
     4812    0.006    0.000    0.010    0.000 internals.py:3327(is_view)
        2    0.000    0.000    0.000    0.000 internals.py:3438(as_matrix)
     5214    0.003    0.000    0.005    0.000 internals.py:3560(consolidate)
    14842    0.009    0.000    0.014    0.000 internals.py:3576(_consolidate_inplace)
      401    0.003    0.000    0.093    0.000 internals.py:3860(reindex_indexer)
      401    0.001    0.000    0.043    0.000 internals.py:3895(<listcomp>)
        1    0.000    0.000    0.000    0.000 internals.py:3990(take)
        2    0.000    0.000    0.000    0.000 internals.py:4283(create_block_manager_from_blocks)
        2    0.000    0.000    0.000    0.000 internals.py:4306(create_block_manager_from_arrays)
        2    0.000    0.000    0.000    0.000 internals.py:4317(form_blocks)
     4812    0.006    0.000    0.009    0.000 internals.py:4557(_extend_blocks)
     4812    0.014    0.000    0.019    0.000 internals.py:554(_try_cast_result)
     4812    0.001    0.000    0.001    0.000 internals.py:591(_try_coerce_args)
     4812    0.001    0.000    0.001    0.000 internals.py:595(_try_coerce_result)
     4812    0.006    0.000    0.026    0.000 internals.py:599(_try_coerce_and_cast_result)
     4812    0.055    0.000    0.199    0.000 internals.py:672(setitem)
     9624    0.007    0.000    0.007    0.000 internals.py:694(<lambda>)
     4812    0.001    0.000    0.001    0.000 internals.py:718(_is_scalar_indexer)
     4812    0.003    0.000    0.003    0.000 internals.py:727(_is_empty_indexer)
       39    0.002    0.000    0.002    0.000 iostream.py:180(schedule)
       28    0.000    0.000    0.000    0.000 iostream.py:284(_is_master_process)
       28    0.000    0.000    0.000    0.000 iostream.py:297(_schedule_flush)
       28    0.000    0.000    0.002    0.000 iostream.py:342(write)
       39    0.000    0.000    0.000    0.000 iostream.py:87(_event_pipe)
        5    0.000    0.000    0.000    0.000 missing.py:119(_isnull_ndarraylike)
      402    0.001    0.000    0.002    0.000 missing.py:247(array_equivalent)
      404    0.001    0.000    0.003    0.000 missing.py:26(isnull)
      404    0.001    0.000    0.002    0.000 missing.py:47(_isnull_new)
      801    0.001    0.000    0.001    0.000 missing.py:579(clean_reindex_fill_method)
      801    0.000    0.000    0.000    0.000 missing.py:73(clean_fill_method)
    14508    0.012    0.000    0.103    0.000 mixins.py:114(_build)
    81716    0.114    0.000    0.392    0.000 mixins.py:137(_valid_name)
       20    0.000    0.000    0.000    0.000 mixins.py:162(_setattr)
    67208    0.052    0.000    0.378    0.000 mixins.py:169(__setattr__)
    14518    0.035    0.000    0.204    0.000 mixins.py:75(__getattr__)
        2    0.000    0.000    0.000    0.000 multi.py:1032(is_lexsorted)
        2    0.000    0.000    0.000    0.000 multi.py:1044(lexsort_depth)
        2    0.000    0.000    0.000    0.000 multi.py:1052(<listcomp>)
        2    0.000    0.000    0.004    0.002 multi.py:1059(from_arrays)
        2    0.000    0.000    0.004    0.002 multi.py:1107(from_tuples)
        2    0.000    0.000    0.001    0.000 multi.py:1194(_sort_levels_monotonic)
     9634    0.007    0.000    0.011    0.000 multi.py:1327(nlevels)
        2    0.000    0.000    0.000    0.000 multi.py:1335(__contains__)
        1    0.000    0.000    0.000    0.000 multi.py:1401(take)
        1    0.000    0.000    0.000    0.000 multi.py:1413(_assert_take_fillable)
        1    0.000    0.000    0.000    0.000 multi.py:1432(<listcomp>)
    14474    0.004    0.000    0.004    0.000 multi.py:156(_get_levels)
        3    0.000    0.000    0.000    0.000 multi.py:159(_set_levels)
        1    0.000    0.000    0.001    0.001 multi.py:1652(_get_labels_for_sorting)
        3    0.000    0.000    0.000    0.000 multi.py:1662(cats)
        1    0.000    0.000    0.001    0.001 multi.py:1666(<listcomp>)
       11    0.000    0.000    0.000    0.000 multi.py:173(<genexpr>)
     4814    0.037    0.000    0.082    0.000 multi.py:1946(get_loc)
     9624    0.005    0.000    0.005    0.000 multi.py:1990(_maybe_str_to_time_stamp)
        2    0.000    0.000    0.000    0.000 multi.py:2166(_get_level_indexer)
    16074    0.006    0.000    0.006    0.000 multi.py:265(_get_labels)
        3    0.000    0.000    0.000    0.000 multi.py:268(_set_labels)
       11    0.000    0.000    0.000    0.000 multi.py:278(<genexpr>)
    16059    0.028    0.000    0.070    0.000 multi.py:498(__len__)
        4    0.000    0.000    0.000    0.000 multi.py:501(_get_names)
        7    0.000    0.000    0.000    0.000 multi.py:502(<genexpr>)
        3    0.000    0.000    0.000    0.000 multi.py:504(_set_names)
        1    0.000    0.000    0.000    0.000 multi.py:601(inferred_type)
        1    0.000    0.000    0.000    0.000 multi.py:635(_engine)
        1    0.000    0.000    0.000    0.000 multi.py:646(<lambda>)
        1    0.000    0.000    0.000    0.000 multi.py:648(values)
        2    0.000    0.000    0.001    0.000 multi.py:684(is_monotonic)
        2    0.000    0.000    0.001    0.000 multi.py:692(is_monotonic_increasing)
        2    0.000    0.000    0.001    0.000 multi.py:700(<listcomp>)
        1    0.000    0.000    0.000    0.000 multi.py:718(is_unique)
        1    0.000    0.000    0.000    0.000 multi.py:773(duplicated)
        3    0.000    0.000    0.000    0.000 multi.py:80(__new__)
        6    0.000    0.000    0.001    0.000 multi.py:860(_get_level_values)
    10420    0.002    0.000    0.002    0.000 numeric.py:125(inferred_type)
     4811    0.015    0.000    0.059    0.000 numeric.py:134(_convert_scalar_indexer)
        3    0.000    0.000    0.000    0.000 numeric.py:148(_assert_safe_casting)
     3200    0.018    0.000    0.026    0.000 numeric.py:1489(normalize_axis_tuple)
     4400    0.009    0.000    0.049    0.000 numeric.py:150(ones)
     6400    0.003    0.000    0.006    0.000 numeric.py:1536(<genexpr>)
     1600    0.020    0.000    0.057    0.000 numeric.py:1545(moveaxis)
     1600    0.002    0.000    0.002    0.000 numeric.py:1607(<listcomp>)
      804    0.004    0.000    0.014    0.000 numeric.py:30(__new__)
     1648    0.001    0.000    0.010    0.000 numeric.py:463(asarray)
     8803    0.005    0.000    0.011    0.000 numeric.py:534(asanyarray)
     6400    0.108    0.000    3.288    0.001 process.py:141(__call__)
     3200    0.006    0.000    0.011    0.000 process.py:28(__eq__)
    32800    0.077    0.000    0.176    0.000 quantity.py:1037(__eq__)
     8800    0.017    0.000    0.039    0.000 quantity.py:1062(compare)
     3200    0.005    0.000    0.018    0.000 quantity.py:1077(<lambda>)
     5600    0.007    0.000    0.032    0.000 quantity.py:1080(<lambda>)
    10000    0.017    0.000    0.049    0.000 quantity.py:1195(T)
     3200    0.014    0.000    0.058    0.000 quantity.py:1227(__numpy_method_wrap)
     6400    0.013    0.000    0.018    0.000 quantity.py:1250(__iter__)
    32000    0.046    0.000    0.127    0.000 quantity.py:1253(<genexpr>)
     3200    0.019    0.000    0.024    0.000 quantity.py:1255(__getattr__)
     8800    0.021    0.000    0.061    0.000 quantity.py:1279(__getitem__)
      400    0.003    0.000    0.004    0.000 quantity.py:1287(__setitem__)
       31    0.000    0.000    0.002    0.000 quantity.py:133(__deepcopy__)
        2    0.000    0.000    0.000    0.000 quantity.py:145(__format__)
   227835    0.360    0.000    1.458    0.000 quantity.py:1476(_get_non_multiplicative_units)
   227835    0.406    0.000    0.886    0.000 quantity.py:1479(<listcomp>)
     1200    0.003    0.000    0.007    0.000 quantity.py:1483(_get_delta_units)
     1200    0.002    0.000    0.004    0.000 quantity.py:1486(<listcomp>)
   170819    0.056    0.000    0.056    0.000 quantity.py:1502(_ok_for_muldiv)
    98417    0.024    0.000    0.024    0.000 quantity.py:220(magnitude)
    36803    0.036    0.000    0.094    0.000 quantity.py:240(units)
        1    0.000    0.000    0.000    0.000 quantity.py:262(dimensionless)
   149822    0.130    0.000    1.129    0.000 quantity.py:272(dimensionality)
    64415    0.072    0.000    2.185    0.000 quantity.py:295(_convert_magnitude_not_inplace)
     1200    0.005    0.000    0.137    0.000 quantity.py:324(to)
    65600    0.027    0.000    0.039    0.000 quantity.py:33(_eq)
        1    0.000    0.000    0.000    0.000 quantity.py:347(to_root_units)
    63213    0.164    0.000    2.820    0.000 quantity.py:367(to_base_units)
        1    0.000    0.000    0.000    0.000 quantity.py:448(__float__)
   130809    0.201    0.000    6.253    0.000 quantity.py:49(wrapped)
    28508    0.207    0.000    1.777    0.000 quantity.py:556(_add_sub)
     4400    0.011    0.000    0.438    0.000 quantity.py:657(__iadd__)
    17600    0.029    0.000    1.003    0.000 quantity.py:665(__add__)
     6508    0.008    0.000    0.392    0.000 quantity.py:679(__sub__)
   130809    0.841    0.000    6.052    0.000 quantity.py:746(_mul_div)
   102799    0.117    0.000    5.004    0.000 quantity.py:813(__mul__)
    28010    0.033    0.000    1.399    0.000 quantity.py:824(__truediv__)
   331649    0.569    0.000    1.222    0.000 quantity.py:85(__new__)
    81716    0.062    0.000    0.203    0.000 re.py:169(match)
    81716    0.057    0.000    0.057    0.000 re.py:286(_compile)
    20402    0.062    0.000    1.715    0.000 registry.py:1182(_convert)
    63213    0.203    0.000    0.363    0.000 registry.py:1374(_get_base_units)
    98290    0.119    0.000    1.167    0.000 registry.py:200(__getattr__)
   141723    0.388    0.000    1.636    0.000 registry.py:522(_get_dimensionality)
    20403    0.058    0.000    0.115    0.000 registry.py:580(_get_root_units)
    64415    0.115    0.000    2.113    0.000 registry.py:668(convert)
    20402    0.162    0.000    1.204    0.000 registry.py:688(_convert)
    98290    0.123    0.000    0.471    0.000 registry.py:754(parse_units)
    98290    0.058    0.000    0.058    0.000 registry.py:770(_parse_units)
    98290    0.147    0.000    0.205    0.000 registry.py:871(_parse_units)
    81604    0.062    0.000    0.083    0.000 registry.py:899(_is_multiplicative)
    20402    0.095    0.000    1.629    0.000 registry.py:913(_convert)
    20402    0.050    0.000    0.197    0.000 registry.py:931(<listcomp>)
    20402    0.026    0.000    0.098    0.000 registry.py:933(<listcomp>)
     1600    0.014    0.000    0.047    0.000 shape_base.py:296(stack)
     1600    0.004    0.000    0.009    0.000 shape_base.py:348(<listcomp>)
     8000    0.003    0.000    0.003    0.000 shape_base.py:352(<genexpr>)
     1600    0.004    0.000    0.004    0.000 shape_base.py:360(<listcomp>)
        1    0.000    0.000    0.009    0.009 solution.py:121(__init__)
        1    0.000    0.000    0.008    0.008 solution.py:136(setup_solution_dataframe)
        1    0.000    0.000    0.000    0.000 solution.py:139(<listcomp>)
      400    0.014    0.000    0.717    0.002 solver.py:169(_calculate_mass_flows)
      400    0.022    0.000   17.166    0.043 solver.py:227(_calculate_changes_of_all_variables)
      400    0.004    0.000    0.461    0.001 solver.py:246(<listcomp>)
      400    0.008    0.000   16.170    0.040 solver.py:250(<listcomp>)
     1600    0.062    0.000    5.942    0.004 solver.py:281(_get_sink_source_flow)
     1600    0.059    0.000    2.305    0.001 solver.py:300(_get_sink_source_flux)
     1600    0.029    0.000    1.385    0.001 solver.py:320(_get_sink_source_process)
     1600    0.076    0.000    5.733    0.004 solver.py:332(_get_sink_source_reaction)
     1600    0.042    0.000   16.162    0.010 solver.py:364(_get_dvar)
        1    0.000    0.000    0.000    0.000 solver.py:54(__init__)
        1    0.078    0.078   20.696   20.696 solver.py:57(solve)
        1    0.000    0.000    0.001    0.001 sorting.py:171(indexer_from_factorized)
        1    0.000    0.000    0.001    0.001 sorting.py:183(lexsort_indexer)
        2    0.000    0.000    0.000    0.000 sorting.py:19(get_group_index)
        1    0.000    0.000    0.000    0.000 sorting.py:313(get_group_index_sorter)
        1    0.000    0.000    0.000    0.000 sorting.py:340(compress_group_index)
        1    0.000    0.000    0.000    0.000 sorting.py:361(_reorder_by_uniques)
        2    0.000    0.000    0.000    0.000 sorting.py:46(_int64_cut_off)
        2    0.000    0.000    0.000    0.000 sorting.py:54(loop)
        5    0.000    0.000    0.000    0.000 sorting.py:87(maybe_lift)
    48394    0.044    0.000    0.097    0.000 system.py:183(box_list)
    48394    0.053    0.000    0.053    0.000 system.py:185(<listcomp>)
     8002    0.009    0.000    0.026    0.000 system.py:187(variable_list)
     8002    0.017    0.000    0.017    0.000 system.py:189(<listcomp>)
    48000    0.023    0.000    0.033    0.000 system.py:192(N_boxes)
     5200    0.005    0.000    0.006    0.000 system.py:196(N_variables)
    44793    0.089    0.000    0.211    0.000 system.py:200(pint_ur)
     4800    0.037    0.000    0.583    0.000 system.py:211(get_variable_mobility_bool_1Darray)
     4800    0.040    0.000    0.640    0.000 system.py:218(get_variable_mobility_numeric_1Darray)
      802    0.002    0.000    0.125    0.000 system.py:231(get_box_volume)
      400    0.010    0.000    0.126    0.000 system.py:240(get_fluid_mass_1Darray)
     1600    0.036    0.000    0.457    0.000 system.py:255(get_variable_mass_1Darray)
     4800    0.162    0.000    1.546    0.000 system.py:276(get_variable_concentration_1Darray)
     4800    0.025    0.000    2.400    0.000 system.py:301(get_variable_flow_concentration_1Darray)
      400    0.011    0.000    0.109    0.000 system.py:325(get_fluid_mass_internal_flow_2Darray)
     3600    0.080    0.000    0.924    0.000 system.py:359(get_fluid_mass_flow_sink_1Darray)
      400    0.009    0.000    0.099    0.000 system.py:389(get_fluid_mass_flow_source_1Darray)
     1600    0.052    0.000    1.537    0.001 system.py:426(get_variable_internal_flow_2Darray)
     1600    0.002    0.000    0.002    0.000 system.py:450(<listcomp>)
     3200    0.029    0.000    2.729    0.001 system.py:476(get_variable_flow_sink_1Darray)
     3200    0.002    0.000    0.002    0.000 system.py:502(<listcomp>)
     1600    0.031    0.000    0.330    0.000 system.py:511(get_variable_flow_source_1Darray)
     1600    0.010    0.000    0.029    0.000 system.py:538(<listcomp>)
     1600    0.023    0.000    0.227    0.000 system.py:558(get_variable_internal_flux_2Darray)
     1600    0.001    0.000    0.001    0.000 system.py:579(<listcomp>)
     3200    0.044    0.000    0.437    0.000 system.py:595(get_variable_flux_sink_1Darray)
     3200    0.001    0.000    0.001    0.000 system.py:613(<listcomp>)
     1600    0.022    0.000    0.216    0.000 system.py:627(get_variable_flux_source_1Darray)
     1600    0.000    0.000    0.000    0.000 system.py:645(<listcomp>)
     3200    0.096    0.000    0.517    0.000 system.py:662(get_variable_process_sink_1Darray)
     3200    0.001    0.000    0.001    0.000 system.py:681(<listcomp>)
     3200    0.001    0.000    0.001    0.000 system.py:682(<listcomp>)
     6400    0.001    0.000    0.001    0.000 system.py:686(<listcomp>)
     6400    0.001    0.000    0.001    0.000 system.py:688(<listcomp>)
     6400    0.001    0.000    0.001    0.000 system.py:693(<listcomp>)
     1600    0.044    0.000    0.246    0.000 system.py:704(get_variable_process_source_1Darray)
     1600    0.000    0.000    0.000    0.000 system.py:722(<listcomp>)
     1600    0.000    0.000    0.000    0.000 system.py:723(<listcomp>)
     3200    0.001    0.000    0.001    0.000 system.py:727(<listcomp>)
     3200    0.001    0.000    0.001    0.000 system.py:729(<listcomp>)
     3200    0.001    0.000    0.001    0.000 system.py:734(<listcomp>)
     3200    0.127    0.000    4.362    0.001 system.py:748(get_reaction_rate_2Darray)
     6400    0.028    0.000    0.160    0.000 system.py:756(<listcomp>)
     1600    0.056    0.000    4.736    0.003 system.py:762(get_reaction_rate_3Darray)
        1    0.000    0.000   20.696   20.696 system.py:818(solve)
       39    0.000    0.000    0.000    0.000 threading.py:1062(_wait_for_tstate_lock)
       39    0.000    0.000    0.000    0.000 threading.py:1104(is_alive)
       39    0.000    0.000    0.000    0.000 threading.py:506(is_set)
     3600    0.001    0.000    0.001    0.000 transport.py:107(<listcomp>)
    10000    0.009    0.000    0.016    0.000 transport.py:115(get_all_to)
    10000    0.007    0.000    0.007    0.000 transport.py:126(<listcomp>)
     6400    0.009    0.000    0.018    0.000 transport.py:88(__call__)
     6800    0.002    0.000    0.002    0.000 transport.py:92(context)
     3600    0.004    0.000    0.005    0.000 transport.py:96(get_all_from)
    54410    0.085    0.000    0.273    0.000 unit.py:127(dimensionality)
    60287    0.178    0.000    3.071    0.000 unit.py:147(__mul__)
    26801    0.075    0.000    0.673    0.000 unit.py:162(__truediv__)
    26400    0.015    0.000    0.020    0.000 unit.py:193(__hash__)
    11600    0.017    0.000    0.038    0.000 unit.py:196(__eq__)
260192/161902    0.390    0.000    1.145    0.000 unit.py:40(__new__)
        8    0.000    0.000    0.001    0.000 unit.py:65(__deepcopy__)
        2    0.000    0.000    0.000    0.000 unit.py:76(__format__)
    64805    0.011    0.000    0.011    0.000 util.py:237(__missing__)
   291214    0.898    0.000    1.686    0.000 util.py:251(__init__)
   447853    0.176    0.000    0.275    0.000 util.py:291(__iter__)
   162133    0.063    0.000    0.093    0.000 util.py:294(__len__)
   177221    0.074    0.000    0.074    0.000 util.py:297(__getitem__)
   432274    0.078    0.000    0.078    0.000 util.py:303(__hash__)
       23    0.000    0.000    0.000    0.000 util.py:306(__getstate__)
       23    0.000    0.000    0.000    0.000 util.py:309(__setstate__)
   628110    0.532    0.000    0.625    0.000 util.py:313(__eq__)
        2    0.000    0.000    0.000    0.000 util.py:330(__format__)
   102799    0.478    0.000    1.602    0.000 util.py:339(__mul__)
   102799    0.056    0.000    0.056    0.000 util.py:346(<listcomp>)
    75213    0.449    0.000    1.368    0.000 util.py:363(__truediv__)
    75213    0.051    0.000    0.051    0.000 util.py:373(<listcomp>)
   120232    0.210    0.000    0.953    0.000 util.py:476(__eq__)
   258005    0.198    0.000    0.390    0.000 util.py:608(_check)
   130030    0.102    0.000    0.225    0.000 util.py:627(to_units_container)
     7200    0.076    0.000    0.893    0.000 utils.py:27(dot)
     1600    0.037    0.000    0.420    0.000 utils.py:53(stack)
    27205    0.054    0.000    0.704    0.000 validation.py:100(raise_if_not)
    27205    0.029    0.000    0.294    0.000 validation.py:108(<listcomp>)
     4000    0.011    0.000    0.249    0.000 validation.py:119(raise_if_not_mass)
     8000    0.048    0.000    0.617    0.000 validation.py:144(raise_if_not_mass_per_time)
    11200    0.035    0.000    0.393    0.000 validation.py:154(raise_if_not_dimless)
    27200    0.068    0.000    0.136    0.000 validation.py:161(get_single_shared_unit)
    27205    0.053    0.000    0.355    0.000 validation.py:32(is_quantity_of_dimensionality)
   592764    0.143    0.000    0.143    0.000 {built-in method __new__ of type object at 0x7f927ae72c80}
    22000    0.037    0.000    0.037    0.000 {built-in method _operator.add}
     5600    0.004    0.000    0.004    0.000 {built-in method _operator.gt}
     3201    0.001    0.000    0.001    0.000 {built-in method _operator.index}
     3200    0.002    0.000    0.002    0.000 {built-in method _operator.lt}
   205598    0.613    0.000    2.215    0.000 {built-in method _operator.mul}
     6508    0.012    0.000    0.012    0.000 {built-in method _operator.sub}
    56020    0.091    0.000    0.535    0.000 {built-in method _operator.truediv}
     4812    0.002    0.000    0.011    0.000 {built-in method builtins.all}
    20405    0.009    0.000    0.009    0.000 {built-in method builtins.any}
    22424    0.005    0.000    0.005    0.000 {built-in method builtins.callable}
        1    0.000    0.000   20.696   20.696 {built-in method builtins.exec}
      6/4    0.000    0.000    0.000    0.000 {built-in method builtins.format}
843031/843029    0.380    0.000    0.398    0.000 {built-in method builtins.getattr}
   128644    0.085    0.000    0.085    0.000 {built-in method builtins.hasattr}
   312422    0.076    0.000    0.076    0.000 {built-in method builtins.hash}
     1343    0.000    0.000    0.000    0.000 {built-in method builtins.id}
  4956334    1.338    0.000    2.644    0.000 {built-in method builtins.isinstance}
    17617    0.005    0.000    0.005    0.000 {built-in method builtins.issubclass}
   461483    0.104    0.000    0.104    0.000 {built-in method builtins.iter}
824542/791584    0.158    0.000    0.234    0.000 {built-in method builtins.len}
    12825    0.013    0.000    0.031    0.000 {built-in method builtins.min}
       14    0.000    0.000    0.002    0.000 {built-in method builtins.print}
    71212    0.069    0.000    0.447    0.000 {built-in method builtins.setattr}
     2004    0.006    0.000    0.006    0.000 {built-in method builtins.sorted}
    19605    0.006    0.000    0.006    0.000 {built-in method builtins.sum}
        1    0.000    0.000    0.000    0.000 {built-in method math.ceil}
      400    0.000    0.000    0.000    0.000 {built-in method math.isnan}
     5226    0.021    0.000    0.021    0.000 {built-in method numpy.core.multiarray.arange}
    22076    0.059    0.000    0.060    0.000 {built-in method numpy.core.multiarray.array}
     2000    0.019    0.000    0.019    0.000 {built-in method numpy.core.multiarray.concatenate}
     4400    0.022    0.000    0.022    0.000 {built-in method numpy.core.multiarray.copyto}
     7200    0.034    0.000    0.034    0.000 {built-in method numpy.core.multiarray.dot}
    15257    0.053    0.000    0.053    0.000 {built-in method numpy.core.multiarray.empty}
        2    0.000    0.000    0.000    0.000 {built-in method numpy.core.multiarray.lexsort}
     4800    0.004    0.000    0.004    0.000 {built-in method numpy.core.multiarray.normalize_axis_index}
        6    0.000    0.000    0.000    0.000 {built-in method numpy.core.multiarray.putmask}
        1    0.000    0.000    0.000    0.000 {built-in method numpy.core.multiarray.result_type}
        3    0.000    0.000    0.000    0.000 {built-in method numpy.core.multiarray.where}
    40000    0.091    0.000    0.091    0.000 {built-in method numpy.core.multiarray.zeros}
      818    0.001    0.000    0.001    0.000 {built-in method pandas._libs.algos.ensure_int64}
       16    0.000    0.000    0.000    0.000 {built-in method pandas._libs.algos.ensure_int8}
       21    0.000    0.000    0.000    0.000 {built-in method pandas._libs.algos.ensure_object}
      417    0.000    0.000    0.000    0.000 {built-in method pandas._libs.algos.ensure_platform_int}
        2    0.000    0.000    0.000    0.000 {built-in method pandas._libs.lib.array_equivalent_object}
      399    0.000    0.000    0.000    0.000 {built-in method pandas._libs.lib.checknull}
        5    0.000    0.000    0.000    0.000 {built-in method pandas._libs.lib.infer_datetimelike_array}
       31    0.000    0.000    0.000    0.000 {built-in method pandas._libs.lib.is_bool}
        2    0.000    0.000    0.000    0.000 {built-in method pandas._libs.lib.is_datetime_array}
    10835    0.003    0.000    0.003    0.000 {built-in method pandas._libs.lib.is_float}
    24477    0.004    0.000    0.004    0.000 {built-in method pandas._libs.lib.is_integer}
      818    0.001    0.000    0.001    0.000 {built-in method pandas._libs.lib.isscalar}
      402    0.006    0.000    0.006    0.000 {built-in method pandas._libs.lib.list_to_object_array}
       28    0.000    0.000    0.000    0.000 {built-in method posix.getpid}
       39    0.000    0.000    0.000    0.000 {built-in method posix.urandom}
        2    0.000    0.000    0.000    0.000 {built-in method time.time}
    16083    0.003    0.000    0.003    0.000 {function FrozenList.__getitem__ at 0x7f9249d27950}
       90    0.000    0.000    0.000    0.000 {method '__reduce_ex__' of 'object' objects}
       39    0.000    0.000    0.000    0.000 {method 'acquire' of '_thread.lock' objects}
        1    0.000    0.000    0.000    0.000 {method 'all' of 'numpy.ndarray' objects}
     7631    0.011    0.000    0.080    0.000 {method 'any' of 'numpy.ndarray' objects}
    82747    0.015    0.000    0.015    0.000 {method 'append' of 'list' objects}
        6    0.000    0.000    0.000    0.000 {method 'argsort' of 'numpy.ndarray' objects}
       11    0.000    0.000    0.000    0.000 {method 'astype' of 'numpy.ndarray' objects}
     5212    0.002    0.000    0.002    0.000 {method 'clear' of 'dict' objects}
     3200    0.022    0.000    0.022    0.000 {method 'clip' of 'numpy.ndarray' objects}
       10    0.000    0.000    0.000    0.000 {method 'copy' of 'dict' objects}
        3    0.000    0.000    0.000    0.000 {method 'copy' of 'numpy.ndarray' objects}
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
    10434    0.010    0.000    0.010    0.000 {method 'fill' of 'numpy.ndarray' objects}
    25/23    0.000    0.000    0.000    0.000 {method 'format' of 'str' objects}
    32768    0.009    0.000    0.009    0.000 {method 'get' of 'dict' objects}
      400    0.009    0.000    0.012    0.000 {method 'get_indexer' of 'pandas._libs.index.IndexEngine' objects}
        5    0.000    0.000    0.000    0.000 {method 'get_labels' of 'pandas._libs.hashtable.StringHashTable' objects}
        1    0.000    0.000    0.000    0.000 {method 'get_labels_groupby' of 'pandas._libs.hashtable.Int64HashTable' objects}
     6414    0.029    0.000    0.030    0.000 {method 'get_loc' of 'pandas._libs.index.IndexEngine' objects}
     4812    0.019    0.000    0.019    0.000 {method 'get_loc' of 'pandas._libs.index.MultiIndexObjectEngine' objects}
     1600    0.001    0.000    0.001    0.000 {method 'insert' of 'list' objects}
   794947    0.117    0.000    0.117    0.000 {method 'items' of 'dict' objects}
        2    0.000    0.000    0.000    0.000 {method 'join' of 'str' objects}
     5202    0.001    0.000    0.001    0.000 {method 'keys' of 'dict' objects}
    81716    0.084    0.000    0.084    0.000 {method 'match' of '_sre.SRE_Pattern' objects}
        6    0.000    0.000    0.000    0.000 {method 'max' of 'numpy.ndarray' objects}
        3    0.000    0.000    0.000    0.000 {method 'min' of 'numpy.ndarray' objects}
   130030    0.123    0.000    0.123    0.000 {method 'mro' of 'type' objects}
        6    0.000    0.000    0.000    0.000 {method 'pop' of 'dict' objects}
        4    0.000    0.000    0.000    0.000 {method 'pop' of 'list' objects}
    14800    0.003    0.000    0.003    0.000 {method 'pop' of 'set' objects}
        6    0.000    0.000    0.000    0.000 {method 'put' of 'numpy.ndarray' objects}
        9    0.000    0.000    0.000    0.000 {method 'ravel' of 'numpy.ndarray' objects}
    10843    0.090    0.000    0.090    0.000 {method 'reduce' of 'numpy.ufunc' objects}
       12    0.000    0.000    0.000    0.000 {method 'replace' of 'str' objects}
        5    0.000    0.000    0.000    0.000 {method 'reshape' of 'numpy.ndarray' objects}
     2022    0.001    0.000    0.001    0.000 {method 'rpartition' of 'str' objects}
        9    0.000    0.000    0.000    0.000 {method 'search' of '_sre.SRE_Pattern' objects}
     4420    0.003    0.000    0.003    0.000 {method 'startswith' of 'str' objects}
        2    0.000    0.000    0.000    0.000 {method 'strip' of 'str' objects}
     3200    0.004    0.000    0.032    0.000 {method 'sum' of 'numpy.ndarray' objects}
       13    0.000    0.000    0.000    0.000 {method 'take' of 'numpy.ndarray' objects}
        5    0.000    0.000    0.000    0.000 {method 'to_array' of 'pandas._libs.hashtable.ObjectVector' objects}
     1602    0.003    0.000    0.003    0.000 {method 'transpose' of 'numpy.ndarray' objects}
      462    0.000    0.000    0.000    0.000 {method 'update' of 'dict' objects}
     2482    0.002    0.000    0.002    0.000 {method 'view' of 'numpy.ndarray' objects}
        1    0.000    0.000    0.000    0.000 {pandas._libs.algos.groupsort_indexer}
        2    0.000    0.000    0.000    0.000 {pandas._libs.algos.take_1d_int64_int64}
        8    0.000    0.000    0.000    0.000 {pandas._libs.algos.take_1d_object_object}
      400    0.008    0.000    0.008    0.000 {pandas._libs.algos.take_2d_axis0_float64_float64}
        1    0.000    0.000    0.000    0.000 {pandas._libs.hashtable.duplicated_int64}
        1    0.000    0.000    0.000    0.000 {pandas._libs.lib.fast_zip}
      421    0.006    0.000    0.006    0.000 {pandas._libs.lib.infer_dtype}
        2    0.000    0.000    0.000    0.000 {pandas._libs.lib.is_lexsorted}
        5    0.000    0.000    0.000    0.000 {pandas._libs.lib.isnullobj}
        2    0.000    0.000    0.000    0.000 {pandas._libs.lib.to_object_array_tuples}
     5616    0.008    0.000    0.010    0.000 {pandas._libs.lib.values_from_object}


Out[10]:
<pstats.Stats at 0x7f9242eaae10>

In [11]:
p.sort_stats('cumulative').print_stats(20)


Thu Oct  5 13:22:24 2017    restats

         23315352 function calls (23182612 primitive calls) in 20.696 seconds

   Ordered by: cumulative time
   List reduced from 623 to 20 due to restriction <20>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000   20.696   20.696 {built-in method builtins.exec}
        1    0.000    0.000   20.696   20.696 <string>:1(<module>)
        1    0.000    0.000   20.696   20.696 system.py:818(solve)
        1    0.078    0.078   20.696   20.696 solver.py:57(solve)
      400    0.022    0.000   17.166    0.043 solver.py:227(_calculate_changes_of_all_variables)
      400    0.008    0.000   16.170    0.040 solver.py:250(<listcomp>)
     1600    0.042    0.000   16.162    0.010 solver.py:364(_get_dvar)
   130809    0.201    0.000    6.253    0.000 quantity.py:49(wrapped)
   130809    0.841    0.000    6.052    0.000 quantity.py:746(_mul_div)
     1600    0.062    0.000    5.942    0.004 solver.py:281(_get_sink_source_flow)
     1600    0.076    0.000    5.733    0.004 solver.py:332(_get_sink_source_reaction)
   102799    0.117    0.000    5.004    0.000 quantity.py:813(__mul__)
     1600    0.056    0.000    4.736    0.003 system.py:762(get_reaction_rate_3Darray)
     3200    0.127    0.000    4.362    0.001 system.py:748(get_reaction_rate_2Darray)
     6400    0.108    0.000    3.288    0.001 process.py:141(__call__)
    60287    0.178    0.000    3.071    0.000 unit.py:147(__mul__)
    63213    0.164    0.000    2.820    0.000 quantity.py:367(to_base_units)
     3200    0.029    0.000    2.729    0.001 system.py:476(get_variable_flow_sink_1Darray)
  4956334    1.338    0.000    2.644    0.000 {built-in method builtins.isinstance}
     4800    0.025    0.000    2.400    0.000 system.py:301(get_variable_flow_concentration_1Darray)


Out[11]:
<pstats.Stats at 0x7f9242eaae10>

In [12]:
p.sort_stats('time').print_stats(10)


Thu Oct  5 13:22:24 2017    restats

         23315352 function calls (23182612 primitive calls) in 20.696 seconds

   Ordered by: internal time
   List reduced from 623 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  4956334    1.338    0.000    2.644    0.000 {built-in method builtins.isinstance}
   291214    0.898    0.000    1.686    0.000 util.py:251(__init__)
   130809    0.841    0.000    6.052    0.000 quantity.py:746(_mul_div)
   750873    0.731    0.000    1.266    0.000 abc.py:178(__instancecheck__)
   205598    0.613    0.000    2.215    0.000 {built-in method _operator.mul}
   331649    0.569    0.000    1.222    0.000 quantity.py:85(__new__)
  1181445    0.535    0.000    0.535    0.000 _weakrefset.py:70(__contains__)
   628110    0.532    0.000    0.625    0.000 util.py:313(__eq__)
   102799    0.478    0.000    1.602    0.000 util.py:339(__mul__)
    75213    0.449    0.000    1.368    0.000 util.py:363(__truediv__)


Out[12]:
<pstats.Stats at 0x7f9242eaae10>

In [13]:
%time
sol = system.solve(200*ur.month, 1*ur.month)


CPU times: user 4 µs, sys: 0 ns, total: 4 µs
Wall time: 7.87 µs
Start solving the BoxModelSystem...
- total integration time: 200 month
- dt (time step): 1 month
- number of time steps: 200
10.0%
20.0%
30.0%
40.0%
50.0%
60.0%
70.0%
80.0%
90.0%
Function "solve(...)" used 6.052s

In [14]:
sol.df['box1', 'A']


Out[14]:
Timestep
0      8.158333e-01
1      6.655840e-01
2      5.430056e-01
3      4.430021e-01
4      3.614159e-01
5      2.948551e-01
6      2.405526e-01
7      1.962509e-01
8      1.601080e-01
9      1.306214e-01
10     1.065653e-01
11     8.693954e-02
12     7.092818e-02
13     5.786557e-02
14     4.720866e-02
15     3.851440e-02
16     3.142133e-02
17     2.563457e-02
18     2.091354e-02
19     1.706196e-02
20     1.391972e-02
21     1.135617e-02
22     9.264740e-03
23     7.558484e-03
24     6.166463e-03
25     5.030806e-03
26     4.104299e-03
27     3.348424e-03
28     2.731756e-03
29     2.228658e-03
           ...     
170    7.653273e-16
171    6.243795e-16
172    5.093896e-16
173    4.155771e-16
174    3.390416e-16
175    2.766015e-16
176    2.256607e-16
177    1.841015e-16
178    1.501961e-16
179    1.225350e-16
180    9.996816e-17
181    8.155735e-17
182    6.653721e-17
183    5.428327e-17
184    4.428610e-17
185    3.613008e-17
186    2.947612e-17
187    2.404760e-17
188    1.961884e-17
189    1.600570e-17
190    1.305798e-17
191    1.065314e-17
192    8.691186e-18
193    7.090559e-18
194    5.784714e-18
195    4.719363e-18
196    3.850214e-18
197    3.141133e-18
198    2.562641e-18
199    2.090688e-18
Name: (box1, A), Length: 200, dtype: float64

In [15]:
sol.plot_variable_mass_of_all_boxes(system.variables.A, yaxis_log=False)


Out[15]:
(<matplotlib.figure.Figure at 0x7f9242dcba20>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7f9242e02e10>)

In [16]:
sol.plot_variable_mass_of_all_boxes(system.variables.B, yaxis_log=False)


Out[16]:
(<matplotlib.figure.Figure at 0x7f9242c9e630>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7f9242e08908>)

In [17]:
sol.plot_variable_mass_of_all_boxes(system.variables.C, yaxis_log=False)


Out[17]:
(<matplotlib.figure.Figure at 0x7f9240b9a1d0>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7f9240bcf5c0>)

In [18]:
sol.plot_variable_mass_of_all_boxes(system.variables.D, yaxis_log=False)


Out[18]:
(<matplotlib.figure.Figure at 0x7f9240abfc88>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7f9240b15a20>)

In [ ]:


In [19]:
system.save_as_svg('system3.svg')


corners [(330.0, 0.0), (630.0, 0.0), (630.0, 300.0), (330.0, 300.0)]
corners [(330.0, 0.0), (630.0, 0.0), (630.0, 300.0), (330.0, 300.0)]
corners [(-330.0, 4.0413344371862656e-14), (-30.0, 4.0413344371862656e-14), (-30.0, 300.00000000000006), (-330.0, 300.00000000000006)]
corners [(-330.0, 4.0413344371862656e-14), (-30.0, 4.0413344371862656e-14), (-30.0, 300.00000000000006), (-330.0, 300.00000000000006)]

In [20]:
SVG('system3.svg')


Out[20]:
Box 1Fluid: waterMass: 1.000e+05 kilogramProcessesReactionsReaction1Reaction2Box 2Fluid: waterMass: 1.000e+05 kilogramProcessesReactionsReaction1Reaction2

In [ ]:


In [28]:
from boxsimu import descriptors as bs_descriptors
from attrdict import AttrDict

class A:
    ad = bs_descriptors.AttrDictDescriptor('ad', [int], [str])

In [30]:
a = A()
a.ad = AttrDict({1: '3'})
a.ad = AttrDict({'3': 1})


---------------------------------------------------------------------------
DictKeyNotInstanceOfError                 Traceback (most recent call last)
<ipython-input-30-f899bb7b0c2e> in <module>()
      1 a = A()
      2 a.ad = AttrDict({1: '3'})
----> 3 a.ad = AttrDict({'3': 1})

~/Documents/MyPrivateRepo/boxsimu_project/boxsimu/descriptors.py in __set__(self, instance, value)
    127         if value is None:
    128             return
--> 129         value = self._check_key_value_types(value)
    130         setattr(instance, self.name, value)
    131 

~/Documents/MyPrivateRepo/boxsimu_project/boxsimu/descriptors.py in _check_key_value_types(self, value)
    138             if not any(key_isinstance_list):
    139                 raise bs_errors.DictKeyNotInstanceOfError(
--> 140                     self.name_raw, self.key_classes)
    141             value_isinstance_list = [isinstance(v, i) 
    142                     for i in self.value_classes]

DictKeyNotInstanceOfError: The keys of the dict "ad" must be instances of a class in: [[<class 'int'>]]

In [8]:
reaction1 = system.boxes.box1.reactions[0]
reaction1.name


Out[8]:
'Reaction1'

In [9]:
system.boxes.box1.reactions[0].name


Out[9]:
'Reaction1'

In [10]:
system.boxes.box1.reactions[0].get_reaction_text()


Out[10]:
'3A + 5B -> 2C'

In [11]:
new_reaction = system.boxes.box1.reactions[0].get_reverse_reaction('new_reaction')
new_reaction.get_reaction_text()


Out[11]:
'2C -> 3A + 5B'

In [ ]: