Interpolation

Provides interpolation algorithms across tabular data for vivarium simulations.

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

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

Parameters:
data

The data from which to build the interpolation. Contains categorical_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.framework.lookup.interpolation.validate_parameters(data, categorical_parameters, continuous_parameters, value_columns)[source]
vivarium.framework.lookup.interpolation.validate_call_data(data, categorical_parameters, continuous_parameters)[source]
vivarium.framework.lookup.interpolation.check_data_complete(data, continuous_parameters)[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.framework.lookup.interpolation.Order0Interp(data, continuous_parameters, value_columns, extrapolate, validate)[source]

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

Parameters:
data

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

continuous_parameters

Column names to be used as parameters in Interpolation.