本文整理汇总了Python中SUAVE.Core.Data.var3方法的典型用法代码示例。如果您正苦于以下问题:Python Data.var3方法的具体用法?Python Data.var3怎么用?Python Data.var3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SUAVE.Core.Data
的用法示例。
在下文中一共展示了Data.var3方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_this
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import var3 [as 别名]
def do_this(input1,input2=None):
""" SUAVE.Attributes.Attribute.do_this(input1,input2=None)
conditions data for some useful purpose
Inputs:
input1 - description [units]
input2 - description [units]
Outpus:
output1 - description
output2 - description
>> try to minimize outputs
>> pack up outputs into Data() if needed
Assumptions:
if needed
"""
# unpack inputs
var1 = input1.var1
var2 = inputs.var2
# setup
var3 = var1 * var2
# process
magic = np.log(var3)
# packup outputs
output = Data()
output.magic = magic
output.var3 = var3
return output
示例2: simple_method
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import var3 [as 别名]
def simple_method(input1,input2=None):
""" SUAVE.Methods.SimpleMethod(input1,input2=None)
does something useful
Inputs:
input1 - description [units]
input2 - description [units]
Outputs:
output1 - description
output2 - description
>> try to minimize outputs
>> pack up outputs into Data() if needed
Assumptions:
if needed
"""
# unpack inputs
var1 = input1.var1
var2 = inputs.var2
# setup
var3 = var1 * var2
# process
magic = np.log(var3)
# packup outputs
output = Data()
output.magic = magic
output.var3 = var3
return output
示例3: __call__
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import var3 [as 别名]
def __call__(self,input1,input2=None):
# the method used with the class is called like a function
# document at class level
# unpack inputs
var1 = input1.var1
var2 = inputs.var2
# setup
var3 = var1 * var2
# process
magic = np.log(var3)
# packup outputs
output = Data()
output.magic = magic
output.var3 = var3
return output
示例4: do_this
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import var3 [as 别名]
def do_this(input1,input2=None):
"""<Description>
Assumptions:
<any assumptions>
Source:
<source>
Inputs:
<input1> <units>
<input2> <units>
..
Outputs:
<output1> <units>
<output2> <units>
..
Properties Used:
<property1> <units>
<property2> <units>
..
"""
# unpack inputs
var1 = input1.var1
var2 = inputs.var2
# setup
var3 = var1 * var2
# process
magic = np.log(var3)
# packup outputs
output = Data()
output.magic = magic
output.var3 = var3
return output