@@ -6512,12 +6512,12 @@ PyObject *igraphmodule_Graph_permute_vertices(igraphmodule_GraphObject *self,
65126512PyObject *igraphmodule_Graph_rewire(igraphmodule_GraphObject * self,
65136513 PyObject * args, PyObject * kwds)
65146514{
6515- static char *kwlist[] = { "n", "mode ", NULL };
6516- PyObject *n_o = Py_None, *mode_o = Py_None;
6515+ static char *kwlist[] = { "n", "allowed_edge_types ", NULL };
6516+ PyObject *n_o = Py_None, *allowed_edge_types_o = Py_None;
65176517 igraph_integer_t n = 10 * igraph_ecount(&self->g); /* TODO overflow check */
6518- igraph_rewiring_t mode = IGRAPH_REWIRING_SIMPLE ;
6518+ igraph_edge_type_sw_t allowed_edge_types = IGRAPH_SIMPLE_SW ;
65196519
6520- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist, &n_o, &mode_o )) {
6520+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist, &n_o, &allowed_edge_types_o )) {
65216521 return NULL;
65226522 }
65236523
@@ -6527,11 +6527,11 @@ PyObject *igraphmodule_Graph_rewire(igraphmodule_GraphObject * self,
65276527 }
65286528 }
65296529
6530- if (igraphmodule_PyObject_to_rewiring_t(mode_o , &mode )) {
6530+ if (igraphmodule_PyObject_to_edge_type_sw_t(allowed_edge_types_o , &allowed_edge_types )) {
65316531 return NULL;
65326532 }
65336533
6534- if (igraph_rewire(&self->g, n, mode )) {
6534+ if (igraph_rewire(&self->g, n, allowed_edge_types )) {
65356535 igraphmodule_handle_igraph_error();
65366536 return NULL;
65376537 }
@@ -16281,7 +16281,7 @@ struct PyMethodDef igraphmodule_Graph_methods[] = {
1628116281 /* interface to igraph_rewire */
1628216282 {"rewire", (PyCFunction) igraphmodule_Graph_rewire,
1628316283 METH_VARARGS | METH_KEYWORDS,
16284- "rewire(n=None, mode =\"simple\")\n--\n\n"
16284+ "rewire(n=None, allowed_edge_types =\"simple\")\n--\n\n"
1628516285 "Randomly rewires the graph while preserving the degree distribution.\n\n"
1628616286 "The rewiring is done \"in-place\", so the original graph will be modified.\n"
1628716287 "If you want to preserve the original graph, use the L{copy} method before\n"
0 commit comments