@@ -978,45 +978,44 @@ def test_remove_edges_nodes_incidences_inplace(triloop2):
978978def test_remove_edges_nodes_incidences_not_inplace (triloop2 ):
979979 # triloop2 is a hypergraph of the following shape:
980980 # {AB: {A, B}, BC: {B, C}, ACD: {A, C, D, E}, ACD2: {A, C, D, E}}
981- hg = Hypergraph (triloop2 .edgedict , name = triloop2 .name )
981+ original_hg = hg = Hypergraph (triloop2 .edgedict , name = triloop2 .name )
982982 assert hg .shape == (5 , 4 )
983- original_hg_id = id (hg )
984983 original_hg_name = hg .name
985984 new_name = f"{ triloop2 .name } _new"
986985
987986 # removing a duplicate edge should not affect the number of nodes
988987 duplicate_edge = ["ACD2" ]
989988 hg = hg .remove_edges (duplicate_edge , name = new_name , inplace = False )
990989 assert hg .shape == (5 , 3 )
991- assert id (hg ) != original_hg_id
990+ assert id (hg ) != id ( original_hg )
992991 assert hg .name != original_hg_name
993992 assert hg .name == new_name
994993
995994 # number of nodes should drop by 1
996995 hg = hg .remove_nodes (["E" ], name = new_name , inplace = False )
997996 assert hg .shape == (4 , 3 )
998- assert id (hg ) != original_hg_id
997+ assert id (hg ) != id ( original_hg )
999998 assert hg .name != original_hg_name
1000999 assert hg .name == new_name
10011000
10021001 # number of edges should drop by 1
10031002 hg = hg .remove_edges (["ACD" ], name = new_name , inplace = False )
10041003 assert hg .shape == (3 , 2 )
1005- assert id (hg ) != original_hg_id
1004+ assert id (hg ) != id ( original_hg )
10061005 assert hg .name != original_hg_name
10071006 assert hg .name == new_name
10081007
10091008 # remove an incidence that no longer exists; no change
10101009 hg = hg .remove_incidences ([("ACD" , "E" )], name = new_name , inplace = False )
10111010 assert hg .shape == (3 , 2 )
1012- assert id (hg ) != original_hg_id
1011+ assert id (hg ) != id ( original_hg )
10131012 assert hg .name != original_hg_name
10141013 assert hg .name == new_name
10151014
10161015 # removing the last two remaining edges will remove all the nodes from the hypergraph
10171016 hg = hg .remove_edges (["AB" , "BC" ], name = new_name , inplace = False )
10181017 assert hg .shape == (0 , 0 )
1019- assert id (hg ) != original_hg_id
1018+ assert id (hg ) != id ( original_hg )
10201019 assert hg .name != original_hg_name
10211020 assert hg .name == new_name
10221021
0 commit comments