adjust

This module contains classes which define adjustments to model parameters.

class summer.adjust.Multiply(param: Union[float, Callable[float, float]])

Bases: summer.adjust.BaseAdjustment

A multiplication-based adjustment of a parameter. The new parameter value is the previous value, multiplied by the supplied parameter.

Parameters

param – The parameter to be multiplied with the unadjusted value.

Examples

Create an adjustment to multiply by a factor of 1.5:

adjust.Multiply(1.5)

Created an adjustment to multiply with the value of a time varying function:

arbitrary_function = lambda time: 2 * time + 1
adjust.Multiply(arbitrary_function)
get_new_value(value: float, time: float)float

Returns the adjusted value for a given time.

Parameters
  • value – The value to adjust.

  • time – The time to be used for any time-varying functions.

Returns

The new, adjusted value.

Return type

float

class summer.adjust.Overwrite(param: Union[float, Callable[float, float]])

Bases: summer.adjust.BaseAdjustment

Am overwrite-based adjustment of a parameter. The new parameter value is the supplied parameter, overwriting any previous values.

Parameters

param – The parameter to be used in place of the unadjusted value.

Examples

Create an adjustment to overwrite the previous value with 1.5:

adjust.Overwrite(1.5)

Create an adjustment to overwrite the previous value with the value of a time varying function:

arbitrary_function = lambda time: 2 * time + 1
adjust.Overwrite(arbitrary_function)
get_new_value(value: float, time: float)float

Returns the adjusted value for a given time.

Parameters
  • value – The value to adjust.

  • time – The time to be used for any time-varying functions.

Returns

The new, adjusted value.

Return type

float