Skip to content

Commit

Permalink
partial cython-lint in plot folder
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Apr 25, 2023
1 parent f3acd42 commit 61bd086
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/sage/plot/complex_plot.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,6 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
cdef unsigned int i, j, imax, jmax
cdef double x, y, mag, arg
cdef double lightness_delta
cdef double r, g, b
cdef ComplexDoubleElement z
from sage.rings.complex_double import CDF

Expand Down
1 change: 0 additions & 1 deletion src/sage/plot/plot3d/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ AUTHORS:
# ****************************************************************************

from cpython.list cimport *
from cpython.object cimport PyObject

import os
import sys
Expand Down
2 changes: 0 additions & 2 deletions src/sage/plot/plot3d/implicit_surface.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ cimport numpy as np
import numpy as np

from sage.plot.plot3d.transform cimport point_c, face_c, color_c, Transformation
from sage.plot.plot3d.base cimport PrimitiveObject
from sage.plot.plot3d.base import RenderParams, default_texture
from sage.plot.plot3d.index_face_set cimport IndexFaceSet
from sage.rings.real_double import RDF
from sage.plot.misc import setup_for_eval_on_grid
Expand Down
10 changes: 1 addition & 9 deletions src/sage/plot/plot3d/index_face_set.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ AUTHORS:
# ****************************************************************************

from textwrap import dedent
from sage.misc.superseded import deprecation_cython as deprecation

from libc.math cimport isfinite, INFINITY
from libc.math cimport INFINITY
from libc.string cimport memset, memcpy
from cysignals.memory cimport check_calloc, check_allocarray, check_reallocarray, sig_free
from cysignals.signals cimport sig_check, sig_on, sig_off
Expand All @@ -53,15 +52,10 @@ from cpython.bytes cimport *

include "point_c.pxi"


from math import sin, cos, sqrt
from random import randint

from sage.cpython.string cimport bytes_to_str

from sage.rings.real_double import RDF

from sage.matrix.constructor import matrix
from sage.modules.free_module_element import vector

from sage.plot.colors import Color, float_to_integer
Expand Down Expand Up @@ -1637,9 +1631,7 @@ cdef class IndexFaceSet(PrimitiveObject):
sage: T = S.dual()
sage: len(T.vertex_list())
6
"""
cdef point_c P
cdef face_c *face
cdef Py_ssize_t i, j, ix, ff
cdef IndexFaceSet dual = IndexFaceSet([], **kwds)
Expand Down
1 change: 0 additions & 1 deletion src/sage/plot/plot3d/parametric_surface.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ cdef class ParametricSurface(IndexFaceSet):
cdef object colormap
cdef int eval_grid(self, urange, vrange) except -1
cdef int eval_c(self, point_c *res, double u, double v) except -1

1 change: 0 additions & 1 deletion src/sage/plot/plot3d/point_c.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,3 @@ cdef inline double sin_face_angle(face_c F, face_c E, point_c* vlist):
face_c_normal(&nE, E, vlist)
cdef double dot = point_c_dot(nF, nE)
return math.sqrt(1-(dot*dot)/(point_c_dot(nF, nF)*point_c_dot(nE, nE)))

10 changes: 5 additions & 5 deletions src/sage/plot/plot3d/shapes.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ EXAMPLES::
# https://www.gnu.org/licenses/
# ****************************************************************************

from libc.math cimport sqrt, sin, cos, tan, asin, acos, atan, M_PI
from libc.math cimport sqrt, sin, cos, acos, M_PI
from sage.rings.real_double import RDF
from sage.modules.free_module_element import vector
from sage.misc.decorators import rename_keyword
from .base import Graphics3dGroup, Graphics3d
from .base import Graphics3dGroup
from .index_face_set cimport IndexFaceSet, PrimitiveObject
from .transform cimport point_c

Expand Down Expand Up @@ -948,7 +948,7 @@ cdef class Sphere(ParametricSurface):
([-10.0, ..., 10.0],
[0.0, ..., 3.141592653589793, ..., 0.0])
"""
cdef int K, u_res, v_res
cdef int u_res, v_res
u_res = min(max(int(M_PI*self.radius/ds), 6), 20)
v_res = min(max(int(2*M_PI * self.radius/ds), 6), 36)
urange = [-10.0] + [M_PI * k/u_res - M_PI/2 for k in range(1, u_res)] + [10.0]
Expand All @@ -961,8 +961,8 @@ cdef class Sphere(ParametricSurface):
elif u == 10:
res.x, res.y, res.z = 0, 0, self.radius
else:
res.x = self.radius*cos(v) * cos(u)
res.y = self.radius*sin(v) * cos(u)
res.x = self.radius * cos(v) * cos(u)
res.y = self.radius * sin(v) * cos(u)
res.z = self.radius * sin(u)


Expand Down

0 comments on commit 61bd086

Please sign in to comment.