Skip to content

comparison.diff

Helpers for numerical comparison of data.

Allows to tests semi-automatically for problems with the various models. Used to benchmark the simulation results.

DataSetsComparison

DataSetsComparison(
    dfs_dict,
    columns_filter=None,
    time_column=True,
    title=None,
    selections=None,
    factors=None,
)

Comparing multiple simulation results.

Only the subset of identical columns are compared. In the beginning a matching of column names is performed to find the subset of columns which can be compared.

The simulations must contain a "time" column with identical time points.

Initialize the comparison.

:param dfs_dict: data dictionary d[simulator_key] = df_result :param columns_filter: function which returns True if in Set or False if should be filtered. :param time_column: flag to check for time column

df_diff

df_diff()

Dataframe of all differences between the files.

https://github.com/sbmlteam/sbml-test-suite/blob/master/cases/semantic/README.md Let the following variables be defined:

  • abs_tol stand for the absolute tolerance for a tests case,
  • rel_tol stand for the relative tolerance for a tests case,
  • c_ij stand for the expected correct value for row i, column j, of the result data set for the tests case
  • u_ij stand for the corresponding value produced by a given software simulation system run by the user

These absolute and relative tolerances are used in the following way: a data point u_ij is considered to be within tolerances if and only if the following expression is true:

|c_ij - u_ij| <= (abs_tol + rel_tol * |c_ij|)

is_equal

is_equal()

Check if DataFrames are identical within numerical tolerance.

report_str

report_str()

Get report as string.

report

report()

Report.

plot_diff

plot_diff()

Plot lines for entries which are above epsilon treshold.

get_files_by_extension

get_files_by_extension(base_path, extension='.json')

Get all files by given extension.

Simulation definitions are json files.