Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 3 additions & 3 deletions tests/core/test_hypergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def test_random_edge_shuffle(edgelist4):
assert len(H._edge[1]) == len(S._edge[1])

# verify dual of edge dict is nodes dict
assert xgi.utilities.dual_dict(H._edge) == H._node
assert xgi.dual_dict(H._edge) == H._node

# hypergraph with more than two edges
S = xgi.Hypergraph(edgelist4)
Expand All @@ -568,7 +568,7 @@ def test_random_edge_shuffle(edgelist4):
assert len(H._edge[edge_id]) == len(S._edge[edge_id])

# verify dual of edge dict is nodes dict
assert xgi.utilities.dual_dict(H._edge) == H._node
assert xgi.dual_dict(H._edge) == H._node

# random hypergraph
S = xgi.random_hypergraph(50, [0.1, 0.01, 0.001], seed=1)
Expand All @@ -588,7 +588,7 @@ def test_random_edge_shuffle(edgelist4):
assert len(H._node[node_id]) == len(S._node[node_id])

# verify dual of edge dict is nodes dict
assert xgi.utilities.dual_dict(H._edge) == H._node
assert xgi.dual_dict(H._edge) == H._node


def test_duplicate_edges(edgelist1):
Expand Down
14 changes: 14 additions & 0 deletions xgi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,17 @@


__version__ = "0.10"

__all__ = (
core.__all__
+ algorithms.__all__
+ communities.__all__
+ convert.__all__
+ drawing.__all__
+ dynamics.__all__
+ generators.__all__
+ linalg.__all__
+ readwrite.__all__
+ stats.__all__
+ utils.__all__
)
39 changes: 39 additions & 0 deletions xgi/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,42 @@
from .properties import *
from .shortest_path import *
from .simpliciality import *

__all__ = [
"dynamical_assortativity",
"degree_assortativity",
"clique_eigenvector_centrality",
"h_eigenvector_centrality",
"z_eigenvector_centrality",
"node_edge_centrality",
"line_vector_centrality",
"katz_centrality",
"uniform_h_eigenvector_centrality",
"clustering_coefficient",
"local_clustering_coefficient",
"two_node_clustering_coefficient",
"is_connected",
"connected_components",
"largest_connected_component",
"number_connected_components",
"node_connected_component",
"largest_connected_hypergraph",
"equal",
"num_edges_order",
"max_edge_order",
"is_uniform",
"is_possible_order",
"edge_neighborhood",
"degree_counts",
"degree_histogram",
"unique_edge_sizes",
"density",
"incidence_density",
"single_source_shortest_path_length",
"shortest_path_length",
"edit_simpliciality",
"simplicial_edit_distance",
"face_edit_simpliciality",
"mean_face_edit_distance",
"simplicial_fraction",
]
2 changes: 2 additions & 0 deletions xgi/communities/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from . import spectral
from .spectral import *

__all__ = ["spectral_clustering"]
30 changes: 30 additions & 0 deletions xgi/convert/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,33 @@
from .line_graph import *
from .pandas import *
from .simplex import *

__all__ = [
"from_bipartite_edgelist",
"to_bipartite_edgelist",
"from_bipartite_graph",
"to_bipartite_graph",
"to_encapsulation_dag",
"empirical_subsets_filter",
"to_graph",
"to_hif_dict",
"from_hif_dict",
"to_hypergraph",
"to_dihypergraph",
"to_simplicial_complex",
"cut_to_order",
"from_hyperedge_dict",
"to_hyperedge_dict",
"from_hyperedge_list",
"to_hyperedge_list",
"to_hypergraph_dict",
"from_hypergraph_dict",
"from_incidence_matrix",
"to_incidence_matrix",
"to_line_graph",
"from_bipartite_pandas_dataframe",
"to_bipartite_pandas_dataframe",
"from_simplex_dict",
"from_max_simplices",
"k_skeleton",
]
2 changes: 2 additions & 0 deletions xgi/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
from .dihypergraph import DiHypergraph
from .globalviews import subhypergraph
from .simplicialcomplex import SimplicialComplex

