Skip to content

Commit

Permalink
gh-35409: fix pep8 E303 in folders starting with m
Browse files Browse the repository at this point in the history
    
<!-- Please provide a concise, informative and self-explanatory title.
-->
<!-- Don't put issue numbers in the title. Put it in the Description
below. -->
<!-- For example, instead of "Fixes #12345", use "Add a new method to
multiply two integers" -->

### 📚 Description

fix all pep8 E303 warning in the folders whose name starts with the
letter m

purely done with autopep8:

```
$ autopep8 -i --select=E303 src/sage/m*/*.py
$ autopep8 -i --select=E303 src/sage/m*/*/*.py
```

<!-- Describe your changes here in detail. -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: #35409
Reported by: Frédéric Chapoton
Reviewer(s): David Coudert
  • Loading branch information
Release Manager committed Apr 4, 2023
2 parents 5853e99 + 1654726 commit 80ada8e
Show file tree
Hide file tree
Showing 31 changed files with 0 additions and 63 deletions.
1 change: 0 additions & 1 deletion src/sage/manifolds/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -2317,7 +2317,6 @@ def _tighten_bounds(self):
self._restrictions = new_restrictions
self._fast_valid_coordinates = None


def restrict(self, subset, restrictions=None):
r"""
Return the restriction of the chart to some open subset of its domain.
Expand Down
2 changes: 0 additions & 2 deletions src/sage/manifolds/differentiable/automorphismfield_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ def __init__(self, vector_field_module):
Parent.__init__(self, category=Groups())
self._vmodule = vector_field_module


#### Parent methods ####

def _element_constructor_(self, comp=[], frame=None, name=None,
Expand Down Expand Up @@ -266,7 +265,6 @@ def _an_element_(self):

#### End of parent methods ####


#### Monoid methods ####

@cached_method
Expand Down
2 changes: 0 additions & 2 deletions src/sage/manifolds/differentiable/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,6 @@ def symbolic_velocities(self, left='D', right=None):
return list(var(list_strings_velocities))



#*****************************************************************************

class RealDiffChart(DiffChart, RealChart):
Expand Down Expand Up @@ -1001,7 +1000,6 @@ def __init__(self, domain, coordinates, calc_method=None,
self._frame = CoordFrame(self)
self._coframe = self._frame._coframe


def restrict(self, subset, restrictions=None):
r"""
Return the restriction of the chart to some subset.
Expand Down
1 change: 0 additions & 1 deletion src/sage/manifolds/differentiable/degenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ def open_subset(self, name, latex_name=None, coord_def={}):
return resu



#*******************************************************************************************

from sage.manifolds.differentiable.tensorfield_paral import TensorFieldParal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,6 @@ def principal_directions(self, screen=None):
self._principal_directions[screen._name] = res
return res


