febid.Statistics.Statistics#

class Statistics(filename='run_id502252')[source]#

Bases: object

Class implementing statistics gathering and saving(to excel).

Report contains following columns:

Time, Time passed, Simulation time, Simulation speed, N of cells(filled), Volume, Min.precursor coverage, Growth rate

It is possible to automatically include graphs into Excel files Additionally, initial simulation parameters are added to 3 separate sheets

Methods

add_plot

add_plots

Add scatter plots to the Excel-file.

add_stat

Add a new statistic to the table.

append

Add a new record to the statistics.

get_growth_rate

get_params

Collect initial parameters and save them to Excel-file

plot

['Time', 'Sim.time', 'Sim.speed', 'Volume', Min.precursor coverage', 'Growth rate'] :type x: :param x: :type y: :param y: :return:

save_to_file

Write collected statistics to an Excel file.

Attributes

shape

add_plots(*args, position='J1')[source]#

Add scatter plots to the Excel-file.

Args is a list of tuples of column names to be plotted: [(x1, y1), (x2, y2)] Position is a list of cells where to put the graphs (by the upper-left corner)

add_stat(name, first_value=0)[source]#

Add a new statistic to the table. It is recorded in monitoring function and how it is collected is up to the user.

append(*stats)[source]#

Add a new record to the statistics. The number of stats must include manually added ones

Parameters:

stats – current simulation time, current number of deposited cells and manually added columns

Returns:

get_params(arg, name)[source]#

Collect initial parameters and save them to Excel-file

Parameters:
  • arg (dict) – a dictionary of parameters

  • name (str) – a name for the provided parameters

Returns:

plot(x, y)[source]#

[‘Time’, ‘Sim.time’, ‘Sim.speed’, ‘Volume’, Min.precursor coverage’, ‘Growth rate’] :type x: :param x: :type y: :param y: :return:

save_to_file(force=False)[source]#

Write collected statistics to an Excel file. The gathered statistics are appended to the end of the table every couple of seconds Caution: the session keeps the file open until it finishes.