Interpolation

Provides interpolation algorithms across tabular data for vivarium simulations.

class vivarium.interpolation.Interpolation(data, categorical_parameters, continuous_parameters, order, extrapolate)[source]

A callable that returns the result of an interpolation function over input data.

data

The data from which to build the interpolation. Contains cateogrical_parameters and continuous_parameters.

categorical_parameters

Column names to be used as categorical parameters in Interpolation to select between interpolation functions.

continuous_parameters

Column names to be used as continuous parameters in Interpolation. If bin edges, should be of the form (column name used in call, column name for left bin edge, column name for right bin edge).

order

Order of interpolation.

vivarium.interpolation.validate_parameters(data, categorical_parameters, continuous_parameters)[source]
vivarium.interpolation.validate_call_data(data, key_columns, parameter_columns)[source]
vivarium.interpolation.check_data_complete(data, parameter_columns)[source]

For any parameters specified with edges, make sure edges don’t overlap and don’t have any gaps. Assumes that edges are specified with ends and starts overlapping (but one exclusive and the other inclusive) so can check that end of previous == start of current.

If multiple parameters, make sure all combinations of parameters are present in data.

Requires that bins of each parameter be standard across all values of other parameters, i.e., all bins for one parameter when de-duplicated should cover a continuous range of that parameter with no overlaps or gaps and the range covered should be the same for all combinations of other parameter values.

class vivarium.interpolation.Order0Interp(data, parameter_columns, value_columns, extrapolate)[source]

A callable that returns the result of order 0 interpolation over input data.

data

The data from which to build the interpolation. Contains categorical_parameters and continuous_parameters.

parameter_columns

Column names to be used as parameters in Interpolation.