python unsigned long_Python numpy.longfloat方法代码示例

# 需要导入模块: import numpy [as 别名]

# 或者: from numpy import longfloat [as 别名]

def test_to_signed_graph():

ia = IndraNetAssembler([ab1, ab2, ab3, ab4, bc1, bc2, bc3, bc4])

df = ia.make_df()

net = IndraNet.from_df(df)

signed_graph = net.to_signed_graph(

sign_dict=default_sign_dict,

weight_mapping=_weight_mapping)

assert len(signed_graph.nodes) == 3

assert len(signed_graph.edges) == 4

assert set([stmt['stmt_type'] for stmt in

signed_graph['a']['b'][0]['statements']]) == {

'Activation', 'IncreaseAmount'}

assert set([stmt['stmt_type'] for stmt in

signed_graph['a']['b'][1]['statements']]) == {'Inhibition'}

assert set([stmt['stmt_type'] for stmt in

signed_graph['b']['c'][0]['statements']]) == {

'Activation', 'IncreaseAmount'}

assert set([stmt['stmt_type'] for stmt in

signed_graph['b']['c'][1]['statements']]) == {

'Inhibition', 'DecreaseAmount'}

assert all(signed_graph.edges[e].get('belief', False) for e in

signed_graph.edges)

assert all(isinstance(signed_graph.edges[e]['belief'],

(float, np.longfloat)) for e in signed_graph.edges)

assert all(signed_graph.edges[e].get('weight', False) for e in

signed_graph.edges)

assert all(isinstance(signed_graph.edges[e]['weight'],

(float, np.longfloat)) for e in signed_graph.edges)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值