222202110-1301 USA
2323"""
2424
25- import os
26- import sys
27-
2825from igraph ._igraph import (
2926 ADJ_DIRECTED ,
3027 ADJ_LOWER ,
3431 ADJ_UNDIRECTED ,
3532 ADJ_UPPER ,
3633 ALL ,
34+ ARPACKOptions ,
35+ BFSIter ,
3736 BLISS_F ,
3837 BLISS_FL ,
3938 BLISS_FLM ,
4039 BLISS_FM ,
4140 BLISS_FS ,
4241 BLISS_FSM ,
42+ DFSIter ,
43+ Edge ,
4344 GET_ADJACENCY_BOTH ,
4445 GET_ADJACENCY_LOWER ,
4546 GET_ADJACENCY_UPPER ,
47+ GraphBase ,
4648 IN ,
49+ InternalError ,
4750 OUT ,
4851 REWIRING_SIMPLE ,
4952 REWIRING_SIMPLE_LOOPS ,
5760 TREE_IN ,
5861 TREE_OUT ,
5962 TREE_UNDIRECTED ,
60- WEAK ,
61- ARPACKOptions ,
62- BFSIter ,
63- DFSIter ,
64- Edge ,
65- GraphBase ,
66- InternalError ,
6763 Vertex ,
68- __igraph_version__ ,
69- )
70- from igraph ._igraph import arpack_options as default_arpack_options
71- from igraph ._igraph import (
64+ WEAK ,
65+ arpack_options as default_arpack_options ,
7266 community_to_membership ,
7367 convex_hull ,
7468 is_bigraphical ,
7973 set_random_number_generator ,
8074 set_status_handler ,
8175 umap_compute_weights ,
76+ __igraph_version__ ,
8277)
8378from igraph .adjacency import (
8479 _get_adjacency ,
8782 _get_biadjacency ,
8883 _get_inclist ,
8984)
90- from igraph .automorphisms import _count_automorphisms_vf2 , _get_automorphisms_vf2
85+ from igraph .automorphisms import (
86+ _count_automorphisms_vf2 ,
87+ _get_automorphisms_vf2 ,
88+ )
9189from igraph .basic import (
9290 _add_edge ,
9391 _add_edges ,
9492 _add_vertex ,
9593 _add_vertices ,
94+ _delete_edges ,
95+ _clear ,
9696 _as_directed ,
9797 _as_undirected ,
98- _clear ,
99- _delete_edges ,
10098)
10199from igraph .bipartite import (
100+ _maximum_bipartite_matching ,
102101 _bipartite_projection ,
103102 _bipartite_projection_size ,
104- _maximum_bipartite_matching ,
105- )
106- from igraph .clustering import (
107- Clustering ,
108- CohesiveBlocks ,
109- Cover ,
110- Dendrogram ,
111- VertexClustering ,
112- VertexCover ,
113- VertexDendrogram ,
114- _biconnected_components ,
115- _clusters ,
116- _cohesive_blocks ,
117- _connected_components ,
118- compare_communities ,
119- split_join_distance ,
120103)
121104from igraph .community import (
122- _community_edge_betweenness ,
123105 _community_fastgreedy ,
124106 _community_infomap ,
125- _community_label_propagation ,
126107 _community_leading_eigenvector ,
127- _community_leiden ,
108+ _community_label_propagation ,
128109 _community_multilevel ,
129110 _community_optimal_modularity ,
111+ _community_edge_betweenness ,
130112 _community_spinglass ,
131113 _community_voronoi ,
132114 _community_walktrap ,
133115 _k_core ,
116+ _community_leiden ,
134117 _modularity ,
135118)
136- from igraph .configuration import Configuration
137- from igraph .configuration import init as init_configuration
119+ from igraph .clustering import (
120+ Clustering ,
121+ VertexClustering ,
122+ Dendrogram ,
123+ VertexDendrogram ,
124+ Cover ,
125+ VertexCover ,
126+ CohesiveBlocks ,
127+ compare_communities ,
128+ split_join_distance ,
129+ _biconnected_components ,
130+ _cohesive_blocks ,
131+ _connected_components ,
132+ _clusters ,
133+ )
138134from igraph .cut import (
139135 Cut ,
140136 Flow ,
145141 _mincut ,
146142 _st_mincut ,
147143)
148- from igraph .datatypes import DyadCensus , Matrix , TriadCensus , UniqueIdGenerator
144+ from igraph .configuration import Configuration , init as init_configuration
149145from igraph .drawing import (
150146 BoundingBox ,
151147 CairoGraphDrawer ,
157153 plot ,
158154)
159155from igraph .drawing .colors import (
160- AdvancedGradientPalette ,
161- ClusterColoringPalette ,
162- GradientPalette ,
163156 Palette ,
164- PrecalculatedPalette ,
157+ GradientPalette ,
158+ AdvancedGradientPalette ,
165159 RainbowPalette ,
160+ PrecalculatedPalette ,
161+ ClusterColoringPalette ,
166162 color_name_to_rgb ,
167163 color_name_to_rgba ,
168- hsl_to_rgb ,
169- hsla_to_rgba ,
170164 hsv_to_rgb ,
171165 hsva_to_rgba ,
172- known_colors ,
173- palettes ,
174- rgb_to_hsl ,
166+ hsl_to_rgb ,
167+ hsla_to_rgba ,
175168 rgb_to_hsv ,
176- rgba_to_hsla ,
177169 rgba_to_hsva ,
170+ rgb_to_hsl ,
171+ rgba_to_hsla ,
172+ palettes ,
173+ known_colors ,
178174)
179175from igraph .drawing .graph import __plot__ as _graph_plot
180176from igraph .drawing .utils import autocurve
177+ from igraph .datatypes import Matrix , DyadCensus , TriadCensus , UniqueIdGenerator
181178from igraph .formula import construct_graph_from_formula
182179from igraph .io import _format_mapping
183- from igraph .io .adjacency import (
184- _construct_graph_from_adjacency ,
185- _construct_graph_from_weighted_adjacency ,
186- )
187- from igraph .io .bipartite import (
188- _construct_bipartite_graph ,
189- _construct_bipartite_graph_from_adjacency ,
190- _construct_full_bipartite_graph ,
191- _construct_random_bipartite_graph ,
192- )
193180from igraph .io .files import (
194- _construct_graph_from_adjacency_file ,
195- _construct_graph_from_dimacs_file ,
196- _construct_graph_from_file ,
197181 _construct_graph_from_graphmlz_file ,
182+ _construct_graph_from_dimacs_file ,
198183 _construct_graph_from_pickle_file ,
199184 _construct_graph_from_picklez_file ,
185+ _construct_graph_from_adjacency_file ,
186+ _construct_graph_from_file ,
200187 _write_graph_to_adjacency_file ,
201188 _write_graph_to_dimacs_file ,
202- _write_graph_to_file ,
203189 _write_graph_to_graphmlz_file ,
204190 _write_graph_to_pickle_file ,
205191 _write_graph_to_picklez_file ,
206- )
207- from igraph .io .images import _write_graph_to_svg
208- from igraph .io .libraries import (
209- _construct_graph_from_graph_tool ,
210- _construct_graph_from_networkx ,
211- _export_graph_to_graph_tool ,
212- _export_graph_to_networkx ,
192+ _write_graph_to_file ,
213193)
214194from igraph .io .objects import (
215- _construct_graph_from_dataframe ,
216- _construct_graph_from_dict_dict ,
217195 _construct_graph_from_dict_list ,
218- _construct_graph_from_list_dict ,
219- _construct_graph_from_tuple_list ,
220- _export_edge_dataframe ,
221- _export_graph_to_dict_dict ,
222196 _export_graph_to_dict_list ,
223- _export_graph_to_list_dict ,
197+ _construct_graph_from_tuple_list ,
224198 _export_graph_to_tuple_list ,
199+ _construct_graph_from_list_dict ,
200+ _export_graph_to_list_dict ,
201+ _construct_graph_from_dict_dict ,
202+ _export_graph_to_dict_dict ,
203+ _construct_graph_from_dataframe ,
225204 _export_vertex_dataframe ,
205+ _export_edge_dataframe ,
206+ )
207+ from igraph .io .adjacency import (
208+ _construct_graph_from_adjacency ,
209+ _construct_graph_from_weighted_adjacency ,
210+ )
211+ from igraph .io .libraries import (
212+ _construct_graph_from_networkx ,
213+ _export_graph_to_networkx ,
214+ _construct_graph_from_graph_tool ,
215+ _export_graph_to_graph_tool ,
216+ )
217+ from igraph .io .random import (
218+ _construct_random_geometric_graph ,
219+ )
220+ from igraph .io .bipartite import (
221+ _construct_bipartite_graph ,
222+ _construct_bipartite_graph_from_adjacency ,
223+ _construct_full_bipartite_graph ,
224+ _construct_random_bipartite_graph ,
226225)
227- from igraph .io .random import _construct_random_geometric_graph
226+ from igraph .io .images import _write_graph_to_svg
228227from igraph .layout import (
229228 Layout ,
230- _3d_version_for ,
231229 _layout ,
232230 _layout_auto ,
233- _layout_mapping ,
234- _layout_method_wrapper ,
235231 _layout_sugiyama ,
232+ _layout_method_wrapper ,
233+ _3d_version_for ,
234+ _layout_mapping ,
236235)
237236from igraph .matching import Matching
238- from igraph .operators import disjoint_union , intersection
239- from igraph .operators import operator_method_registry as _operator_method_registry
240- from igraph .operators import union
237+ from igraph .operators import (
238+ disjoint_union ,
239+ union ,
240+ intersection ,
241+ operator_method_registry as _operator_method_registry ,
242+ )
241243from igraph .seq import EdgeSeq , VertexSeq , _add_proxy_methods
242244from igraph .statistics import (
243245 FittedPowerLaw ,
246248 mean ,
247249 median ,
248250 percentile ,
249- power_law_fit ,
250251 quantile ,
252+ power_law_fit ,
251253)
252254from igraph .structural import (
253- _degree_distribution ,
254255 _indegree ,
255256 _outdegree ,
257+ _degree_distribution ,
256258 _pagerank ,
257259 _shortest_paths ,
258260)
259261from igraph .summary import GraphSummary , summary
260- from igraph .utils import deprecated , numpy_to_contiguous_memoryview , rescale
262+ from igraph .utils import (
263+ deprecated ,
264+ numpy_to_contiguous_memoryview ,
265+ rescale ,
266+ )
261267from igraph .version import __version__ , __version_info__
262268
269+ import os
270+ import sys
271+
263272
264273class Graph (GraphBase ):
265274 """Generic graph.
@@ -416,7 +425,7 @@ def __init__(self, *args, **kwds):
416425 # When 'edges' is a NumPy array or matrix, convert it into a memoryview
417426 # as the lower-level C API works with memoryviews only
418427 try :
419- from numpy import matrix , ndarray
428+ from numpy import ndarray , matrix
420429
421430 if isinstance (edges , (ndarray , matrix )):
422431 edges = numpy_to_contiguous_memoryview (edges )
@@ -1254,4 +1263,4 @@ def write(graph, filename, *args, **kwds):
12541263 "TREE_OUT" ,
12551264 "TREE_UNDIRECTED" ,
12561265 "WEAK" ,
1257- )
1266+ )
0 commit comments