def mean_curvature(self, screen=None):
r"""
Expand Down
1 change: 0 additions & 1 deletion src/sage/manifolds/differentiable/diff_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,6 @@ def wedge(self, other):
other_r = other.restrict(dom_resu)
return FreeModuleAltForm.wedge(self_r, other_r)


def interior_product(self, qvect):
r"""
Interior product with a multivector field.
Expand Down
1 change: 0 additions & 1 deletion src/sage/manifolds/differentiable/diff_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,6 @@ def paral_comp(tcomp, chart1, chart2, coord2_1, jacob,
resu._components[frame] = comp
return resu


def pushforward(self, tensor):
r"""
Pushforward operator associated with ``self``.
Expand Down
9 changes: 0 additions & 9 deletions src/sage/manifolds/differentiable/integrated_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,6 @@ def fast_CoF(pos, vel, M=M):
for f in transf]
self._fast_changes_of_chart[CoC] = fast_transf


self._velocities = list(velocities) # converts to list
# since might not already be a list (which is later required)
self._curve_parameter = curve_parameter
Expand Down Expand Up @@ -1376,13 +1375,11 @@ def jacobian(t,y):
# 'tangent_vector_eval_at', and in 'plot' when plotting the
# tangent vectors.)


if isinstance(sol, list):
coords_sol = [point[0:dim + 1] for point in sol]
else:
coords_sol = sol[:, 0:dim + 1].tolist() # far faster in numpy


if verbose:
print("Numerical integration completed.\n\n" +
"Checking all points are in the chart domain...")
Expand Down Expand Up @@ -1779,7 +1776,6 @@ def solve_across_charts(self, charts=None, step=None, solution_key=None,
new_vel = self._fast_changes_of_frame[(new_chart.frame().restrict(inter),
chart.frame().restrict(inter))](last_pts, last_vel)


ics = new_pts + new_vel
chart = new_chart

Expand Down Expand Up @@ -2434,7 +2430,6 @@ def plot_integrated(self, chart=None, ambient_coords=None,
thickness = kwds.pop('thickness')
aspect_ratio = kwds.pop('aspect_ratio')


#
# The mapping, if present, and the chart with respect to which the curve
# is plotted
Expand Down Expand Up @@ -3425,7 +3420,6 @@ def __init__(self, parent, affine_connection, curve_parameter,

velocities = chart.symbolic_velocities()


dim = parent.codomain().dim()
i0 = parent.codomain().start_index()

Expand Down Expand Up @@ -3470,7 +3464,6 @@ def __init__(self, parent, affine_connection, curve_parameter,
equations_rhs_chart += [rhs.simplify_full()]
equations_rhs[chart] = equations_rhs_chart


IntegratedCurve.__init__(self, parent, equations_rhs,
velocities, curve_parameter,
initial_tangent_vector, chart=chart,
Expand All @@ -3479,7 +3472,6 @@ def __init__(self, parent, affine_connection, curve_parameter,

self._affine_connection = affine_connection


def _repr_(self):
r"""
Return a string representation of ``self``.
Expand Down Expand Up @@ -3825,7 +3817,6 @@ class IntegratedGeodesic(IntegratedAutoparallelCurve):
def __init__(self, parent, metric, curve_parameter,
initial_tangent_vector, chart=None, name=None,
latex_name=None, verbose=False, across_charts=False):

r"""
Construct a geodesic curve with respect to the given metric with the
given initial tangent vector.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ def _new_coef(self, frame):
start_index=self._domain._sindex,
output_formatter=DiffScalarField.coord_function)


def coef(self, frame=None):
r"""
Return the connection coefficients relative to the given frame.
Expand Down
1 change: 0 additions & 1 deletion src/sage/manifolds/differentiable/manifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -2977,7 +2977,6 @@ def change_of_frame(self, frame1, frame2):
" has not been defined on the {}".format(self))
return self._frame_changes[(frame1, frame2)]


def set_change_of_frame(self, frame1, frame2, change_of_frame,
compute_inverse=True):
r"""
Expand Down
2 changes: 0 additions & 2 deletions src/sage/manifolds/differentiable/manifold_homset.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,6 @@ def _repr_(self):
description += "which actually are integrated curves"
return description


def _element_constructor_(self, equations_rhs, velocities,
curve_parameter, initial_tangent_vector, chart=None,
name=None, latex_name=None, verbose=False, across_charts=False):
Expand Down Expand Up @@ -1221,7 +1220,6 @@ def _repr_(self):
description += "curves with respect to a certain affine connection"
return description


def _element_constructor_(self, affine_connection, curve_parameter,
initial_tangent_vector, chart=None, name=None,
latex_name=None, verbose=False, across_charts=False):
Expand Down
4 changes: 0 additions & 4 deletions src/sage/manifolds/differentiable/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,6 @@ def set(self, symbiform):
rst = self.restrict(dom)
rst.set(symbiform_rst)


def inverse(self, expansion_symbol=None, order=1):
r"""
Return the inverse metric.
Expand Down Expand Up @@ -879,7 +878,6 @@ def christoffel_symbols(self, chart=None):
frame = chart._frame
return self.connection().coef(frame)


