Skip to content

Commit 62c1210

Browse files
committed
Fix more implicit noexcept warnings (automatic)
The previous run only fixed files in the sagemath-standard distribution, just because we started with a list of warnings produced when compiling just sagemath-standard. This time we apply the same strategy to files in the other distributions.
1 parent 131b747 commit 62c1210

File tree

8 files changed

+57
-57
lines changed

8 files changed

+57
-57
lines changed

src/sage/graphs/bliss.pyx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ cdef extern from "bliss_cpp/bliss_find_automorphisms.h":
6565
void bliss_find_automorphisms(Graph*, void (*)(void*, unsigned int, const unsigned int*), void*, Stats&)
6666
void bliss_find_automorphisms(Digraph*, void (*)(void*, unsigned int, const unsigned int*), void*, Stats&)
6767

68-
cdef int encoding_numbits(int n):
68+
cdef int encoding_numbits(int n) noexcept:
6969
r"""
7070
Return the number of bits needed to encode the `n` numbers from `1` to
7171
`n`. In other words, the last bit set in `n`.
@@ -79,7 +79,7 @@ cdef int encoding_numbits(int n):
7979
return i
8080

8181

82-
cdef void add_gen(void *user_param, unsigned int n, const unsigned int *aut):
82+
cdef void add_gen(void *user_param, unsigned int n, const unsigned int *aut) noexcept:
8383
r"""
8484
Function called each time a new generator of the automorphism group is
8585
found.
@@ -129,7 +129,7 @@ cdef void add_gen(void *user_param, unsigned int n, const unsigned int *aut):
129129
# constructing bliss graphs from edge lists
130130
#####################################################
131131

132-
cdef Graph *bliss_graph_from_labelled_edges(int Vnr, int Lnr, Vout, Vin, labels, partition):
132+
cdef Graph *bliss_graph_from_labelled_edges(int Vnr, int Lnr, Vout, Vin, labels, partition) noexcept:
133133
r"""
134134
Return a bliss graph from the input data
135135
@@ -220,7 +220,7 @@ cdef Graph *bliss_graph_from_labelled_edges(int Vnr, int Lnr, Vout, Vin, labels,
220220

221221
return g
222222

223-
cdef Digraph *bliss_digraph_from_labelled_edges(int Vnr, int Lnr, Vout, Vin, labels, partition):
223+
cdef Digraph *bliss_digraph_from_labelled_edges(int Vnr, int Lnr, Vout, Vin, labels, partition) noexcept:
224224
r"""
225225
Return a bliss digraph from the input data
226226
@@ -301,7 +301,7 @@ cdef Digraph *bliss_digraph_from_labelled_edges(int Vnr, int Lnr, Vout, Vin, lab
301301
#####################################################
302302

303303
cdef canonical_form_from_edge_list(int Vnr, list Vout, list Vin, int Lnr=1, list labels=[],
304-
list partition=None, bint directed=False, bint certificate=False):
304+
list partition=None, bint directed=False, bint certificate=False) noexcept:
305305
r"""
306306
Return an unsorted list of labelled edges of a canonical form.
307307
@@ -378,7 +378,7 @@ cdef canonical_form_from_edge_list(int Vnr, list Vout, list Vin, int Lnr=1, list
378378
return new_edges
379379

380380

381-
cpdef canonical_form(G, partition=None, return_graph=False, use_edge_labels=True, certificate=False):
381+
cpdef canonical_form(G, partition=None, return_graph=False, use_edge_labels=True, certificate=False) noexcept:
382382
r"""
383383
Return a canonical label for the given (di)graph.
384384
@@ -599,7 +599,7 @@ cpdef canonical_form(G, partition=None, return_graph=False, use_edge_labels=True
599599
#####################################################
600600

601601
cdef automorphism_group_gens_from_edge_list(int Vnr, Vout, Vin, int Lnr=1, labels=[],
602-
int2vert=[], partition=None, bint directed=False):
602+
int2vert=[], partition=None, bint directed=False) noexcept:
603603
r"""
604604
Return an unsorted list of labelled edges of a canonical form.
605605
@@ -650,7 +650,7 @@ cdef automorphism_group_gens_from_edge_list(int Vnr, Vout, Vin, int Lnr=1, label
650650

651651
return [[cyc for cyc in gen if cyc[0] is not None] for gen in gens]
652652

653-
cpdef automorphism_group(G, partition=None, use_edge_labels=True):
653+
cpdef automorphism_group(G, partition=None, use_edge_labels=True) noexcept:
654654
"""
655655
Return the automorphism group of the given (di)graph.
656656
@@ -848,7 +848,7 @@ cpdef automorphism_group(G, partition=None, use_edge_labels=True):
848848
# old direct interactions graphs <-> bliss graphs
849849
#####################################################
850850

