Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated add_simplices_from to match add_hyperedges_from #220

Merged
merged 5 commits into from
Nov 9, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tests: added for attribute case
  • Loading branch information
maximelucas committed Nov 9, 2022
commit f4c2b18c94b26c519563b7607922394a069b4e3d
13 changes: 13 additions & 0 deletions tests/classes/test_simplicialcomplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ def test_add_simplices_from(edgelist5):
assert set(s1o1.members()) == set(s2o1.members())
assert set(s1o2.members()) == set(s2o2.members())

S3 = xgi.SimplicialComplex()
simplex = ((1,2,3), {"color": "red"})
S3.add_simplices_from([simplex], max_order=2)

assert S3.edges.members(dtype=dict) == {0: frozenset({1, 2, 3}),
1: frozenset({1, 2}),
2: frozenset({1, 3}),
3: frozenset({2, 3})}

assert S3.edges[0] == {'color': 'red'}
assert S3.edges[1] == {}
assert S3.edges[2] == {}
assert S3.edges[3] == {}

def test_remove_simplex_id(edgelist6):
S = xgi.SimplicialComplex()
Expand Down