From 335728d39637ee57bf8ff42f2b7a10a9e339ab85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 18 Jan 2025 20:16:36 +0100 Subject: [PATCH] some fixes after cython-lint --- .../projective_ds_helper.pyx | 6 +- .../complex_dynamics/mandel_julia_helper.pyx | 176 +++++++++--------- src/sage/interacts/library_cython.pyx | 10 +- src/sage/matroids/matroid.pyx | 6 +- src/sage/quadratic_forms/ternary.pyx | 2 +- src/sage/quivers/algebra_elements.pyx | 14 +- .../elliptic_curves/period_lattice_region.pyx | 6 +- src/sage/schemes/toric/divisor_class.pyx | 4 +- src/sage/structure/list_clone_demo.pyx | 9 +- src/sage/symbolic/pynac_function_impl.pxi | 12 +- 10 files changed, 128 insertions(+), 117 deletions(-) diff --git a/src/sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx b/src/sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx index 1da1efc2bd7..453e0bc0b97 100644 --- a/src/sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx +++ b/src/sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx @@ -70,10 +70,10 @@ cpdef _fast_possible_periods(self, return_points=False): - More space efficient hash/point-table. """ - cdef int i, k, N + cdef int i, N cdef int hash_p, hash_q cdef int index, startindex - cdef list pointslist, points_periods + cdef list points_periods cdef list P, Q cdef set periods, lorders, rvalues @@ -88,7 +88,7 @@ cpdef _fast_possible_periods(self, return_points=False): p = PS.base_ring().order() N = int(PS.dimension_relative()) - point_table = [[0,0] for i in range(p**(N + 1))] + point_table = [[0, 0] for i in range(p**(N + 1))] index = 1 periods = set() points_periods = [] diff --git a/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx b/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx index 2fd00e9b07a..8ed94e11d5c 100644 --- a/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx +++ b/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx @@ -60,10 +60,11 @@ def _color_to_RGB(color): cpdef fast_mandelbrot_plot(double x_center, double y_center, - double image_width, long max_iteration, long pixel_count, - long level_sep, long color_num, base_color): + double image_width, long max_iteration, + long pixel_count, + long level_sep, long color_num, base_color): r""" - Plots the Mandelbrot set in the complex plane for the map `Q_c(z) = z^2 + c`. + Plot the Mandelbrot set in the complex plane for the map `Q_c(z) = z^2 + c`. ALGORITHM: @@ -115,14 +116,14 @@ cpdef fast_mandelbrot_plot(double x_center, double y_center, cdef: M, pixel, color_list - long i, j, col, row, level, color_value, iteration - double k, x_corner, y_corner, step_size, x_coor, y_coor, new_x, new_y + long i, j, col, row, level, iteration + double x_corner, y_corner, step_size, x_coor, y_coor, new_x, new_y # Make sure image_width is positive image_width = abs(image_width) # Initialize an image to the color black and access the pixels - M = Image("RGB", (pixel_count,pixel_count), 'black') + M = Image("RGB", (pixel_count, pixel_count), 'black') pixel = M.pixels() # Take the given base color and create a list of evenly spaced @@ -156,7 +157,7 @@ cpdef fast_mandelbrot_plot(double x_center, double y_center, while (new_x**2 + new_y**2 <= 4.0 and iteration < max_iteration): sig_check() new_x, new_y = new_x**2 - new_y**2 + x_coor, \ - 2*new_x*new_y + y_coor + 2*new_x*new_y + y_coor iteration += 1 # If the point escapes to infinity, assign the point a color @@ -177,7 +178,8 @@ cpdef fast_mandelbrot_plot(double x_center, double y_center, cpdef fast_external_ray(double theta, long D=30, long S=10, long R=100, - long pixel_count=500, double image_width=4, long prec=300): + long pixel_count=500, double image_width=4, + long prec=300): r""" Return a list of points that approximate the external ray for a given angle. @@ -241,7 +243,7 @@ cpdef fast_external_ray(double theta, long D=30, long S=10, long R=100, CF = ComplexField(prec) PI = CF.pi() I = CF.gen() - c_0, r_m, t_m, temp_c, C_k, D_k, old_c, x, y, dist + r_m, t_m, temp_c, C_k, D_k, old_c, x, y, dist int k, j, t double difference, m double error = pixel_count * 0.0001 @@ -252,8 +254,8 @@ cpdef fast_external_ray(double theta, long D=30, long S=10, long R=100, c_list = [CF(R*exp(2*PI*I*theta))] # Loop through each subinterval and approximate point on external ray. - for k in range(1,D+1): - for j in range(1,S+1): + for k in range(1, D+1): + for j in range(1, S+1): m = (k-1)*S + j r_m = CF(R**(2**(-m/S))) t_m = CF(r_m**(2**k) * exp(2*PI*I*theta * 2**k)) @@ -280,13 +282,13 @@ cpdef fast_external_ray(double theta, long D=30, long S=10, long R=100, # Convert Complex Field elements into tuples. for k in range(len(c_list)): - x,y = c_list[k].real(), c_list[k].imag() + x, y = c_list[k].real(), c_list[k].imag() c_list[k] = (x, y) return c_list cpdef convert_to_pixels(point_list, double x_0, double y_0, double width, - long number_of_pixels): + long number_of_pixels): r""" Convert cartesian coordinates to pixels within a specified window. @@ -330,7 +332,7 @@ cpdef convert_to_pixels(point_list, double x_0, double y_0, double width, cpdef get_line(start, end): r""" - Produces a list of pixel coordinates approximating a line from a starting + Produce a list of pixel coordinates approximating a line from a starting point to an ending point using the Bresenham's Line Algorithm. REFERENCE: @@ -405,17 +407,19 @@ cpdef get_line(start, end): return points # Commented out temporarily for safekeeping, but probably should be deleted -#def fast_julia_plot(double c_real, double c_imag, -# double x_center, double y_center, double image_width, -# long max_iteration, long pixel_count, long level_sep, -# long color_num, base_color): +# def fast_julia_plot(double c_real, double c_imag, +# double x_center, double y_center, double image_width, +# long max_iteration, long pixel_count, long level_sep, +# long color_num, base_color): cpdef fast_julia_plot(double c_real, double c_imag, - double x_center=0, double y_center=0, double image_width=4, - long max_iteration=500, long pixel_count=500, long level_sep=2, - long color_num=40, base_color=[50, 50, 50]): + double x_center=0, double y_center=0, + double image_width=4, + long max_iteration=500, long pixel_count=500, + long level_sep=2, + long color_num=40, base_color=[50, 50, 50]): r""" - Plots the Julia set for a given `c` value in the complex plane for the map `Q_c(z) = z^2 + c`. + Plot the Julia set for a given `c` value in the complex plane for the map `Q_c(z) = z^2 + c`. INPUT: @@ -460,9 +464,9 @@ cpdef fast_julia_plot(double c_real, double c_imag, """ cdef: - M, pixel, color_list - long i, j, col, row, level, color_value, iteration - double k, x_corner, y_corner, step_size, x_coor, y_coor, new_x, new_y, escape_radius_squared + color_list + long i, j, col, row, level, iteration + double x_corner, y_corner, step_size, x_coor, y_coor, new_x, new_y, escape_radius_squared # Make sure image_width is positive image_width = abs(image_width) @@ -472,7 +476,7 @@ cpdef fast_julia_plot(double c_real, double c_imag, escape_radius_squared = ((1.0 + sqrt(1.0 + 4.0*sqrt(c_real**2 + c_imag**2))))**2/4.0 # Initialize an image to the color black and access the pixels - J = Image("RGB", (pixel_count,pixel_count), 'black') + J = Image("RGB", (pixel_count, pixel_count), 'black') Jp = J.pixels() # Take the given base color and create a list of evenly spaced @@ -507,7 +511,7 @@ cpdef fast_julia_plot(double c_real, double c_imag, while (new_x**2 + new_y**2 <= escape_radius_squared and iteration < max_iteration): sig_check() new_x, new_y = new_x**2 - new_y**2 + c_real, \ - 2*new_x*new_y + c_imag + 2*new_x*new_y + c_imag iteration += 1 # If the point escapes to infinity, assign the point a color @@ -521,16 +525,17 @@ cpdef fast_julia_plot(double c_real, double c_imag, # Assign the pixel a color based on it's level. If we run out # of colors, assign it the last color in the list. if level < color_num: - Jp[col,row] = color_list[level] + Jp[col, row] = color_list[level] else: - Jp[col,row] = color_list[-1] + Jp[col, row] = color_list[-1] return J cpdef julia_helper(double c_real, double c_imag, double x_center=0, - double y_center=0, double image_width=4, long max_iteration=500, - long pixel_count=500, long level_sep=2, long color_num=40, - base_color=[50, 50, 50], point_color=[255, 0, 0]): + double y_center=0, double image_width=4, + long max_iteration=500, + long pixel_count=500, long level_sep=2, long color_num=40, + base_color=[50, 50, 50], point_color=[255, 0, 0]): r""" Helper function that returns the image of a Julia set for a given `c` value side by side with the Mandelbrot set with a point denoting @@ -584,44 +589,47 @@ cpdef julia_helper(double c_real, double c_imag, double x_center=0, # Initialize the Julia set J = fast_julia_plot(c_real, c_imag, x_center, y_center, image_width, - max_iteration, pixel_count, level_sep, color_num, base_color) + max_iteration, pixel_count, level_sep, + color_num, base_color) Jp = J.pixels() # Initialize the image with Julia set on left side # Add white border between images - G = Image("RGB", (2*pixel_count+1,pixel_count), 'white') + G = Image("RGB", (2*pixel_count+1, pixel_count), 'white') Gp = G.pixels() for i in range(pixel_count): for j in range(pixel_count): - Gp[i,j] = Jp[i,j] + Gp[i, j] = Jp[i, j] # Plot the Mandelbrot set on the right side M = fast_mandelbrot_plot(-1, 0, 4, 500, pixel_count, 1, 30, base_color) Mp = M.pixels() - for i in range(pixel_count+1,2*pixel_count): + for i in range(pixel_count+1, 2*pixel_count): for j in range(pixel_count): - Gp[i,j] = Mp[int(i-pixel_count),j] + Gp[i, j] = Mp[int(i-pixel_count), j] point_color = _color_to_RGB(point_color) # Add a cross representing c-value to the Mandelbrot set. CP = convert_to_pixels([(c_real, c_imag)], -1, 0, 4, pixel_count) - for i in range(-3,4): + for i in range(-3, 4): # Loop through x and y coordinates and check if they are in image if min(CP[0][0]+i, CP[0][1]) >= 0 and \ - max(CP[0][0]+i, CP[0][1]) < pixel_count: + max(CP[0][0]+i, CP[0][1]) < pixel_count: Gp[CP[0][0]+i+pixel_count+1, CP[0][1]] = tuple(point_color) if min(CP[0][0], CP[0][1]+i) >= 0 and \ - max(CP[0][0], CP[0][1]+i) < pixel_count: + max(CP[0][0], CP[0][1]+i) < pixel_count: Gp[CP[0][0]+pixel_count+1, CP[0][1]+i] = tuple(point_color) return G cpdef polynomial_mandelbrot(f, parameter=None, double x_center=0, - double y_center=0, image_width=4, int max_iteration=50, int pixel_count=500, - int level_sep=1, int color_num=30, base_color=Color('red')): + double y_center=0, image_width=4, + int max_iteration=50, int pixel_count=500, + int level_sep=1, int color_num=30, + base_color=Color('red')): r""" - Plots the Mandelbrot set in the complex plane for a family of polynomial maps. + Plot the Mandelbrot set in the complex plane for a family of polynomial maps. INPUT: @@ -684,7 +692,7 @@ cpdef polynomial_mandelbrot(f, parameter=None, double x_center=0, f_real, f_imag, f_temp, escape_time, cf_list, cf int i, j, d, k, col, row, iteration double C, L, Rad, x_corner, y_corner, x_coor, y_coor, \ - step_size, new_x, new_y + step_size, new_x, new_y I = CDF.gen() constant_c = True @@ -720,7 +728,7 @@ cpdef polynomial_mandelbrot(f, parameter=None, double x_center=0, image_width = abs(image_width) # Initialize an image to the color black and access the pixels - M = Image("RGB", (pixel_count,pixel_count), 'black') + M = Image("RGB", (pixel_count, pixel_count), 'black') pixel = M.pixels() # Take the given base color and create a list of evenly spaced @@ -738,21 +746,21 @@ cpdef polynomial_mandelbrot(f, parameter=None, double x_center=0, color_list[i] = tuple(color_list[i]) # Split function into real and imaginary parts - R = PolynomialRing(CC, [variable,parameter]) + R = PolynomialRing(CC, [variable, parameter]) if len(R.gens()) > 2: raise NotImplementedError("base ring must have only 2 variables") z, c = R.gens() f = R(str(f)) S = PolynomialRing(f.base_ring(), 'x,y,J,cr,ci') - x,y,J,cr,ci = S.gens() + x, y, J, cr, ci = S.gens() S2 = S.quotient_ring(J**2+1) phi = R.hom([x+y*J, cr+ci*J], S2) t = phi(f).lift() im = t.coefficient(J) re = t - im*J - f_real = fast_callable(re, vars=[x,y,cr,ci,J], domain=RDF) - f_imag = fast_callable(im, vars=[x,y,cr,ci,J], domain=RDF) + f_real = fast_callable(re, vars=[x, y, cr, ci, J], domain=RDF) + f_imag = fast_callable(im, vars=[x, y, cr, ci, J], domain=RDF) # Compute critical points try: @@ -765,9 +773,7 @@ cpdef polynomial_mandelbrot(f, parameter=None, double x_center=0, # If c is in the constant term of the polynomial, then the critical points # will be independent of c. if constant_c: - c_pts = [] - for pt in critical_pts: - c_pts.append([pt.real(), pt.imag()]) + c_pts = [[pt.real(), pt.imag()] for pt in critical_pts] # Calculate escape condition d = f.degree(z) @@ -811,8 +817,8 @@ cpdef polynomial_mandelbrot(f, parameter=None, double x_center=0, iteration = 0 while new_x**2 + new_y**2 <= Rad**2 and iteration < escape_time: sig_check() - new_x, new_y = f_real(new_x, new_y, x_coor, y_coor,1), \ - f_imag(new_x, new_y, x_coor, y_coor,1) + new_x, new_y = f_real(new_x, new_y, x_coor, y_coor, 1), \ + f_imag(new_x, new_y, x_coor, y_coor, 1) iteration += 1 # For each point, we take the minimum number of iterations @@ -832,17 +838,17 @@ cpdef polynomial_mandelbrot(f, parameter=None, double x_center=0, # Assign the pixel a color based on it's level. If we run out # of colors, assign it the last color in the list. if level < color_num: - pixel[col,row] = color_list[level] + pixel[col, row] = color_list[level] else: - pixel[col,row] = color_list[-1] + pixel[col, row] = color_list[-1] # If the critical points of f depend on c, we must compute the different # critical points for each c. else: # Solve for critical points symbollically. with SR.temp_var() as w: - df = f.derivative(z).polynomial(z).subs({z:w}) - critical_pts = solve(symbolic_expression(df)==0, w) + df = f.derivative(z).polynomial(z).subs({z: w}) + critical_pts = solve(symbolic_expression(df) == 0, w) c_pts = [] for pt in critical_pts: c_pts.append(fast_callable(pt.rhs(), vars=[c], domain=CDF)) @@ -868,7 +874,7 @@ cpdef polynomial_mandelbrot(f, parameter=None, double x_center=0, escape_time = max_iteration # Calculate escape condition for each c value - f_temp = f.subs({c:x_coor+y_coor*I}) + f_temp = f.subs({c: x_coor+y_coor*I}) cf_list = f_temp.coefficients() a_n = cf_list.pop(0).abs() C = 0 @@ -892,8 +898,8 @@ cpdef polynomial_mandelbrot(f, parameter=None, double x_center=0, iteration = 0 while new_x**2 + new_y**2 <= Rad**2 and iteration < escape_time: sig_check() - new_x, new_y = f_real(new_x, new_y, x_coor, y_coor,1), \ - f_imag(new_x, new_y, x_coor, y_coor,1) + new_x, new_y = f_real(new_x, new_y, x_coor, y_coor, 1), \ + f_imag(new_x, new_y, x_coor, y_coor, 1) iteration += 1 # For each point, we take the minimum number of iterations @@ -913,48 +919,48 @@ cpdef polynomial_mandelbrot(f, parameter=None, double x_center=0, # Assign the pixel a color based on it's level. If we run out # of colors, assign it the last color in the list. if level < color_num: - pixel[col,row] = color_list[level] + pixel[col, row] = color_list[level] else: - pixel[col,row] = color_list[-1] + pixel[col, row] = color_list[-1] return M cpdef general_julia(f, double x_center=0, double y_center=0, image_width=4, - int max_iteration=50, int pixel_count=500, int level_sep=1, int color_num=30, - base_color=[50,50,50]): + int max_iteration=50, int pixel_count=500, + int level_sep=1, int color_num=30, + base_color=[50, 50, 50]): r""" - Plots Julia sets for general polynomials. + Plot Julia sets for general polynomials. EXAMPLES:: - sage: from sage.dynamics.complex_dynamics.mandel_julia_helper import general_julia - sage: from sage.plot.colors import Color - sage: R. = CC[] - sage: f = z^3 - z + 1 - sage: general_julia(f) - 500x500px 24-bit RGB image + sage: from sage.dynamics.complex_dynamics.mandel_julia_helper import general_julia + sage: from sage.plot.colors import Color + sage: R. = CC[] + sage: f = z^3 - z + 1 + sage: general_julia(f) + 500x500px 24-bit RGB image :: - sage: from sage.dynamics.complex_dynamics.mandel_julia_helper import general_julia - sage: from sage.plot.colors import Color - sage: R. = CC[] - sage: f = z^5 - 1 - sage: general_julia(f) - 500x500px 24-bit RGB image + sage: from sage.dynamics.complex_dynamics.mandel_julia_helper import general_julia + sage: from sage.plot.colors import Color + sage: R. = CC[] + sage: f = z^5 - 1 + sage: general_julia(f) + 500x500px 24-bit RGB image """ cdef: - M, pixel, color_list, R, z, S, x, y, S2, phi, t, im, re, a_n, df, - critical_pts, f_real, f_imag, J - int i, j, d, k, col, row, iteration, ii - double C, L, Rad, x_corner, y_corner, x_coor, y_coor, step_size, new_x, new_y + M, pixel, color_list, z, a_n + int i, j, d, k, col, row, iteration + double C, L, Rad, x_corner, y_corner, x_coor, y_coor, step_size I = CDF.gen() # Make sure image_width is positive image_width = abs(image_width) # Initialize an image to the color black and access the pixels - M = Image("RGB", (pixel_count,pixel_count), 'black') + M = Image("RGB", (pixel_count, pixel_count), 'black') pixel = M.pixels() # Take the given base color and create a list of evenly spaced @@ -1022,7 +1028,7 @@ cpdef general_julia(f, double x_center=0, double y_center=0, image_width=4, # Assign the pixel a color based on it's level. If we run out # of colors, assign it the last color in the list. if level < color_num: - pixel[col,row] = color_list[level] + pixel[col, row] = color_list[level] else: - pixel[col,row] = color_list[-1] + pixel[col, row] = color_list[-1] return M diff --git a/src/sage/interacts/library_cython.pyx b/src/sage/interacts/library_cython.pyx index 52c68dd5922..e68a8bcd2a3 100644 --- a/src/sage/interacts/library_cython.pyx +++ b/src/sage/interacts/library_cython.pyx @@ -5,14 +5,14 @@ AUTHORS: - Harald Schilly (2011-01-16): initial version (#9623) partially based on work by Lauri Ruotsalainen """ -#***************************************************************************** +# *************************************************************************** # Copyright (C) 2011 Harald Schilly # # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # https://www.gnu.org/licenses/ -#***************************************************************************** +# *************************************************************************** cpdef julia(ff_j, z, int iterations): @@ -97,11 +97,11 @@ cpdef cellular(rule, int N): """ from numpy import zeros cdef int j, k, l - M=zeros((N, 2*N+2), dtype=int) - M[0,N]=1 + M = zeros((N, 2*N+2), dtype=int) + M[0, N] = 1 for j in range(1, N): for k in range(0, 2*N): l = 4 * M[j-1, k-1] + 2 * M[j-1, k] + M[j-1, k+1] - M[j,k] = rule[l] + M[j, k] = rule[l] return M diff --git a/src/sage/matroids/matroid.pyx b/src/sage/matroids/matroid.pyx index fab7b9008bf..c01a777407b 100644 --- a/src/sage/matroids/matroid.pyx +++ b/src/sage/matroids/matroid.pyx @@ -7709,12 +7709,12 @@ cdef class Matroid(SageObject): # check if edge (u,v) exists in the auxiliary digraph exist = False if ((u in Y) and (v in E-Y) and - (self.is_dependent(Y|{v})) and - (self.is_independent((Y|{v}) - {u}))): + self.is_dependent(Y|{v}) and + self.is_independent((Y|{v}) - {u})): exist = True if ((u in E-Y) and (v in Y) and (not other.is_independent(Y|{u})) and - (other.is_independent((Y|{u}) - {v}))): + (other.is_independent((Y|{u}) - {v}))): exist = True if exist: stack.append(v) diff --git a/src/sage/quadratic_forms/ternary.pyx b/src/sage/quadratic_forms/ternary.pyx index 345d6b962b3..a1a5f2a7306 100644 --- a/src/sage/quadratic_forms/ternary.pyx +++ b/src/sage/quadratic_forms/ternary.pyx @@ -305,7 +305,7 @@ def _reduced_ternary_form_eisenstein_with_matrix(a1, a2, a3, a23, a13, a12): [a13, a23] = [a23, a13] return (a1, a2, a3, a23, a13, a12), \ - matrix(ZZ, 3, (m11, m12, m13, m21, m22, m23, m31, m32, m33)) + matrix(ZZ, 3, (m11, m12, m13, m21, m22, m23, m31, m32, m33)) def _reduced_ternary_form_eisenstein_without_matrix(a1, a2, a3, a23, a13, a12): diff --git a/src/sage/quivers/algebra_elements.pyx b/src/sage/quivers/algebra_elements.pyx index a8f7778b202..4703863503a 100644 --- a/src/sage/quivers/algebra_elements.pyx +++ b/src/sage/quivers/algebra_elements.pyx @@ -266,9 +266,10 @@ cdef class PathAlgebraElement(RingElement): sage: X # indirect doctest 5*e_0 + a + 2*b + 3*c + 3*e_2 """ + parent = self._parent return repr_lincomb(self._sorted_items_for_printing(), strip_one=True, - scalar_mult=self.parent()._print_options['scalar_mult'], - repr_monomial=self._parent._repr_monomial) + scalar_mult=parent._print_options['scalar_mult'], + repr_monomial=parent._repr_monomial) def _latex_(self): r""" @@ -283,11 +284,12 @@ cdef class PathAlgebraElement(RingElement): sage: latex(X*X) 10 e_0 + 3 a\cdot c + 5 a + b + 3 c\cdot a + 6 c\cdot b + 9 e_2 """ + parent = self._parent return repr_lincomb(self._sorted_items_for_printing(), - scalar_mult=self.parent()._print_options['scalar_mult'], - latex_scalar_mult=self.parent()._print_options['latex_scalar_mult'], - repr_monomial=self._parent._latex_monomial, - is_latex=True, strip_one=True) + scalar_mult=parent._print_options['scalar_mult'], + latex_scalar_mult=parent._print_options['latex_scalar_mult'], + repr_monomial=parent._latex_monomial, + is_latex=True, strip_one=True) # Basic properties diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx index 40b92ab23eb..e436e0f756d 100644 --- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx +++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx @@ -16,15 +16,15 @@ AUTHORS: - John Cremona (2014): added some docstrings and doctests """ -#***************************************************************************** +# *************************************************************************** # Copyright (C) 2010 Robert Bradshaw # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# *************************************************************************** import numpy as np cimport numpy as np diff --git a/src/sage/schemes/toric/divisor_class.pyx b/src/sage/schemes/toric/divisor_class.pyx index 98ed1b377b3..048cc2992d7 100644 --- a/src/sage/schemes/toric/divisor_class.pyx +++ b/src/sage/schemes/toric/divisor_class.pyx @@ -46,7 +46,7 @@ divisor representing a divisor class:: """ -#***************************************************************************** +# *************************************************************************** # Copyright (C) 2010 Volker Braun # Copyright (C) 2010 Andrey Novoseltsev # Copyright (C) 2010 William Stein @@ -54,7 +54,7 @@ divisor representing a divisor class:: # Distributed under the terms of the GNU General Public License (GPL) # # https://www.gnu.org/licenses/ -#***************************************************************************** +# *************************************************************************** from sage.libs.gmp.mpq cimport * diff --git a/src/sage/structure/list_clone_demo.pyx b/src/sage/structure/list_clone_demo.pyx index dbd199fa317..fde51727af6 100644 --- a/src/sage/structure/list_clone_demo.pyx +++ b/src/sage/structure/list_clone_demo.pyx @@ -6,19 +6,20 @@ This module demonstrate the usage of the various classes defined in :mod:`~sage.structure.list_clone` """ -#***************************************************************************** +# *************************************************************************** # Copyright (C) 2011 Florent Hivert # # Distributed under the terms of the GNU General Public License (GPL) -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# *************************************************************************** from sage.categories.sets_cat import Sets from sage.structure.unique_representation import UniqueRepresentation from sage.structure.list_clone cimport ( - ClonableArray, ClonableList, NormalizedClonableList, ClonableIntArray ) + ClonableArray, ClonableList, NormalizedClonableList, ClonableIntArray) from sage.structure.parent import Parent + cdef class IncreasingArray(ClonableArray): """ A small extension class for testing diff --git a/src/sage/symbolic/pynac_function_impl.pxi b/src/sage/symbolic/pynac_function_impl.pxi index a9faf2e7de7..ca2b459e095 100644 --- a/src/sage/symbolic/pynac_function_impl.pxi +++ b/src/sage/symbolic/pynac_function_impl.pxi @@ -47,14 +47,16 @@ cpdef call_registered_function(unsigned serial, res = g_function_evalv(serial, vec, hold) elif nargs == 1: res = g_function_eval1(serial, - (args[0])._gobj, hold) + (args[0])._gobj, hold) elif nargs == 2: - res = g_function_eval2(serial, (args[0])._gobj, - (args[1])._gobj, hold) + res = g_function_eval2(serial, + (args[0])._gobj, + (args[1])._gobj, hold) elif nargs == 3: res = g_function_eval3(serial, - (args[0])._gobj, (args[1])._gobj, - (args[2])._gobj, hold) + (args[0])._gobj, + (args[1])._gobj, + (args[2])._gobj, hold) if allow_numeric_result and is_a_numeric(res): return py_object_from_numeric(res)