851-
cdef Graph *bliss_graph(G, partition, vert2int, int2vert):
851+
cdef Graph *bliss_graph(G, partition, vert2int, int2vert) noexcept:
852852
r"""
853853
Return a bliss copy of a graph G
854854
@@ -882,7 +882,7 @@ cdef Graph *bliss_graph(G, partition, vert2int, int2vert):
882882
return g
883883

884884

885-
cdef Digraph *bliss_digraph(G, partition, vert2int, int2vert):
885+
cdef Digraph *bliss_digraph(G, partition, vert2int, int2vert) noexcept:
886886
r"""
887887
Return a bliss copy of a digraph G
888888

src/sage/graphs/graph_decompositions/tdlib.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ cdef extern from "sage_tdlib.cpp":
7676
# the following will be used implicitly to do the translation
7777
# between Sage graph encoding and BGL graph encoding.
7878

79-
cdef make_tdlib_graph(G, vertex_to_int, vector[unsigned int] &V, vector[unsigned int] &E):
79+
cdef make_tdlib_graph(G, vertex_to_int, vector[unsigned int] &V, vector[unsigned int] &E) noexcept:
8080
for i in range(G.order()):
8181
V.push_back(i)
8282

@@ -85,7 +85,7 @@ cdef make_tdlib_graph(G, vertex_to_int, vector[unsigned int] &V, vector[unsigned
8585
E.push_back(vertex_to_int[v])
8686

8787

88-
cdef make_sage_decomp(G, vector[vector[int]] &V, vector[unsigned int] &E, int_to_vertex):
88+
cdef make_sage_decomp(G, vector[vector[int]] &V, vector[unsigned int] &E, int_to_vertex) noexcept:
8989
cdef int i, j
9090
for i in range(len(V)):
9191
G.add_vertex(Set([int_to_vertex[j] for j in V[i]]))

src/sage/libs/coxeter3/coxeter.pxd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ cdef class CoxGroup(SageObject):
2121
cdef object cartan_type
2222
cdef dict in_ordering
2323
cdef dict out_ordering
24-
cpdef object full_context(self)
24+
cpdef object full_context(self) noexcept
2525

2626
cdef class CoxGroupElement:
2727
cdef c_CoxWord word
2828
cdef c_CoxGroup* group
2929
cdef CoxGroup _parent_group
30-
cdef CoxGroupElement _new(self)
31-
cpdef CoxGroup parent_group(self)
30+
cdef CoxGroupElement _new(self) noexcept
31+
cpdef CoxGroup parent_group(self) noexcept

src/sage/libs/coxeter3/coxeter.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ cdef class CoxGroup(SageObject):
540540
"""
541541
return isFiniteType(self.x)
542542

543-
cpdef full_context(self):
543+
cpdef full_context(self) noexcept:
544544
"""
545545
Make all of the elements of a finite Coxeter group available.
546546
@@ -741,7 +741,7 @@ cdef class CoxGroupElement:
741741

742742
inverse = __invert__
743743

744-
cpdef CoxGroup parent_group(self):
744+
cpdef CoxGroup parent_group(self) noexcept:
745745
"""
746746
Return the parent Coxeter group for this element.
747747
@@ -959,7 +959,7 @@ cdef class CoxGroupElement:
959959
cdef Generator ss = self._parent_group.in_ordering[s]
960960
return self.group.isDescent(self.word, s)
961961

962-
cdef CoxGroupElement _new(self):
962+
cdef CoxGroupElement _new(self) noexcept:
963963
"""
964964
Return a new copy of this element.
965965
"""
@@ -1130,7 +1130,7 @@ cdef class CoxGroupElement:
11301130
cdef CoxNbr y = self.group.extendContext(vv.word)
11311131
return ZZ(self.group.mu(x,y))
11321132

1133-
cdef LFlags_to_list(CoxGroup parent, LFlags f):
1133+
cdef LFlags_to_list(CoxGroup parent, LFlags f) noexcept:
11341134
"""
11351135
Return the right descent set of this element.
11361136

src/sage/libs/meataxe.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ cdef Matrix_t *rawMatrix(int Field, list entries) except NULL:
7171

7272
from sage.cpython.string cimport str_to_bytes, char_to_str
7373

74-
cdef void sage_meataxe_error_handler(const MtxErrorRecord_t *err):
74+
cdef void sage_meataxe_error_handler(const MtxErrorRecord_t *err) noexcept:
7575
sig_block()
7676
ErrText = char_to_str(err.Text)
7777
BaseName = char_to_str(err.FileInfo.BaseName)
7878
LineNo = err.LineNo
7979
PyErr_SetObject(ErrMsg.get(ErrText.split(': ')[-1], RuntimeError), f"{ErrText} in file {BaseName} (line {LineNo})")
8080
sig_unblock()
8181

82-
cdef inline meataxe_init():
82+
cdef inline meataxe_init() noexcept:
8383
## Assign to a variable that enables MeatAxe to find
8484
## its multiplication tables.
8585
global MtxLibDir

src/sage/libs/sirocco.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cdef extern from "sirocco.h":
2727
double* homotopyPath_comps(int degree, double *_coef, double _y0R, double _y0I, int nothercomps, int *degreescomps, double *_coefscomps)
2828

2929

30-
cpdef list[list] contpath_mp(int deg, list values, RealNumber y0r, RealNumber y0i, int prec):
30+
cpdef list[list] contpath_mp(int deg, list values, RealNumber y0r, RealNumber y0i, int prec) noexcept:
3131
"""
3232
Mimics :func:`contpath`, but with the following differences:
3333
@@ -88,7 +88,7 @@ cpdef list[list] contpath_mp(int deg, list values, RealNumber y0r, RealNumber y0
8888
free(rop)
8989
return l
9090

91-
cpdef list[list] contpath_mp_comps(int deg, list values, RealNumber y0r, RealNumber y0i, int prec, list otherdegs, list othercoefs):
91+
cpdef list[list] contpath_mp_comps(int deg, list values, RealNumber y0r, RealNumber y0i, int prec, list otherdegs, list othercoefs) noexcept:
9292
"""
9393
Mimics :func:`contpath`, but with the following differences:
9494
@@ -167,7 +167,7 @@ cpdef list[list] contpath_mp_comps(int deg, list values, RealNumber y0r, RealNum
167167
return l
168168

169169

170-
cpdef list[list] contpath(int deg, list values, double y0r, double y0i):
170+
cpdef list[list] contpath(int deg, list values, double y0r, double y0i) noexcept:
171171
"""
172172
INPUT:
173173
@@ -222,7 +222,7 @@ cpdef list[list] contpath(int deg, list values, double y0r, double y0i):
222222
free(c_values)
223223
return l
224224

225-
cpdef list[list] contpath_comps(int deg, list values, double y0r, double y0i, list otherdegrees, list othercoefs):
225+
cpdef list[list] contpath_comps(int deg, list values, double y0r, double y0i, list otherdegrees, list othercoefs) noexcept:
226226
"""
227227
INPUT:
228228

src/sage/matrix/matrix_gfpn_dense.pxd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ from sage.libs.meataxe cimport *
1818
cdef class FieldConverter_class:
1919
cdef field # A function converting an int to a field element
2020
cdef FEL zero_FEL # the FEL representation of zero
21-
cpdef fel_to_field(self, FEL x)
21+
cpdef fel_to_field(self, FEL x) noexcept
2222
cpdef FEL field_to_fel(self, x) except 255
2323

24-
cdef FieldConverter_class FieldConverter(field)
24+
cdef FieldConverter_class FieldConverter(field) noexcept
2525

2626
cdef class Matrix_gfpn_dense(Matrix_dense):
2727
cdef Matrix_t *Data
2828
cdef readonly FieldConverter_class _converter
2929

30-
cdef set_slice_unsafe(self, Py_ssize_t i, Matrix_gfpn_dense S)
31-
cdef inline int get_unsafe_int(self, Py_ssize_t i, Py_ssize_t j)
32-
cpdef Matrix_gfpn_dense get_slice(self, Py_ssize_t i, Py_ssize_t j)
33-
cpdef list _rowlist_(self, i, j=*)
34-
cpdef Matrix_gfpn_dense _multiply_classical(Matrix_gfpn_dense self, Matrix_gfpn_dense right)
35-
cpdef Matrix_gfpn_dense _multiply_strassen(Matrix_gfpn_dense self, Matrix_gfpn_dense right, cutoff=*)
30+
cdef set_slice_unsafe(self, Py_ssize_t i, Matrix_gfpn_dense S) noexcept
31+
cdef inline int get_unsafe_int(self, Py_ssize_t i, Py_ssize_t j) noexcept
32+
cpdef Matrix_gfpn_dense get_slice(self, Py_ssize_t i, Py_ssize_t j) noexcept
33+
cpdef list _rowlist_(self, i, j=*) noexcept
34+
cpdef Matrix_gfpn_dense _multiply_classical(Matrix_gfpn_dense self, Matrix_gfpn_dense right) noexcept
35+
cpdef Matrix_gfpn_dense _multiply_strassen(Matrix_gfpn_dense self, Matrix_gfpn_dense right, cutoff=*) noexcept
3636

37-
cdef Matrix_gfpn_dense new_mtx(Matrix_t* mat, Matrix_gfpn_dense template)
37+
cdef Matrix_gfpn_dense new_mtx(Matrix_t* mat, Matrix_gfpn_dense template) noexcept

0 commit comments

Comments
 (0)