ecell / ecell4

An integrated software environment for multi-algorithm, multi-timescale, multi-spatial-representation simulation of various cellular phenomena
https://ecell4.e-cell.org/
GNU General Public License v3.0
17 stars 9 forks source link

Result object for run_simulation #11

Closed kaizu closed 4 years ago

kaizu commented 5 years ago

See also https://github.com/ecell/ecell4-base/issues/76

This issue proposes a new result type for run_simulation. It would work as follows:

ret = run_simulation(10, return_type='full')
ret.plot()  # => show some plot
print(ret.as_array())  # => return an array
print(ret.as_pandas())  # => return a data frame
w = ret.world()
w.add_molecules(Species('X'), 100)  # => operate the last state
run_simulation(10, world=w)  # => continue running
kaizu commented 4 years ago

The following code works now:

session = Session(model=m, y0=y0)
ret = session.run(10)
# ret = run_simulation(10, model=m, y0=y0)

ret.plot()
print(ret.as_array())
print(ret.as_df())
w = ret.world()

See also #41