Skip to content

Calc ui objects

ColumnFormat

Creates a Column object which can be used to build a table with "input_user_table".

Parameters:

Name Type Description Default

data_type

str

"string_type", "float_type" or "select_type"

required

select_options

Optional[List[str]]

Default = None, only utilised if data_type is "select_type".

None

description

str

Default = ''. The description of the column.

''

max_char

int

Default = 100, only utilised if data_type is "string_type". Default = 100.

100

step

float

Default = 1. The step between values, only utilised if data_type is "float_type".

1

min_val

float

Default = 0. Only utilised if data_type is "float_type".

0

max_val

float

Default = 100. Only utilised if data_type is "float_type".

100

is_editable

bool

Default = True. Defines if the column is editable or not.

True

Returns:

Type Description

None

Examples:

1
2
3
4
ColumnFormat(heading="B",
             description="Column description",
             data_type="select_type",
             select_options=["OptA", "OptB"])

UiBoolean

Bases: UiGenericInput

Creates a checkbox or a switch element which can be added to the calculation report.

Parameters:

Name Type Description Default

flavour

str

Allowable flavours are "checkbox" and "switch". Default = "checkbox".

'checkbox'

label

str

Incremental value between the min and max of the range slider. Default = False.

''

Returns:

Type Description

None

Examples:

1
UiBoolean(flavour="checkbox", label="Consider torsion?")

UiNumberInput

Bases: UiGenericInput

Creates a number input element which can be added to the calculation report.

Parameters:

Name Type Description Default

min_val

float

Minimum value associated with the number input.

required

max_val

float

Maximum value associated with the number input.

required

step

float

Incremental value between the min and max of the range slider.

required

default

float

Default value. Default = None.

None

Returns:

Type Description

None

Examples:

1
UiNumberInput(min_val=10, max_val=100, step=1.0), unit="MPa")

UiRange

Bases: UiGenericInput

Creates a number slider element which can be added to the calculation report.

Parameters:

Name Type Description Default

min_val

float

Minimum value associated with the range slider

required

max_val

float

Maximum value associated with the range slider

required

step

float

Incremental value between the min and max of the range slider

required

default

float

Default value. Default = None.

None

Returns:

Type Description

None

Examples:

1
UiRange(min_val=10, max_val=100, step=1.0), unit="MPa")

UiSelect

Bases: UiGenericInput

Creates a dropdown input element with variables as defined in "list_vals".

Parameters:

Name Type Description Default

list_vals

List

A list of string values which the user can select from.

required

default

str or numeric

Must be a value from the list_vals. Default = None.

None

is_numeric

bool

Default = false, therefore it is assumed to be a string, otherwise a numerical value (i.e. float). Default = False.

False

Returns:

Type Description

None

Examples:

1
UiSelect(["R", "S", "N"])