__all__ = ["Hypergraph", "DiHypergraph", "SimplicialComplex", "subhypergraph"]
23 changes: 23 additions & 0 deletions xgi/drawing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
from .layout import *
from .draw import *

__all__ = [
"random_layout",
"pairwise_spring_layout",
"barycenter_spring_layout",
"weighted_barycenter_spring_layout",
"pca_transform",
"circular_layout",
"spiral_layout",
"barycenter_kamada_kawai_layout",
"bipartite_spring_layout",
"edge_positions_from_barycenters",
"draw",
"draw_nodes",
"draw_hyperedges",
"draw_simplices",
"draw_node_labels",
"draw_hyperedge_labels",
"draw_multilayer",
"draw_bipartite",
"draw_undirected_dyads",
"draw_directed_dyads",
]
7 changes: 7 additions & 0 deletions xgi/dynamics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
from . import synchronization
from .synchronization import *

__all__ = [
"simulate_kuramoto",
"simulate_simplicial_kuramoto",
"compute_kuramoto_order_parameter",
"compute_simplicial_order_parameter",
]
28 changes: 28 additions & 0 deletions xgi/generators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,31 @@
from .simple import *
from .simplicial_complexes import *
from .uniform import *

__all__ = [
"empty_hypergraph",
"empty_simplicial_complex",
"empty_dihypergraph",
"trivial_hypergraph",
"complete_hypergraph",
"star_clique",
"sunflower",
"complement",
"ring_lattice",
"watts_strogatz_hypergraph",
"random_hypergraph",
"fast_random_hypergraph",
"chung_lu_hypergraph",
"dcsbm_hypergraph",
"node_swap",
"shuffle_hyperedges",
"flag_complex",
"flag_complex_d2",
"random_flag_complex",
"random_flag_complex_d2",
"random_simplicial_complex",
"uniform_hypergraph_configuration_model",
"uniform_erdos_renyi_hypergraph",
"uniform_HSBM",
"uniform_HPPM",
]
14 changes: 14 additions & 0 deletions xgi/linalg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,17 @@
from .hodge_matrix import *
from .hypergraph_matrix import *
from .laplacian_matrix import *

__all__ = [
"boundary_matrix",
"hodge_laplacian",
"adjacency_matrix",
"incidence_matrix",
"intersection_profile",
"clique_motif_matrix",
"degree_matrix",
"adjacency_tensor",
"laplacian",
"multiorder_laplacian",
"normalized_hypergraph_laplacian",
]
20 changes: 20 additions & 0 deletions xgi/readwrite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,23 @@
from .incidence import *
from .json import *
from .xgi_data import *

__all__ = [
"load_bigg_data",
"read_bipartite_edgelist",
"write_bipartite_edgelist",
"parse_bipartite_edgelist",
"read_edgelist",
"write_edgelist",
"parse_edgelist",
"read_hif",
"write_hif",
"read_hif_collection",
"write_hif_collection",
"read_incidence_matrix",
"write_incidence_matrix",
"read_json",
"write_json",
"load_xgi_data",
"download_xgi_data",
]
5 changes: 3 additions & 2 deletions xgi/stats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ def name(self):
('degree', 'degree(order=3)')
>>> H.nodes.multi([da, d3]).asdict(transpose=True).keys()
dict_keys(['degree', 'degree(order=3)'])
>>> H.nodes.multi([da, d3]).aspandas().columns
Index(['degree', 'degree(order=3)'], dtype='object')
>>> cols = H.nodes.multi([da, d3]).aspandas().columns
>>> list(cols)
['degree', 'degree(order=3)']

"""
name = f"{self.func.__name__}"
Expand Down
21 changes: 21 additions & 0 deletions xgi/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,24 @@
from .tensor import *
from .trie import *
from .utilities import *

__all__ = [
"IDDict",
"Trie",
"binomial_sequence",
"convert_labels_to_integers",
"crest_r",
"dual_dict",
"find_triangles",
"geometric",
"get_network_type",
"hist",
"pairwise_incidence",
"powerset",
"request_json_from_url",
"request_json_from_url_cached",
"subfaces",
"ttsv1",
"ttsv2",
"update_uid_counter",
]