-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Method for k-skeleton of a SC (#578)
* feat: function + test * style: formatted with black * fix: iteration over orders * fix: removed iteration across orders * test: added test for k=0, related to #581 * style: black * docs: added explanation + link to ref * docs: rephrased definition * moved function to `convert.simplex` + created file for test * added k_skeleton to api rst file * use `max_edge_order` function * created cut_to_order + modified k_skeleton + tests * added cut_to_order to api * style: black * minor change for consistency with other functions * modified recipe * changed formatting in the recipe
- Loading branch information
1 parent
032f7a2
commit 52c7938
Showing
7 changed files
with
141 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import pytest | ||
|
||
import xgi | ||
from xgi.exception import XGIError | ||
|
||
|
||
def test_k_skeleton(edgelist1, edgelist2): | ||
S = xgi.SimplicialComplex(edgelist1) | ||
S1 = xgi.k_skeleton(S, 1) | ||
edges_skeleton = [ | ||
frozenset({4}), | ||
frozenset({5, 6}), | ||
frozenset({1, 2}), | ||
frozenset({8, 7}), | ||
frozenset({2, 3}), | ||
frozenset({6, 7}), | ||
frozenset({8, 6}), | ||
frozenset({1, 3}), | ||
] | ||
assert set(S1.edges.members()) == set(edges_skeleton) | ||
|
||
H = xgi.Hypergraph(edgelist2) | ||
with pytest.raises(XGIError): | ||
xgi.k_skeleton(H, 2) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters