Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pep8 E303 in various folders (plot, quadratic forms, etc) #35132

Merged
merged 1 commit into from
Mar 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/sage/plot/animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,6 @@ def show(self, delay=None, iterations=None, **kwds):
dm = get_display_manager()
dm.display_immediately(self, **kwds)


def ffmpeg(self, savefile=None, show_path=False, output_format=None,
ffmpeg_options='', delay=None, iterations=0, pix_fmt='rgb24'):
r"""
Expand Down
2 changes: 0 additions & 2 deletions src/sage/plot/matrix_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ def _render_on_subplot(self, subplot):
subplot.xaxis.set_ticks_position('both') #only tick marks, not tick labels



@suboptions('colorbar', orientation='vertical', format=None)
@suboptions('subdivision',boundaries=None, style=None)
@options(aspect_ratio=1, axes=False, cmap='Greys', colorbar=False,
Expand Down Expand Up @@ -585,7 +584,6 @@ def matrix_plot(mat, xrange=None, yrange=None, **options):
else:
sparse = False


try:
if sparse:
xy_data_array = mat
Expand Down
2 changes: 0 additions & 2 deletions src/sage/plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2513,8 +2513,6 @@ def golden_rainbow(i,lightness=0.4):
return G




########## misc functions ###################

@options(aspect_ratio=1.0)
Expand Down
6 changes: 0 additions & 6 deletions src/sage/plot/plot3d/tri_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ def get_colors(self, list):
return list



class TrianglePlot:
"""
Recursively plots a function of two variables by building squares of 4 triangles, checking at
Expand Down Expand Up @@ -302,7 +301,6 @@ def fcn(x,y):
avg_z = (vertices[0][2] + vertices[1][2] + vertices[2][2])/3
o.set_color(colors[int(num_colors * (avg_z - self._min) / zrange)])


def plot_block(self, min_x, mid_x, max_x, min_y, mid_y, max_y, sw_z, nw_z, se_z, ne_z, mid_z, depth):
"""
Recursive triangulation function for plotting.
Expand Down Expand Up @@ -400,7 +398,6 @@ def plot_block(self, min_x, mid_x, max_x, min_y, mid_y, max_y, sw_z, nw_z, se_z,
mid_se_z = self._fcn(qtr3_x,qtr1_y)
mid_ne_z = self._fcn(qtr3_x,qtr3_y)


self.extrema([mid_w_z[0], mid_n_z[0], mid_e_z[0], mid_s_z[0], mid_sw_z[0], mid_se_z[0], mid_nw_z[0], mid_sw_z[0]])

# recurse into the sub-squares
Expand Down Expand Up @@ -440,7 +437,6 @@ def plot_block(self, min_x, mid_x, max_x, min_y, mid_y, max_y, sw_z, nw_z, se_z,
ne = [(max_x,max_y,ne_z[0]),ne_z[1]]
c = [[(mid_x,mid_y,mid_z[0]),mid_z[1]]]


left = [sw,nw]
left_c = c
top = [nw,ne]
Expand Down Expand Up @@ -499,7 +495,6 @@ def interface(self, n, p, p_c, q, q_c):
self.triangulate(m, mpc)
self.triangulate(m, mqc)


def triangulate(self, p, c):
"""
Pass in a list of edge points (p) and center points (c).
Expand All @@ -523,7 +518,6 @@ def triangulate(self, p, c):
for i in range(0,len(p)-1):
self._objects.append(self._triangle_factory.smooth_triangle(p[i][0], p[i+1][0], c[i][0],p[i][1], p[i+1][1], c[i][1]))


def extrema(self, list):
"""
If the num_colors option has been set, this expands the TrianglePlot's _min and _max
Expand Down
2 changes: 0 additions & 2 deletions src/sage/plot/primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def __init__(self, options):
"""
self._options = options


def _allowed_options(self):
"""
Return the allowed options for a graphics primitive.
Expand Down Expand Up @@ -216,7 +215,6 @@ def _repr_(self):
return "Graphics primitive"



class GraphicPrimitive_xydata(GraphicPrimitive):
def get_minmax_data(self):
"""
Expand Down
1 change: 0 additions & 1 deletion src/sage/quadratic_forms/constructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from sage.quadratic_forms.quadratic_form import QuadraticForm



def BezoutianQuadraticForm(f, g):
r"""
Compute the Bezoutian of two polynomials defined over a common base ring. This is defined by
Expand Down
17 changes: 0 additions & 17 deletions src/sage/quadratic_forms/genera/genus.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ def LocalGenusSymbol(A, p):
return Genus_Symbol_p_adic_ring(p, symbol)



def is_GlobalGenus(G):
r"""
Return if `G` represents the genus of a global quadratic form or lattice.
Expand Down Expand Up @@ -465,7 +464,6 @@ def is_GlobalGenus(G):
return True



def is_2_adic_genus(genus_symbol_quintuple_list):
r"""
Given a `2`-adic local symbol (as the underlying list of quintuples)
Expand Down Expand Up @@ -527,7 +525,6 @@ def is_2_adic_genus(genus_symbol_quintuple_list):
return True



def canonical_2_adic_compartments(genus_symbol_quintuple_list):
r"""
Given a `2`-adic local symbol (as the underlying list of quintuples)
Expand Down Expand Up @@ -956,7 +953,6 @@ def p_adic_symbol(A, p, val):
return [ [s[0]+m0] + s[1:] for s in sym + p_adic_symbol(A, p, val) ]



def is_even_matrix(A):
r"""
Determines if the integral symmetric matrix `A` is even
Expand Down Expand Up @@ -990,7 +986,6 @@ def is_even_matrix(A):
return True, -1



def split_odd(A):
r"""
Given a non-degenerate Gram matrix `A (\mod 8)`, return a splitting
Expand Down Expand Up @@ -1080,7 +1075,6 @@ def split_odd(A):
return u, B



def trace_diag_mod_8(A):
r"""
Return the trace of the diagonalised form of `A` of an integral
Expand Down Expand Up @@ -1487,7 +1481,6 @@ def __eq__(self, other):
return False
return self.canonical_symbol() == other.canonical_symbol()


def __ne__(self, other):
r"""
Determines if two genus symbols are unequal (not just inequivalent!).
Expand Down Expand Up @@ -1523,7 +1516,6 @@ def __ne__(self, other):
"""
return not self == other


# Added these two methods to make this class iterable...
#def __getitem__(self, i):
# return self._symbol[i]
Expand Down Expand Up @@ -1765,7 +1757,6 @@ def canonical_symbol(self):
else:
return self._symbol


def gram_matrix(self, check=True):
r"""
Return a gram matrix of a representative of this local genus.
Expand Down Expand Up @@ -2044,7 +2035,6 @@ def number_of_blocks(self):
"""
return len(self._symbol)


def determinant(self):
r"""
Returns the (`p`-part of the) determinant (square-class) of the
Expand Down Expand Up @@ -2339,7 +2329,6 @@ def trains(self):
symbol = self._symbol
return canonical_2_adic_trains(symbol)


def compartments(self):
r"""
Compute the indices for each of the compartments in this local genus
Expand Down Expand Up @@ -2442,7 +2431,6 @@ def __init__(self, signature_pair, local_symbols, representative=None, check=Tru
self._signature = signature_pair
self._local_symbols = local_symbols


def __repr__(self):
r"""
Return a string representing the global genus symbol.
Expand Down Expand Up @@ -2509,7 +2497,6 @@ def _latex_(self):
rep += r"\\ " + s._latex_()
return rep


def __eq__(self, other):
r"""
Determines if two global genus symbols are equal (not just equivalent!).
Expand Down Expand Up @@ -2562,8 +2549,6 @@ def __eq__(self, other):
return False
return True



def __ne__(self, other):
r"""
Determine if two global genus symbols are unequal (not just inequivalent!).
Expand Down Expand Up @@ -2716,7 +2701,6 @@ def _improper_spinor_kernel(self):
K = A.subgroup(K.gens() + (j,))
return A, K


def spinor_generators(self, proper):
r"""
Return the spinor generators.
Expand Down Expand Up @@ -2807,7 +2791,6 @@ def _proper_is_improper(self):
j = A.delta(r) # diagonal embedding of r
return j in K, j


def signature(self):
r"""
Return the signature of this genus.
Expand Down
16 changes: 0 additions & 16 deletions src/sage/quadratic_forms/quadratic_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ class QuadraticForm(SageObject):
local_genus_symbol, \
CS_genus_symbol_list


# Routines to compute local masses for ZZ.
from sage.quadratic_forms.quadratic_form__mass import \
shimura_mass__maximal, \
Expand Down Expand Up @@ -489,8 +488,6 @@ class QuadraticForm(SageObject):
# Routines for solving equations of the form Q(x) = c.
from sage.quadratic_forms.qfsolve import solve



def __init__(self, R, n=None, entries=None, unsafe_initialization=False, number_of_automorphisms=None, determinant=None):
"""
EXAMPLES::
Expand Down Expand Up @@ -629,7 +626,6 @@ def list_external_initializations(self):
"""
return deepcopy(self._external_initialization_list)


