bio_rtd.adj_par

Module for defining adjustable attributes of the RtdModel.

Adjustable attributes are mainly used by GUI in order to offer responsive parameter setting.

Notes

Technically this module relates to instance attributes rather than parameters. However, the term ‘process parameters’ is well established in biotech, hence the word ‘parameter’ appears in class names and docstring instead of ‘instance attribute`.

AdjParSlider

class bio_rtd.adj_par.AdjParSlider(var, v_range, v_init=None, scale_factor=1, par_name=None, gui_type='slider')[source]

Bases: bio_rtd.adj_par.AdjustableParameter

A value slider version of AdjustableParameter.

Parameters
  • var (str) – Attribute affected by the AdjParSlider.

  • v_range (Union[float, Tuple[float, float], Tuple[float, float, float]]) –

    Range of values.

    Defines range end or [start, end] or [start, end, step].

    If step is not defined, the step = (start - end) / 10.

    If start is not defined the start = 0.

  • v_init (Optional[float]) – Initial value. If None, the value is inherited from attribute.

  • scale_factor (float) –

    Scale factor for compensation for differences in units.

    Examples

    Setting time (v_init) in [h] for attribute (in var_list) in [min] requires a scale_factor of 60.

  • par_name (Optional[str]) – Attribute title.

  • gui_type (Optional[str]) – Method for setting parameter in GUI. Default = ‘slider’.

var_list: List[str]

A list of attributes affected by the AdjustableParameter.

Attributes typically belong to bio_rtd.core.UnitOperation or bio_rtd.core.Inlet instance.

Examples

var_list = [‘c_start[1]’, ‘c_end[1]’]

var_list = [‘starts_empty’]

v_range: Optional[Union[Tuple[float, float, float], Sequence[str], Sequence[float], Sequence[Tuple[str, str]]]]

Range of values.

For boolean set None.

For range specify [start, end, step].

For list set list. If the list has two columns, the first one is the title and the second is the value.

v_init: Optional[Union[float, bool, Sequence[float]]]

Initial value.

If None (default), the value is inherited from initial attribute value at the start of runtime.

scale_factor: float

Scale factor for compensation for differences in units.

Examples

Setting time (v_init) in [h] for attribute (in var_list) in [min] requires a scale_factor of 60.

par_name: Optional[Union[str, Sequence[str]]]

Attribute title.

Examples

par_name = ‘Initial delay [min]’ # slider, range, boolean

par_name = [‘Option 1’, ‘Option 2’, ‘Option 3’] # radio buttons

gui_type: Optional[str]

Method for setting parameter in GUI.

If None (default) or the gui does not support the type, then the gui should decide the method based on v_init and/or var_list.

Example values: ‘checkbox’, ‘range’, ‘slider’, ‘select’, ‘multi-select’

AdjParRange

class bio_rtd.adj_par.AdjParRange(var_list, v_range, v_init=None, scale_factor=1, par_name=None, gui_type='range')[source]

Bases: bio_rtd.adj_par.AdjustableParameter

Defines a range slider version of AdjustableParameter

Parameters
  • var_list (Tuple[str, str]) –

    Defines attributed affected by the AdjParRange.

    First has value of the start of the interval and second of the end of the interval.

  • v_range (Union[float, Tuple[float, float], Tuple[float, float, float]]) –

    Range of values.

    Defines range end or [start, end] or [start, end, step].

    If step is not defined, the step = (start - end) / 10.

    If start is not defined the start = 0.

  • v_init (Optional[Tuple[float, float]]) – Initial value [interval start, interval end]. If None (default), then the initial values are assigned from the initial conditions at the start of the simulation.

  • scale_factor (float) –

    Scale factor for compensation for differences in units.

    Examples

    Setting time (v_init) in [h] for attribute (in var_list) in [min] requires a scale_factor of 60.

  • par_name (Optional[str]) – Attribute title.

  • gui_type (Optional[str]) – Method for setting parameter in GUI. Default = ‘range’.

var_list: List[str]

A list of attributes affected by the AdjustableParameter.

Attributes typically belong to bio_rtd.core.UnitOperation or bio_rtd.core.Inlet instance.

Examples

var_list = [‘c_start[1]’, ‘c_end[1]’]

var_list = [‘starts_empty’]

v_range: Optional[Union[Tuple[float, float, float], Sequence[str], Sequence[float], Sequence[Tuple[str, str]]]]

Range of values.

For boolean set None.

For range specify [start, end, step].

For list set list. If the list has two columns, the first one is the title and the second is the value.

v_init: Optional[Union[float, bool, Sequence[float]]]

Initial value.

If None (default), the value is inherited from initial attribute value at the start of runtime.

scale_factor: float

Scale factor for compensation for differences in units.

Examples

Setting time (v_init) in [h] for attribute (in var_list) in [min] requires a scale_factor of 60.

par_name: Optional[Union[str, Sequence[str]]]

Attribute title.

Examples

par_name = ‘Initial delay [min]’ # slider, range, boolean

par_name = [‘Option 1’, ‘Option 2’, ‘Option 3’] # radio buttons

gui_type: Optional[str]

Method for setting parameter in GUI.

If None (default) or the gui does not support the type, then the gui should decide the method based on v_init and/or var_list.

Example values: ‘checkbox’, ‘range’, ‘slider’, ‘select’, ‘multi-select’

AdjParBoolean

class bio_rtd.adj_par.AdjParBoolean(var, v_init=None, par_name=None, gui_type='checkbox')[source]

Bases: bio_rtd.adj_par.AdjustableParameter

A boolean variation of AdjustableParameter

Parameters
  • var (str) – Attribute affected by the AdjParBoolean.

  • v_init (Optional[bool]) – Initial value. If None, the value is inherited from attribute.

  • par_name (Optional[str]) – Attribute title.

  • gui_type (Optional[str]) – Method for setting parameter in GUI. Default = ‘checkbox’.

var_list: List[str]

A list of attributes affected by the AdjustableParameter.

Attributes typically belong to bio_rtd.core.UnitOperation or bio_rtd.core.Inlet instance.

Examples

var_list = [‘c_start[1]’, ‘c_end[1]’]

var_list = [‘starts_empty’]

v_range: Optional[Union[Tuple[float, float, float], Sequence[str], Sequence[float], Sequence[Tuple[str, str]]]]

Range of values.

For boolean set None.

For range specify [start, end, step].

For list set list. If the list has two columns, the first one is the title and the second is the value.

v_init: Optional[Union[float, bool, Sequence[float]]]

Initial value.

If None (default), the value is inherited from initial attribute value at the start of runtime.

scale_factor: float

Scale factor for compensation for differences in units.

Examples

Setting time (v_init) in [h] for attribute (in var_list) in [min] requires a scale_factor of 60.

par_name: Optional[Union[str, Sequence[str]]]

Attribute title.

Examples

par_name = ‘Initial delay [min]’ # slider, range, boolean

par_name = [‘Option 1’, ‘Option 2’, ‘Option 3’] # radio buttons

gui_type: Optional[str]

Method for setting parameter in GUI.

If None (default) or the gui does not support the type, then the gui should decide the method based on v_init and/or var_list.

Example values: ‘checkbox’, ‘range’, ‘slider’, ‘select’, ‘multi-select’

AdjParBooleanMultiple

class bio_rtd.adj_par.AdjParBooleanMultiple(var_list, v_init=None, par_name=None, gui_type='radio_group')[source]

Bases: bio_rtd.adj_par.AdjustableParameter

A radio group variation of AdjustableParameter

Parameters
  • var_list (List[str]) – List of attributes affected by the AdjParBooleanMultiple.

  • v_init (Optional[Sequence[bool]]) – Initial value. If None, the value is inherited from attribute.

  • par_name (Optional[Sequence[str]]) – Attribute title.

  • gui_type (Optional[str]) – Method for setting parameter in GUI. Default = ‘radio_group’.

var_list: List[str]

A list of attributes affected by the AdjustableParameter.

Attributes typically belong to bio_rtd.core.UnitOperation or bio_rtd.core.Inlet instance.

Examples

var_list = [‘c_start[1]’, ‘c_end[1]’]

var_list = [‘starts_empty’]

v_range: Optional[Union[Tuple[float, float, float], Sequence[str], Sequence[float], Sequence[Tuple[str, str]]]]

Range of values.

For boolean set None.

For range specify [start, end, step].

For list set list. If the list has two columns, the first one is the title and the second is the value.

v_init: Optional[Union[float, bool, Sequence[float]]]

Initial value.

If None (default), the value is inherited from initial attribute value at the start of runtime.

scale_factor: float

Scale factor for compensation for differences in units.

Examples

Setting time (v_init) in [h] for attribute (in var_list) in [min] requires a scale_factor of 60.

par_name: Optional[Union[str, Sequence[str]]]

Attribute title.

Examples

par_name = ‘Initial delay [min]’ # slider, range, boolean

par_name = [‘Option 1’, ‘Option 2’, ‘Option 3’] # radio buttons

gui_type: Optional[str]

Method for setting parameter in GUI.

If None (default) or the gui does not support the type, then the gui should decide the method based on v_init and/or var_list.

Example values: ‘checkbox’, ‘range’, ‘slider’, ‘select’, ‘multi-select’

AdjustableParameter

class bio_rtd.adj_par.AdjustableParameter(var_list, v_range=None, v_init=None, scale_factor=1, par_name=None, gui_type=None)[source]

Bases: abc.ABC

Adjustable parameter for UnitOperation (or Inlet).

The class does not provide any logic. It just provides a unified way to specify an adjustable attribute.

This class primarily serves as an abstract class for specific extensions.

Parameters
  • var_list (List[str]) – A list of attributes affected by the AdjustableParameter.

  • v_range (Union[Tuple[float, float, float], Sequence[str], Sequence[float], Sequence[Tuple[str, str]], None]) – Range of values.

  • v_init (Union[float, bool, Sequence[float], None]) – Initial value. If None, the value is inherited from attribute.

  • scale_factor (float) – Scale factor.

  • par_name (Union[str, Sequence[str], None]) – Attribute title.

  • gui_type (Optional[str]) – Method for setting parameter in GUI.

var_list: List[str]

A list of attributes affected by the AdjustableParameter.

Attributes typically belong to bio_rtd.core.UnitOperation or bio_rtd.core.Inlet instance.

Examples

var_list = [‘c_start[1]’, ‘c_end[1]’]

var_list = [‘starts_empty’]

v_range: Optional[Union[Tuple[float, float, float], Sequence[str], Sequence[float], Sequence[Tuple[str, str]]]]

Range of values.

For boolean set None.

For range specify [start, end, step].

For list set list. If the list has two columns, the first one is the title and the second is the value.

v_init: Optional[Union[float, bool, Sequence[float]]]

Initial value.

If None (default), the value is inherited from initial attribute value at the start of runtime.

scale_factor: float

Scale factor for compensation for differences in units.

Examples

Setting time (v_init) in [h] for attribute (in var_list) in [min] requires a scale_factor of 60.

par_name: Optional[Union[str, Sequence[str]]]

Attribute title.

Examples

par_name = ‘Initial delay [min]’ # slider, range, boolean

par_name = [‘Option 1’, ‘Option 2’, ‘Option 3’] # radio buttons

gui_type: Optional[str]

Method for setting parameter in GUI.

If None (default) or the gui does not support the type, then the gui should decide the method based on v_init and/or var_list.

Example values: ‘checkbox’, ‘range’, ‘slider’, ‘select’, ‘multi-select’