Skip to content

Commit

Permalink
fixes from messy merge
Browse files Browse the repository at this point in the history
  • Loading branch information
nwlandry committed Sep 9, 2023
1 parent 0c16910 commit 9ac9fef
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 183 deletions.
79 changes: 0 additions & 79 deletions tests/algorithms/test_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,82 +434,3 @@ def dens_ignore_sing(m):
assert abs(dens_ignore_sing(7) - 1 / 3) < tol
with pytest.raises(ValueError):
xgi.incidence_density(H, max_order=8, ignore_singletons=True)


def test_subfaces(edgelist5):
assert xgi.subfaces(edgelist5) == [
(0,),
(1,),
(2,),
(3,),
(0, 1),
(0, 2),
(0, 3),
(1, 2),
(1, 3),
(2, 3),
(0, 1, 2),
(0, 1, 3),
(0, 2, 3),
(1, 2, 3),
(5,),
(6,),
(8,),
(6,),
(7,),
(8, 6),
(8, 7),
(6, 7),
]

assert xgi.subfaces(edgelist5, order=-1) == [
(0, 1, 2),
(0, 1, 3),
(0, 2, 3),
(1, 2, 3),
(5,),
(6,),
(8, 6),
(8, 7),
(6, 7),
]

assert xgi.subfaces(edgelist5, order=0) == [
(0,),
(1,),
(2,),
(3,),
(5,),
(6,),
(8,),
(6,),
(7,),
]

assert xgi.subfaces(edgelist5, order=1) == [
(0, 1),
(0, 2),
(0, 3),
(1, 2),
(1, 3),
(2, 3),
(5, 6),
(8, 6),
(8, 7),
(6, 7),
]

assert xgi.subfaces(edgelist5, order=2) == [
(0, 1, 2),
(0, 1, 3),
(0, 2, 3),
(1, 2, 3),
(8, 6, 7),
]

assert xgi.subfaces(edgelist5, order=3) == [(0, 1, 2, 3)]

with pytest.raises(XGIError):
xgi.subfaces(
edgelist5, order=4
) # order cannot be larger than maximum order in edgelist
23 changes: 23 additions & 0 deletions tests/utils/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,26 @@ def test_hist():

with pytest.raises(XGIError):
xgi.hist(vals, bins="ten")


def test_binomial_sequence():

# ask for more ones than available characters
output = xgi.binomial_sequence(3, 2)
expected_output = set()
assert output == expected_output

# ask for an empty string
output = xgi.binomial_sequence(0, 0)
expected_output = {""}
assert output == expected_output

# ask for only zeros
output = xgi.binomial_sequence(0, 2)
expected_output = {"00"}
assert output == expected_output

# regular output
output = xgi.binomial_sequence(2, 4)
expected_output = {"1100", "1001", "0011", "1010", "0101", "0110"}
assert output == expected_output
104 changes: 0 additions & 104 deletions tests/utils/test_utils.py

This file was deleted.

0 comments on commit 9ac9fef

Please sign in to comment.