Skip to content

Commit f0610b5

Browse files
committed
chore: updated generated code
1 parent 20bdbd5 commit f0610b5

File tree

2 files changed

+62
-10
lines changed

2 files changed

+62
-10
lines changed

src/igraph_ctypes/_internal/functions.py

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2950,14 +2950,14 @@ def degree_correlation_vector(graph: Graph, weights: Optional[Iterable[float]] =
29502950
"""Type-annotated wrapper for ``igraph_degree_correlation_vector``."""
29512951
# Prepare input arguments
29522952
c_graph = graph
2953-
c_knnk = _Vector.create(0)
29542953
c_weights = edge_weights_to_igraph_vector_t_view(weights, graph)
2954+
c_knnk = _Vector.create(0)
29552955
c_from_mode = c_int(from_mode)
29562956
c_to_mode = c_int(to_mode)
29572957
c_directed_neighbors = any_to_igraph_bool_t(directed_neighbors)
29582958

29592959
# Call wrapped function
2960-
igraph_degree_correlation_vector(c_graph, c_knnk, c_weights, c_from_mode, c_to_mode, c_directed_neighbors)
2960+
igraph_degree_correlation_vector(c_graph, c_weights, c_knnk, c_from_mode, c_to_mode, c_directed_neighbors)
29612961

29622962
# Prepare output arguments
29632963
knnk = igraph_vector_t_to_numpy_array(c_knnk)
@@ -3199,17 +3199,17 @@ def assortativity_degree(graph: Graph, directed: bool = True) -> float:
31993199
return res
32003200

32013201

3202-
def joint_degree_matrix(graph: Graph, max_out_degree: int = -1, max_in_degree: int = -1, weights: Optional[Iterable[float]] = None) -> RealArray:
3202+
def joint_degree_matrix(graph: Graph, weights: Optional[Iterable[float]] = None, max_out_degree: int = -1, max_in_degree: int = -1) -> RealArray:
32033203
"""Type-annotated wrapper for ``igraph_joint_degree_matrix``."""
32043204
# Prepare input arguments
32053205
c_graph = graph
3206+
c_weights = edge_weights_to_igraph_vector_t_view(weights, graph)
32063207
c_jdm = _Matrix.create(0)
32073208
c_max_out_degree = max_out_degree
32083209
c_max_in_degree = max_in_degree
3209-
c_weights = edge_weights_to_igraph_vector_t_view(weights, graph)
32103210

32113211
# Call wrapped function
3212-
igraph_joint_degree_matrix(c_graph, c_jdm, c_max_out_degree, c_max_in_degree, c_weights)
3212+
igraph_joint_degree_matrix(c_graph, c_weights, c_jdm, c_max_out_degree, c_max_in_degree)
32133213

32143214
# Prepare output arguments
32153215
jdm = igraph_matrix_t_to_numpy_array(c_jdm)
@@ -3218,6 +3218,50 @@ def joint_degree_matrix(graph: Graph, max_out_degree: int = -1, max_in_degree: i
32183218
return jdm
32193219

32203220

3221+
def joint_degree_distribution(graph: Graph, weights: Optional[Iterable[float]] = None, from_mode: NeighborMode = NeighborMode.OUT, to_mode: NeighborMode = NeighborMode.IN, directed_neighbors: bool = True, normalized: bool = True, max_from_degree: int = -1, max_to_degree: int = -1) -> RealArray:
3222+
"""Type-annotated wrapper for ``igraph_joint_degree_distribution``."""
3223+
# Prepare input arguments
3224+
c_graph = graph
3225+
c_weights = edge_weights_to_igraph_vector_t_view(weights, graph)
3226+
c_p = _Matrix.create(0)
3227+
c_from_mode = c_int(from_mode)
3228+
c_to_mode = c_int(to_mode)
3229+
c_directed_neighbors = any_to_igraph_bool_t(directed_neighbors)
3230+
c_normalized = any_to_igraph_bool_t(normalized)
3231+
c_max_from_degree = max_from_degree
3232+
c_max_to_degree = max_to_degree
3233+
3234+
# Call wrapped function
3235+
igraph_joint_degree_distribution(c_graph, c_weights, c_p, c_from_mode, c_to_mode, c_directed_neighbors, c_normalized, c_max_from_degree, c_max_to_degree)
3236+
3237+
# Prepare output arguments
3238+
p = igraph_matrix_t_to_numpy_array(c_p)
3239+
3240+
# Construct return value
3241+
return p
3242+
3243+
3244+
def joint_type_distribution(graph: Graph, from_types: Iterable[int], weights: Optional[Iterable[float]] = None, to_types: Optional[Iterable[int]] = None, directed: bool = True, normalized: bool = True) -> RealArray:
3245+
"""Type-annotated wrapper for ``igraph_joint_type_distribution``."""
3246+
# Prepare input arguments
3247+
c_graph = graph
3248+
c_weights = edge_weights_to_igraph_vector_t_view(weights, graph)
3249+
c_p = _Matrix.create(0)
3250+
c_from_types = iterable_to_igraph_vector_int_t_view(from_types)
3251+
c_to_types = iterable_to_igraph_vector_int_t_view(to_types)
3252+
c_directed = any_to_igraph_bool_t(directed)
3253+
c_normalized = any_to_igraph_bool_t(normalized)
3254+
3255+
# Call wrapped function
3256+
igraph_joint_type_distribution(c_graph, c_weights, c_p, c_from_types, c_to_types, c_directed, c_normalized)
3257+
3258+
# Prepare output arguments
3259+
p = igraph_matrix_t_to_numpy_array(c_p)
3260+
3261+
# Construct return value
3262+
return p
3263+
3264+
32213265
def contract_vertices(graph: Graph, mapping: Iterable[int], vertex_attr_comb: Optional[AttributeCombinationSpecification] = None) -> None:
32223266
"""Type-annotated wrapper for ``igraph_contract_vertices``."""
32233267
# Prepare input arguments
@@ -4664,7 +4708,7 @@ def community_spinglass(graph: Graph, weights: Optional[Iterable[float]] = None,
46644708
return modularity, temperature, membership, csize
46654709

46664710

4667-
def community_spinglass_single(graph: Graph, vertex: int, weights: Optional[Iterable[float]] = None, spins: int = 25, update_rule: SpinglassUpdateMode = SpinglassUpdateMode.CONFIG, gamma: float = 1.0) -> tuple[IntArray, float, float, int, int]:
4711+
def community_spinglass_single(graph: Graph, vertex: int, weights: Optional[Iterable[float]] = None, spins: int = 25, update_rule: SpinglassUpdateMode = SpinglassUpdateMode.CONFIG, gamma: float = 1.0) -> tuple[IntArray, float, float, float, float]:
46684712
"""Type-annotated wrapper for ``igraph_community_spinglass_single``."""
46694713
# Prepare input arguments
46704714
c_graph = graph
@@ -4673,8 +4717,8 @@ def community_spinglass_single(graph: Graph, vertex: int, weights: Optional[Iter
46734717
c_community = _VectorInt.create(0)
46744718
c_cohesion = igraph_real_t()
46754719
c_adhesion = igraph_real_t()
4676-
c_inner_links = igraph_integer_t()
4677-
c_outer_links = igraph_integer_t()
4720+
c_inner_links = igraph_real_t()
4721+
c_outer_links = igraph_real_t()
46784722
c_spins = spins
46794723
c_update_rule = c_int(update_rule)
46804724
c_gamma = gamma

src/igraph_ctypes/_internal/lib.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,15 @@ def _load_libc():
13531353

13541354
igraph_joint_degree_matrix = _lib.igraph_joint_degree_matrix
13551355
igraph_joint_degree_matrix.restype = handle_igraph_error_t
1356-
igraph_joint_degree_matrix.argtypes = [POINTER(igraph_t), POINTER(igraph_matrix_t), igraph_integer_t, igraph_integer_t, POINTER(igraph_vector_t)]
1356+
igraph_joint_degree_matrix.argtypes = [POINTER(igraph_t), POINTER(igraph_vector_t), POINTER(igraph_matrix_t), igraph_integer_t, igraph_integer_t]
1357+
1358+
igraph_joint_degree_distribution = _lib.igraph_joint_degree_distribution
1359+
igraph_joint_degree_distribution.restype = handle_igraph_error_t
1360+
igraph_joint_degree_distribution.argtypes = [POINTER(igraph_t), POINTER(igraph_vector_t), POINTER(igraph_matrix_t), igraph_neimode_t, igraph_neimode_t, igraph_bool_t, igraph_bool_t, igraph_integer_t, igraph_integer_t]
1361+
1362+
igraph_joint_type_distribution = _lib.igraph_joint_type_distribution
1363+
igraph_joint_type_distribution.restype = handle_igraph_error_t
1364+
igraph_joint_type_distribution.argtypes = [POINTER(igraph_t), POINTER(igraph_vector_t), POINTER(igraph_matrix_t), POINTER(igraph_vector_int_t), POINTER(igraph_vector_int_t), igraph_bool_t, igraph_bool_t]
13571365

13581366
igraph_contract_vertices = _lib.igraph_contract_vertices
13591367
igraph_contract_vertices.restype = handle_igraph_error_t
@@ -1721,7 +1729,7 @@ def _load_libc():
17211729

17221730
igraph_community_spinglass_single = _lib.igraph_community_spinglass_single
17231731
igraph_community_spinglass_single.restype = handle_igraph_error_t
1724-
igraph_community_spinglass_single.argtypes = [POINTER(igraph_t), POINTER(igraph_vector_t), igraph_integer_t, POINTER(igraph_vector_int_t), POINTER(igraph_real_t), POINTER(igraph_real_t), POINTER(igraph_integer_t), POINTER(igraph_integer_t), igraph_integer_t, igraph_spincomm_update_t, igraph_real_t]
1732+
igraph_community_spinglass_single.argtypes = [POINTER(igraph_t), POINTER(igraph_vector_t), igraph_integer_t, POINTER(igraph_vector_int_t), POINTER(igraph_real_t), POINTER(igraph_real_t), POINTER(igraph_real_t), POINTER(igraph_real_t), igraph_integer_t, igraph_spincomm_update_t, igraph_real_t]
17251733

17261734
igraph_community_walktrap = _lib.igraph_community_walktrap
17271735
igraph_community_walktrap.restype = handle_igraph_error_t

0 commit comments

Comments
 (0)