本文整理汇总了Python中pynestml.symbols.predefined_types.PredefinedTypes.get_buffer_type_if_exists方法的典型用法代码示例。如果您正苦于以下问题:Python PredefinedTypes.get_buffer_type_if_exists方法的具体用法?Python PredefinedTypes.get_buffer_type_if_exists怎么用?Python PredefinedTypes.get_buffer_type_if_exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pynestml.symbols.predefined_types.PredefinedTypes
的用法示例。
在下文中一共展示了PredefinedTypes.get_buffer_type_if_exists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mark_conductance_based_buffers
# 需要导入模块: from pynestml.symbols.predefined_types import PredefinedTypes [as 别名]
# 或者: from pynestml.symbols.predefined_types.PredefinedTypes import get_buffer_type_if_exists [as 别名]
def mark_conductance_based_buffers(input_lines):
"""
Inspects all handed over buffer definitions and updates them to conductance based if they occur as part of
a cond_sum rhs.
:param input_lines: a set of input buffers.
:type input_lines: ast_input_line
"""
# this is the updated version, where nS buffers are marked as conductance based
for bufferDeclaration in input_lines:
if bufferDeclaration.is_spike():
symbol = bufferDeclaration.get_scope().resolve_to_symbol(bufferDeclaration.get_name(),
SymbolKind.VARIABLE)
if symbol is not None and symbol.get_type_symbol().equals(PredefinedTypes.get_buffer_type_if_exists('nS')):
symbol.set_conductance_based(True)
return