def __pari__(self):
"""
Return a PARI-formatted Hessian matrix for Q.
Expand Down Expand Up @@ -681,7 +677,6 @@ def _repr_(self):
out_str += "]"
return out_str


def _latex_(self):
"""
Give a LaTeX representation for the quadratic form given as an upper-triangular matrix of coefficients.
Expand Down Expand Up @@ -911,8 +906,6 @@ def sum_by_coefficients_with(self, right):
# return QuadraticForm(self.base_ring(), self.dim(), [c * self.__coeffs[i] for i in range(len(self.__coeffs))])
# =========================================================================================================================



def __call__(self, v):
"""
Evaluate this quadratic form Q on a vector or matrix of elements
Expand Down Expand Up @@ -1025,8 +1018,6 @@ def __call__(self, v):
raise TypeError




# =====================================================================================================

def _is_even_symmetric_matrix_(self, A, R=None):
Expand Down Expand Up @@ -1341,8 +1332,6 @@ def from_polynomial(poly):
coeffs.append(poly.monomial_coefficient(v*w))
return QuadraticForm(base, len(vs), coeffs)



def is_primitive(self):
"""
Determines if the given integer-valued form is primitive
Expand Down Expand Up @@ -1434,7 +1423,6 @@ def base_ring(self):
"""
return self.__base_ring


def coefficients(self):
"""
Gives the matrix of upper triangular coefficients,
Expand All @@ -1449,7 +1437,6 @@ def coefficients(self):
"""
return self.__coeffs


def det(self):
"""
Gives the determinant of the Gram matrix of 2*Q, or
Expand Down Expand Up @@ -1478,7 +1465,6 @@ def det(self):
self.__det = new_det
return new_det


def Gram_det(self):
"""
Gives the determinant of the Gram matrix of Q.
Expand All @@ -1496,7 +1482,6 @@ def Gram_det(self):
"""
return self.det() / ZZ(2**self.dim())


def base_change_to(self, R):
"""
Alters the quadratic form to have all coefficients
Expand Down Expand Up @@ -1581,7 +1566,6 @@ def level(self):
warn("Warning -- The level of a quadratic form over a field is always 1. Do you really want to do this?!?")
#raise RuntimeError, "Warning -- The level of a quadratic form over a field is always 1. Do you really want to do this?!?"


# Check invertibility and find the inverse
try:
mat_inv = self.matrix()**(-1)
Expand Down
5 changes: 0 additions & 5 deletions src/sage/quadratic_forms/quadratic_form__count_local_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ def count_congruence_solutions_as_vector(self, p, k, m, zvec, nzvec):
return CountAllLocalTypesNaive(self, p, k, m, zvec, nzvec)






##///////////////////////////////////////////
##/// Front-ends for our counting routines //
##///////////////////////////////////////////
Expand Down Expand Up @@ -102,7 +98,6 @@ def count_congruence_solutions(self, p, k, m, zvec, nzvec):
return CountAllLocalTypesNaive(self, p, k, m, zvec, nzvec)[0]



def count_congruence_solutions__good_type(self, p, k, m, zvec, nzvec):
"""
Counts the good-type solutions of Q(x) = m (mod p^k) satisfying the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ def has_equivalent_Jordan_decomposition_at_prime(self, other, p):
if len(self_jordan) != len(other_jordan):
return False


# Deal with odd primes: Check that the Jordan component scales, dimensions, and discriminants are the same
if p != 2:
for i in range(len(self_jordan)):
Expand All @@ -230,14 +229,12 @@ def has_equivalent_Jordan_decomposition_at_prime(self, other, p):
# All tests passed for an odd prime.
return True


# For p = 2: Check that all Jordan Invariants are the same.
elif p == 2:

# Useful definition
t = len(self_jordan) # Define t = Number of Jordan components


# Check that all Jordan Invariants are the same (scale, dim, and norm)
for i in range(t):
if (self_jordan[i][0] != other_jordan[i][0]) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def local_density(self, p, m):
if ((m != 0) and (valuation(m,p) < p_valuation)): # Note: The (m != 0) condition protects taking the valuation of zero.
return QQ(0)


# If the form is imprimitive, rescale it and call the local density routine
p_adjustment = QQ(1) / p**p_valuation
m_prim = QQ(m) / p**p_valuation
Expand Down Expand Up @@ -133,7 +132,6 @@ def local_primitive_density(self, p, m):
if ((m != 0) and (valuation(m,p) < p_valuation)): # Note: The (m != 0) condition protects taking the valuation of zero.
return QQ(0)


# If the form is imprimitive, rescale it and call the local density routine
p_adjustment = QQ(1) / p**p_valuation
m_prim = QQ(m) / p**p_valuation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ def signature_vector(self):
return (p, n, z)



def signature(self):
"""
Returns the signature of the quadratic form, defined as:
Expand Down
Loading