Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
branches: [main, dev]

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main
- dev

jobs:
test:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main
- dev

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion xgi/core/hypergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ def random_edge_shuffle(self, e_id1=None, e_id2=None, seed=None):

# randomly redistribute nodes between the two edges
nodes_list = list(nodes)
chosen = rng.choice(nodes_list, size=len(e1), replace=False)
chosen = rng.choice(nodes_list, size=len(e1), replace=False).tolist()
e1_new = set(chosen)
e2_new = nodes - e1_new

Expand Down
53 changes: 21 additions & 32 deletions xgi/core/simplicialcomplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,46 +122,35 @@ def __str__(self):
f" nodes and {self.num_edges} simplices"
)

def add_edge(self, edge, idx=None, **attr):
"""Deprecated in SimplicialComplex. Use add_simplex instead"""
warn("add_edge is deprecated in SimplicialComplex. Use add_simplex instead")
return self.add_simplex(edge, idx=None, **attr)

def add_edges_from(self, ebunch_to_add, max_order=None, **attr):
"""Deprecated in SimplicialComplex. Use add_simplices_from instead"""
warn(
"add_edges_from is deprecated in SimplicialComplex. "
"Use add_simplices_from instead"
def add_edge(self, *args, **kwargs):
raise XGIError(
"add_edge is not available for SimplicialComplex. "
"Use add_simplex instead."
)
return self.add_simplices_from(ebunch_to_add, max_order=None, **attr)

def add_weighted_edges_from(
self, ebunch_to_add, max_order=None, weight="weight", **attr
):
"""Deprecated in SimplicialComplex. Use add_weighted_simplices_from instead"""
warn(
"add_weighted_edges_from is deprecated in SimplicialComplex."
" Use add_weighted_simplices_from instead"
def add_edges_from(self, *args, **kwargs):
raise XGIError(
"add_edges_from is not available for SimplicialComplex. "
"Use add_simplices_from instead."
)
return self.add_weighted_simplices_from(
ebunch_to_add, max_order=max_order, weight=weight, **attr

def add_weighted_edges_from(self, *args, **kwargs):
raise XGIError(
"add_weighted_edges_from is not available for SimplicialComplex. "
"Use add_weighted_simplices_from instead."
)

def remove_edge(self, idx):
"""Deprecated in SimplicialComplex. Use remove_simplex_id instead"""
warn(
"remove_edge is deprecated in SimplicialComplex. "
"Use remove_simplex_id instead"
def remove_edge(self, *args, **kwargs):
raise XGIError(
"remove_edge is not available for SimplicialComplex. "
"Use remove_simplex_id instead."
)
return self.remove_simplex_id(idx)

def remove_edges_from(self, ebunch):
"""Deprecated in SimplicialComplex. Use remove_simplex_ids_from instead"""
warn(
"remove_edges_from is deprecated in SimplicialComplex. "
"Use remove_simplex_ids_from instead"
def remove_edges_from(self, *args, **kwargs):
raise XGIError(
"remove_edges_from is not available for SimplicialComplex. "
"Use remove_simplex_ids_from instead."
)
return self.remove_simplex_ids_from(ebunch)

def remove_node(self, n):
"""Remove a single node.
Expand Down
2 changes: 2 additions & 0 deletions xgi/readwrite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"write_hif_collection",
"read_incidence_matrix",
"write_incidence_matrix",
"read_json",
"write_json",
"load_xgi_data",
"download_xgi_data",
]