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


Python PredefinedTypes.get_types方法代码示例

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


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

示例1: visit_neuron

# 需要导入模块: from pynestml.symbols.predefined_types import PredefinedTypes [as 别名]
# 或者: from pynestml.symbols.predefined_types.PredefinedTypes import get_types [as 别名]
 def visit_neuron(self, node):
     """
     Private method: Used to visit a single neuron and create the corresponding global as well as local scopes.
     :return: a single neuron.
     :rtype: ast_neuron
     """
     # set current processed neuron
     Logger.set_current_neuron(node)
     code, message = Messages.get_start_building_symbol_table()
     Logger.log_message(neuron=node, code=code, error_position=node.get_source_position(),
                        message=message, log_level=LoggingLevel.INFO)
     # before starting the work on the neuron, make everything which was implicit explicit
     # but if we have a model without an equations block, just skip this step
     if node.get_equations_blocks() is not None:
         make_implicit_odes_explicit(node.get_equations_blocks())
     scope = Scope(scope_type=ScopeType.GLOBAL, source_position=node.get_source_position())
     node.update_scope(scope)
     node.get_body().update_scope(scope)
     # now first, we add all predefined elements to the scope
     variables = PredefinedVariables.get_variables()
     functions = PredefinedFunctions.get_function_symbols()
     types = PredefinedTypes.get_types()
     for symbol in variables.keys():
         node.get_scope().add_symbol(variables[symbol])
     for symbol in functions.keys():
         node.get_scope().add_symbol(functions[symbol])
     for symbol in types.keys():
         node.get_scope().add_symbol(types[symbol])
开发者ID:Silmathoron,项目名称:nestml,代码行数:30,代码来源:ast_symbol_table_visitor.py

示例2: __register_predefined_type_variables

# 需要导入模块: from pynestml.symbols.predefined_types import PredefinedTypes [as 别名]
# 或者: from pynestml.symbols.predefined_types.PredefinedTypes import get_types [as 别名]
 def __register_predefined_type_variables(cls):
     """
     Registers all predefined type variables, e.g., mV and integer.
     """
     for name in PredefinedTypes.get_types().keys():
         symbol = VariableSymbol(name=name, block_type=BlockType.PREDEFINED,
                                 is_predefined=True,
                                 type_symbol=PredefinedTypes.get_type(name),
                                 variable_type=VariableType.TYPE)
         cls.name2variable[name] = symbol
     return
开发者ID:Silmathoron,项目名称:nestml,代码行数:13,代码来源:predefined_variables.py

示例3: is_unit_variable

# 需要导入模块: from pynestml.symbols.predefined_types import PredefinedTypes [as 别名]
# 或者: from pynestml.symbols.predefined_types.PredefinedTypes import get_types [as 别名]
 def is_unit_variable(self):
     """
     Provided on-the-fly information whether this variable represents a unit-variable, e.g., nS.
     Caution: It assumes that the symbol table has already been constructed.
     :return: True if unit-variable, otherwise False.
     :rtype: bool
     """
     from pynestml.symbols.predefined_types import PredefinedTypes
     if self.get_name() in PredefinedTypes.get_types():
         return True
     else:
         return False
开发者ID:Silmathoron,项目名称:nestml,代码行数:14,代码来源:ast_variable.py


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