6666)
6767from .types import (
6868 igraph_bool_t ,
69- igraph_integer_t ,
69+ igraph_int_t ,
7070 igraph_real_t ,
7171 np_type_of_igraph_bool_t ,
72- np_type_of_igraph_integer_t ,
72+ np_type_of_igraph_int_t ,
7373 np_type_of_igraph_real_t ,
7474 AttributeCombinationSpecification ,
7575 AttributeCombinationSpecificationEntry ,
107107 "any_to_file_ptr" ,
108108 "any_to_igraph_bool_t" ,
109109 "bytes_to_str" ,
110- "edgelike_to_igraph_integer_t " ,
110+ "edgelike_to_igraph_int_t " ,
111111 "edge_capacities_to_igraph_vector_t" ,
112112 "edge_capacities_to_igraph_vector_t_view" ,
113113 "edge_colors_to_igraph_vector_t" ,
148148 "sequence_to_igraph_matrix_int_t_view" ,
149149 "sequence_to_igraph_matrix_t" ,
150150 "sequence_to_igraph_matrix_t_view" ,
151- "vertexlike_to_igraph_integer_t " ,
151+ "vertexlike_to_igraph_int_t " ,
152152 "vertex_pairs_to_igraph_vector_int_t" ,
153153 "vertex_selector_to_igraph_vs_t" ,
154154 "vertex_colors_to_igraph_vector_int_t" ,
155155 "vertex_colors_to_igraph_vector_int_t_view" ,
156- "vertex_qtys_to_igraph_vector_t " ,
157- "vertex_qtys_to_igraph_vector_t_view " ,
156+ "vertex_qty_to_igraph_vector_t " ,
157+ "vertex_qty_to_igraph_vector_t_view " ,
158158 "vertex_weights_to_igraph_vector_t" ,
159159 "vertex_weights_to_igraph_vector_t_view" ,
160160)
@@ -228,10 +228,10 @@ def any_to_igraph_bool_t(obj: Any) -> igraph_bool_t:
228228 return igraph_bool_t (bool (obj ))
229229
230230
231- def edgelike_to_igraph_integer_t (edge : EdgeLike ) -> igraph_integer_t :
231+ def edgelike_to_igraph_int_t (edge : EdgeLike ) -> igraph_int_t :
232232 """Converts an edge-like object to an igraph integer."""
233233 if isinstance (edge , int ) and edge >= 0 :
234- return igraph_integer_t (edge )
234+ return igraph_int_t (edge )
235235 else :
236236 raise ValueError (f"{ edge !r} cannot be converted to an igraph edge index" )
237237
@@ -251,7 +251,7 @@ def edge_selector_to_igraph_es_t(selector: EdgeSelector, graph: Graph) -> _EdgeS
251251 indices = iterable_edge_indices_to_igraph_vector_int_t (selector ) # type: ignore
252252 return _EdgeSelector .create_with (igraph_es_vector_copy , indices )
253253 else :
254- index = edgelike_to_igraph_integer_t (selector ) # type: ignore
254+ index = edgelike_to_igraph_int_t (selector ) # type: ignore
255255 return _EdgeSelector .create_with (igraph_es_1 , index )
256256
257257
@@ -312,7 +312,7 @@ def iterable_edge_indices_to_igraph_vector_int_t(
312312
313313 result = _VectorInt .create (0 )
314314 for index in indices :
315- igraph_vector_int_push_back (result , edgelike_to_igraph_integer_t (index ))
315+ igraph_vector_int_push_back (result , edgelike_to_igraph_int_t (index ))
316316 return result
317317
318318
@@ -399,7 +399,7 @@ def iterable_vertex_indices_to_igraph_vector_int_t(
399399
400400 result : _VectorInt = _VectorInt .create (0 )
401401 for index in indices :
402- igraph_vector_int_push_back (result , vertexlike_to_igraph_integer_t (index ))
402+ igraph_vector_int_push_back (result , vertexlike_to_igraph_int_t (index ))
403403 return result
404404
405405
@@ -502,7 +502,7 @@ def sequence_to_igraph_matrix_int_t(items: MatrixIntLike) -> _MatrixInt:
502502 else :
503503 _ensure_matrix (items )
504504 return numpy_array_to_igraph_matrix_int_t (
505- np .array (items , dtype = np_type_of_igraph_integer_t )
505+ np .array (items , dtype = np_type_of_igraph_int_t )
506506 )
507507
508508
@@ -589,10 +589,10 @@ def numpy_array_to_igraph_matrix_t(arr: np.ndarray) -> _Matrix:
589589
590590def numpy_array_to_igraph_matrix_int_t (arr : np .ndarray ) -> _MatrixInt :
591591 """Converts a two-dimensional NumPy array to an igraph matrix of integers."""
592- arr = _force_into_2d_numpy_array (arr , np_type_of_igraph_integer_t )
592+ arr = _force_into_2d_numpy_array (arr , np_type_of_igraph_int_t )
593593 return _MatrixInt .create_with (
594594 igraph_matrix_int_init_array ,
595- arr .ctypes .data_as (POINTER (igraph_integer_t )),
595+ arr .ctypes .data_as (POINTER (igraph_int_t )),
596596 arr .shape [0 ],
597597 arr .shape [1 ],
598598 MatrixStorage .COLUMN_MAJOR ,
@@ -637,10 +637,10 @@ def numpy_array_to_igraph_vector_int_t(
637637 arr : np .ndarray , flatten : bool = False
638638) -> _VectorInt :
639639 """Converts a one-dimensional NumPy array to an igraph vector of integers."""
640- arr = _force_into_1d_numpy_array (arr , np_type_of_igraph_integer_t , flatten = flatten )
640+ arr = _force_into_1d_numpy_array (arr , np_type_of_igraph_int_t , flatten = flatten )
641641 return _VectorInt .create_with (
642642 igraph_vector_int_init_array ,
643- arr .ctypes .data_as (POINTER (igraph_integer_t )),
643+ arr .ctypes .data_as (POINTER (igraph_int_t )),
644644 arr .shape [0 ],
645645 )
646646
@@ -654,11 +654,11 @@ def numpy_array_to_igraph_vector_int_t_view(
654654 into the appropriate layout and data type first and then a view will be
655655 provided into the copy.
656656 """
657- arr = _force_into_1d_numpy_array (arr , np_type_of_igraph_integer_t , flatten = flatten )
657+ arr = _force_into_1d_numpy_array (arr , np_type_of_igraph_int_t , flatten = flatten )
658658
659659 result = _VectorInt ()
660660 igraph_vector_int_view (
661- result , arr .ctypes .data_as (POINTER (igraph_integer_t )), arr .shape [0 ]
661+ result , arr .ctypes .data_as (POINTER (igraph_int_t )), arr .shape [0 ]
662662 )
663663
664664 # Destructor must not be called so we never mark result as initialized;
@@ -697,10 +697,10 @@ def numpy_array_to_igraph_vector_t_view(
697697 return result
698698
699699
700- def vertexlike_to_igraph_integer_t (vertex : VertexLike ) -> igraph_integer_t :
700+ def vertexlike_to_igraph_int_t (vertex : VertexLike ) -> igraph_int_t :
701701 """Converts a vertex-like object to an igraph integer."""
702702 if isinstance (vertex , int ) and vertex >= 0 :
703- return igraph_integer_t (vertex )
703+ return igraph_int_t (vertex )
704704 else :
705705 raise ValueError (f"{ vertex !r} cannot be converted to an igraph vertex index" )
706706
@@ -714,8 +714,8 @@ def vertex_pairs_to_igraph_vector_int_t(pairs: Iterable[VertexPair]) -> _VectorI
714714
715715 result : _VectorInt = _VectorInt .create (0 )
716716 for u , v in pairs :
717- igraph_vector_int_push_back (result , vertexlike_to_igraph_integer_t (u ))
718- igraph_vector_int_push_back (result , vertexlike_to_igraph_integer_t (v ))
717+ igraph_vector_int_push_back (result , vertexlike_to_igraph_int_t (u ))
718+ igraph_vector_int_push_back (result , vertexlike_to_igraph_int_t (v ))
719719 return result
720720
721721
@@ -738,7 +738,7 @@ def vertex_selector_to_igraph_vs_t(
738738 )
739739 return _VertexSelector .create_with (igraph_vs_vector_copy , indices )
740740 else :
741- index = vertexlike_to_igraph_integer_t (selector ) # type: ignore
741+ index = vertexlike_to_igraph_int_t (selector ) # type: ignore
742742 return _VertexSelector .create_with (igraph_vs_1 , index )
743743
744744
@@ -758,14 +758,14 @@ def vertex_colors_to_igraph_vector_int_t_view(
758758 return iterable_to_igraph_vector_int_t_view (colors )
759759
760760
761- def vertex_qtys_to_igraph_vector_t (weights : Iterable [float ], graph : Graph ) -> _Vector :
761+ def vertex_qty_to_igraph_vector_t (weights : Iterable [float ], graph : Graph ) -> _Vector :
762762 """Converts a Python iterable of floating-point numbers to a vector of
763763 vertex-related quantities.
764764 """
765765 return iterable_to_igraph_vector_t (weights )
766766
767767
768- def vertex_qtys_to_igraph_vector_t_view (
768+ def vertex_qty_to_igraph_vector_t_view (
769769 weights : Optional [Iterable [float ]], graph : Graph
770770) -> Optional [_Vector ]:
771771 """Converts a Python iterable of floating-point numbers to a vector of
@@ -830,7 +830,7 @@ def igraph_matrix_t_to_numpy_array(matrix: _Matrix) -> RealArray:
830830
831831def igraph_matrix_int_t_to_numpy_array (matrix : _MatrixInt ) -> IntArray :
832832 shape = igraph_matrix_int_nrow (matrix ), igraph_matrix_int_ncol (matrix )
833- result = np .zeros (shape , dtype = np_type_of_igraph_integer_t )
833+ result = np .zeros (shape , dtype = np_type_of_igraph_int_t )
834834 if result .size > 0 :
835835 memmove (result .ctypes .data , matrix .unwrap ().data .stor_begin , result .nbytes )
836836 return result
@@ -872,7 +872,7 @@ def igraph_vector_bool_t_to_numpy_array_view(vector: _VectorBool) -> BoolArray:
872872
873873def igraph_vector_int_t_to_numpy_array (vector : _VectorInt ) -> IntArray :
874874 n = igraph_vector_int_size (vector )
875- result = np .zeros (n , dtype = np_type_of_igraph_integer_t )
875+ result = np .zeros (n , dtype = np_type_of_igraph_int_t )
876876 if n > 0 :
877877 memmove (result .ctypes .data , igraph_vector_int_get_ptr (vector , 0 ), result .nbytes )
878878 return result
@@ -881,9 +881,9 @@ def igraph_vector_int_t_to_numpy_array(vector: _VectorInt) -> IntArray:
881881def igraph_vector_int_t_to_numpy_array_view (vector : _VectorInt ) -> IntArray :
882882 n = igraph_vector_int_size (vector )
883883 addr = addressof (igraph_vector_int_get_ptr (vector , 0 ).contents )
884- buf_type = igraph_integer_t * n
884+ buf_type = igraph_int_t * n
885885 buf = buf_type .from_address (addr )
886- return np .frombuffer (buf , dtype = np_type_of_igraph_integer_t )
886+ return np .frombuffer (buf , dtype = np_type_of_igraph_int_t )
887887
888888
889889def igraph_vector_list_t_to_list_of_numpy_array (
0 commit comments