def christoffel_symbols_display(self, chart=None, symbol=None,
latex_symbol=None, index_labels=None, index_latex_labels=None,
coordinate_labels=True, only_nonzero=True,
Expand Down Expand Up @@ -1069,7 +1067,6 @@ def riemann(self, name=None, latex_name=None):
"""
return self.connection().riemann(name, latex_name)


def ricci(self, name=None, latex_name=None):
r"""
Return the Ricci tensor associated with the metric.
Expand Down Expand Up @@ -2271,7 +2268,6 @@ def restrict(self, subdomain, dest_map=None):
self._restrictions[subdomain] = resu
return self._restrictions[subdomain]


def set(self, symbiform):
r"""
Define the metric from a field of symmetric bilinear forms.
Expand Down
1 change: 0 additions & 1 deletion src/sage/manifolds/differentiable/scalarfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,6 @@ def differential(self) -> DiffForm:
derivative = differential # allows one to use functional notation,
# e.g. diff(f) for f.differential()


def lie_derivative(self, vector):
r"""
Compute the Lie derivative with respect to a vector field.
Expand Down
3 changes: 0 additions & 3 deletions src/sage/manifolds/differentiable/tensorfield_paral.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ def __init__(self, vector_field_module, tensor_type, name=None,
# Initialization of derived quantities:
self._init_derived()


def _repr_(self):
r"""
String representation of ``self``.
Expand Down Expand Up @@ -769,7 +768,6 @@ def _preparse_display(self, basis=None, format_spec=None):
basis = basis.frame()
return (basis, format_spec)


def _set_comp_unsafe(self, basis=None):
r"""
Return the components of the tensor field in a given vector frame
Expand Down Expand Up @@ -1511,7 +1509,6 @@ def paral_lie_deriv(a, b , coord_frame, chart_cp, local_list_ind):
vc[[i]].coord_function(chart).diff(ind[k])
resc[[ind]] = rsum.scalar_field()


#
# 3/ Final result (the tensor)
res = vf_module.tensor_from_comp(self._tensor_type, resc)
Expand Down
1 change: 0 additions & 1 deletion src/sage/manifolds/differentiable/vectorfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ def __call__(self, scalar):
resu.set_name(name=name, latex_name=latex_name)
return resu


@options(max_range=8, scale=1, color='blue')
def plot(self, chart=None, ambient_coords=None, mapping=None,
chart_domain=None, fixed_coords=None, ranges=None,
Expand Down
1 change: 0 additions & 1 deletion src/sage/manifolds/differentiable/vectorfield_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,6 @@ def metric(self, name: str, signature: Optional[int] = None, latex_name: Optiona
return PseudoRiemannianMetric(self, name, signature=signature[0]-signature[1],
latex_name=latex_name)


def symplectic_form(
self, name: Optional[str] = None, latex_name: Optional[str] = None
):
Expand Down
2 changes: 0 additions & 2 deletions src/sage/manifolds/differentiable/vectorframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ def __init__(self, vector_field_module, symbol, latex_symbol=None,
# NB: set(self._restrictions.values()) is identical to
# self._subframes


###### Methods that must be redefined by derived classes of ######
###### FreeModuleBasis ######

Expand Down Expand Up @@ -1777,7 +1776,6 @@ def __init__(self, chart):
# - force_free=True ensures that a free module is constructed in case
# it is the first call to the vector field module on chart.domain()


###### Methods that must be redefined by derived classes of ######
###### FreeModuleBasis ######

Expand Down
1 change: 0 additions & 1 deletion src/sage/manifolds/scalarfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -2657,7 +2657,6 @@ def __neg__(self):
result._latex_name = '-' + self._latex_name
return result


######### CommutativeAlgebraElement arithmetic operators ########

def _add_(self, other):
Expand Down
1 change: 0 additions & 1 deletion src/sage/manifolds/trivialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,6 @@ def matrix(self):
"""
return self._automorphism.matrix(self._frame1)


def __eq__(self, other):
r"""
Equality operator.
Expand Down
2 changes: 0 additions & 2 deletions src/sage/matrix/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ def vecmat_ZZ(n=300, min=-9, max=9, system='sage', times=200):
raise ValueError('unknown system "%s"'%system)



#######################################################################
# Dense Benchmarks over GF(p), for small p.
#######################################################################
Expand Down Expand Up @@ -721,7 +720,6 @@ def matrix_add_GF(n=1000, p=16411, system='sage',times=100):
raise ValueError('unknown system "%s"'%system)



# Matrix multiplication over GF(p)

def matrix_multiply_GF(n=100, p=16411, system='sage', times=3):
Expand Down
11 changes: 0 additions & 11 deletions src/sage/matrix/compute_J_ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ def lifting(p, t, A, G):
"""
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing


DX = A.parent().base()
(X,) = DX.variable_names()
D = DX.base_ring()
Expand All @@ -203,7 +202,6 @@ def lifting(p, t, A, G):
if not (A*G % p**(t-1)).is_zero():
raise ValueError("A*G not zero mod %s^%s" % (p, t-1))


R = A*G/p**(t-1)
R.change_ring(DX)

Expand Down Expand Up @@ -351,7 +349,6 @@ def __init__(self, B):
self._DX = X.parent()
self._cache = {}


def find_monic_replacements(self, p, t, pt_generators, prev_nu):
r"""
Replace possibly non-monic generators of `N_{(p^t)}(B)` by monic
Expand Down Expand Up @@ -432,7 +429,6 @@ def find_monic_replacements(self, p, t, pt_generators, prev_nu):

return replacements


def current_nu(self, p, t, pt_generators, prev_nu):
r"""
Compute `(p^t)`-minimal polynomial of `B`.
Expand Down Expand Up @@ -482,7 +478,6 @@ def current_nu(self, p, t, pt_generators, prev_nu):

from sage.misc.verbose import verbose


if not all((g(self._B) % p**t).is_zero()
for g in pt_generators):
raise ValueError("%s not in N_{(%s^%s)}(B)" %
Expand Down Expand Up @@ -519,7 +514,6 @@ def current_nu(self, p, t, pt_generators, prev_nu):

return g


def mccoy_column(self, p, t, nu):
r"""
Compute matrix for McCoy's criterion.
Expand Down Expand Up @@ -577,7 +571,6 @@ def mccoy_column(self, p, t, nu):

return column


def p_minimal_polynomials(self, p, s_max=None):
r"""
Compute `(p^s)`-minimal polynomials `\nu_s` of `B`.
Expand Down Expand Up @@ -768,7 +761,6 @@ def p_minimal_polynomials(self, p, s_max=None):
d = self._A.ncols()
G = matrix(self._DX, d, 0)


while t < s_max:
deg_prev_nu = nu.degree()
t += 1
Expand Down Expand Up @@ -812,7 +804,6 @@ def p_minimal_polynomials(self, p, s_max=None):

return p_min_polys


def null_ideal(self, b=0):
r"""
Return the `(b)`-ideal `N_{(b)}(B)=\{f\in D[X] \mid f(B)\in M_n(bD)\}`.
Expand Down Expand Up @@ -877,7 +868,6 @@ def null_ideal(self, b=0):

return self._DX.ideal(generators)


def prime_candidates(self):
r"""
Determine those primes `p` where `\mu_B` might not be a
Expand Down Expand Up @@ -910,7 +900,6 @@ def prime_candidates(self):

return [p for (p, t) in factor(T.det())]


def integer_valued_polynomials_generators(self):
r"""
Determine the generators of the ring of integer valued polynomials on `B`.
Expand Down
1 change: 0 additions & 1 deletion src/sage/media/wav.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def __init__(self, data=None, **kwds):
else:
raise ValueError("Must give a filename")


def save(self, filename='sage.wav'):
r"""
Save this wave file to disk, either as a Sage sobj or as a .wav file.
Expand Down
Loading

0 comments on commit 80ada8e

Please sign in to comment.