本文整理汇总了Python中safe_extras.parameters.float_parameter.FloatParameter.element_type方法的典型用法代码示例。如果您正苦于以下问题:Python FloatParameter.element_type方法的具体用法?Python FloatParameter.element_type怎么用?Python FloatParameter.element_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类safe_extras.parameters.float_parameter.FloatParameter
的用法示例。
在下文中一共展示了FloatParameter.element_type方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: low_hazard_class
# 需要导入模块: from safe_extras.parameters.float_parameter import FloatParameter [as 别名]
# 或者: from safe_extras.parameters.float_parameter.FloatParameter import element_type [as 别名]
def low_hazard_class():
"""Parameter definition.
:returns: Low Hazard Class parameter
:rtype: FloatParameter
"""
field = FloatParameter()
field.name = 'Low Hazard Threshold'
field.element_type = float
field.value = 0.34
field.help_text = tr('Low Hazard class thresholds.')
field.description = tr(
'Threshold value of hazard categorized as Low Hazard class.')
return field
示例2: high_hazard_class
# 需要导入模块: from safe_extras.parameters.float_parameter import FloatParameter [as 别名]
# 或者: from safe_extras.parameters.float_parameter.FloatParameter import element_type [as 别名]
def high_hazard_class():
"""Parameter definition.
:returns: High Hazard Class parameter
:rtype: FloatParameter
"""
field = FloatParameter()
field.name = 'High Hazard Threshold'
field.element_type = float
field.value = 1.0
field.help_text = tr('High Hazard class threshold.')
field.description = tr(
'Threshold value of hazard categorized as High Hazard class. It '
'should be greater than Medium Hazard Thresholds')
return field
示例3: high_hazard_class
# 需要导入模块: from safe_extras.parameters.float_parameter import FloatParameter [as 别名]
# 或者: from safe_extras.parameters.float_parameter.FloatParameter import element_type [as 别名]
def high_hazard_class():
"""Parameter definition.
:returns: High Hazard Class parameter
:rtype: FloatParameter
"""
field = FloatParameter()
field.name = 'High Hazard Class'
field.element_type = float
field.value = 3.0
unit_generic = parameter_unit_generic()
field.unit = unit_generic
field.allowed_units = [unit_generic]
field.help_text = tr('High Hazard class value.')
field.description = tr(
'The value of hazard categorized as High Hazard class')
return field