当前位置: 首页>>代码示例>>Python>>正文


Python Data.magic方法代码示例

本文整理汇总了Python中SUAVE.Structure.Data.magic方法的典型用法代码示例。如果您正苦于以下问题:Python Data.magic方法的具体用法?Python Data.magic怎么用?Python Data.magic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SUAVE.Structure.Data的用法示例。


在下文中一共展示了Data.magic方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: do_this

# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import magic [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
开发者ID:designToolDeveloper,项目名称:SUAVE,代码行数:37,代码来源:Example_Attribute.py

示例2: simple_method

# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import magic [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
开发者ID:designToolDeveloper,项目名称:SUAVE,代码行数:37,代码来源:simple_method.py

示例3: __call__

# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import magic [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
开发者ID:designToolDeveloper,项目名称:SUAVE,代码行数:22,代码来源:Example_Callable_Attribute.py


注:本文中的SUAVE.Structure.Data.magic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。