本文整理匯總了Python中brian2.groups.group.Group._resolve方法的典型用法代碼示例。如果您正苦於以下問題:Python Group._resolve方法的具體用法?Python Group._resolve怎麽用?Python Group._resolve使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類brian2.groups.group.Group
的用法示例。
在下文中一共展示了Group._resolve方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_default_content
# 需要導入模塊: from brian2.groups.group import Group [as 別名]
# 或者: from brian2.groups.group.Group import _resolve [as 別名]
def test_default_content():
'''
Test that the default namespace contains standard units and functions.
'''
group = Group()
# Units
assert group._resolve('second', {}).get_value_with_unit() == second
assert group._resolve('volt', {}).get_value_with_unit() == volt
assert group._resolve('ms', {}).get_value_with_unit() == ms
assert group._resolve('Hz', {}).get_value_with_unit() == Hz
assert group._resolve('mV', {}).get_value_with_unit() == mV
# Functions
assert group._resolve('sin', {}).pyfunc == sin
assert group._resolve('log', {}).pyfunc == log
assert group._resolve('exp', {}).pyfunc == exp
# Constants
assert group._resolve('e', {}).sympy_obj == sympy.E
assert group._resolve('e', {}).get_value() == numpy.e
assert group._resolve('pi', {}).sympy_obj == sympy.pi
assert group._resolve('pi', {}).get_value() == numpy.pi
assert group._resolve('inf', {}).sympy_obj == sympy.oo
assert group._resolve('inf', {}).get_value() == numpy.inf