diff --git a/src/sage/combinat/alternating_sign_matrix.py b/src/sage/combinat/alternating_sign_matrix.py index fba8f842fc8..921320fe22e 100644 --- a/src/sage/combinat/alternating_sign_matrix.py +++ b/src/sage/combinat/alternating_sign_matrix.py @@ -1197,7 +1197,7 @@ def _element_constructor_(self, asm, check=True): if isinstance(asm, AlternatingSignMatrix): if asm.parent() is self: return asm - raise ValueError("Cannot convert between alternating sign matrices of different sizes") + raise ValueError("cannot convert between alternating sign matrices of different sizes") try: m = self._matrix_space(asm) except (TypeError, ValueError): diff --git a/src/sage/combinat/decorated_permutation.py b/src/sage/combinat/decorated_permutation.py index f8ca5c8b78b..2ca513767c4 100644 --- a/src/sage/combinat/decorated_permutation.py +++ b/src/sage/combinat/decorated_permutation.py @@ -213,7 +213,7 @@ def _element_constructor_(self, pi, check=True): if isinstance(pi, DecoratedPermutation): if pi.parent() is self: return pi - raise ValueError("Cannot convert between decorated permutations of different sizes") + raise ValueError("cannot convert between decorated permutations of different sizes") pi = tuple(pi) if check and pi not in self: diff --git a/src/sage/combinat/derangements.py b/src/sage/combinat/derangements.py index eeeb73fb7ce..1645ff2d53b 100644 --- a/src/sage/combinat/derangements.py +++ b/src/sage/combinat/derangements.py @@ -199,7 +199,7 @@ def _element_constructor_(self, der): if isinstance(der, Derangement): if der.parent() is self: return der - raise ValueError("Cannot convert %s to an element of %s" % (der, self)) + raise ValueError("cannot convert %s to an element of %s" % (der, self)) return self.element_class(self, der) Element = Derangement diff --git a/src/sage/data_structures/bounded_integer_sequences.pyx b/src/sage/data_structures/bounded_integer_sequences.pyx index 724f296eae2..d431c71f663 100644 --- a/src/sage/data_structures/bounded_integer_sequences.pyx +++ b/src/sage/data_structures/bounded_integer_sequences.pyx @@ -1212,7 +1212,7 @@ cdef class BoundedIntegerSequence: sage: T+None Traceback (most recent call last): ... - TypeError: Cannot concatenate bounded integer sequence and None + TypeError: cannot concatenate bounded integer sequence and None TESTS: @@ -1228,7 +1228,7 @@ cdef class BoundedIntegerSequence: """ cdef BoundedIntegerSequence myself, right, out if other is None or self is None: - raise TypeError('Cannot concatenate bounded integer sequence and None') + raise TypeError('cannot concatenate bounded integer sequence and None') myself = self # may result in a type error right = other # --"-- if right.data.itembitsize != myself.data.itembitsize: diff --git a/src/sage/geometry/lattice_polytope.py b/src/sage/geometry/lattice_polytope.py index 939564dd73f..3a043815a38 100644 --- a/src/sage/geometry/lattice_polytope.py +++ b/src/sage/geometry/lattice_polytope.py @@ -5251,8 +5251,8 @@ def from_palp_index(i): elif o in range(65, 91): i = o - 28 else: - raise ValueError('Cannot convert PALP index ' - + i + ' to number.') + raise ValueError('cannot convert PALP index ' + + i + ' to number') return i n = len(permutation) domain = [from_palp_index(i) for i in permutation] @@ -5261,6 +5261,7 @@ def from_palp_index(i): S = SymmetricGroup(n) return make_permgroup_element(S, domain) + def _read_nef_x_partitions(data): r""" Read all nef-partitions for one polytope from a string or an open diff --git a/src/sage/geometry/polyhedron/parent.py b/src/sage/geometry/polyhedron/parent.py index 8c4905b4b91..3f79008908d 100644 --- a/src/sage/geometry/polyhedron/parent.py +++ b/src/sage/geometry/polyhedron/parent.py @@ -697,7 +697,7 @@ def convert_base_ring_Hrep(lstlst): return self._element_constructor_polyhedron(polyhedron, mutable=mutable, **kwds) if nargs == 1 and args[0] == 0: return self.zero() - raise ValueError('Cannot convert to polyhedron object.') + raise ValueError('cannot convert to polyhedron object') def _element_constructor_polyhedron(self, polyhedron, **kwds): """ diff --git a/src/sage/libs/giac/giac.pyx b/src/sage/libs/giac/giac.pyx index ccad5169836..990114fb4a5 100644 --- a/src/sage/libs/giac/giac.pyx +++ b/src/sage/libs/giac/giac.pyx @@ -1408,7 +1408,7 @@ cdef class Pygen(GiacMethods_base): return result else: - raise TypeError("Cannot convert non giac integers to Integer") + raise TypeError("cannot convert non giac integers to Integer") def _rational_(self,Z=None): @@ -1433,7 +1433,7 @@ cdef class Pygen(GiacMethods_base): # giac _RAT_ return ZZ(self.numer()) / ZZ(self.denom()) else: - raise TypeError("Cannot convert non giac _FRAC_ to QQ") + raise TypeError("cannot convert non giac _FRAC_ to QQ") def sage(self): @@ -1735,7 +1735,7 @@ cdef class Pygen(GiacMethods_base): sig_off() return result else: - raise TypeError("Cannot convert non _INT_ giac gen") + raise TypeError("cannot convert non _INT_ giac gen") property _double: # immediate double (type _DOUBLE_) @@ -1749,7 +1749,7 @@ cdef class Pygen(GiacMethods_base): sig_off() return result else: - raise TypeError("Cannot convert non _DOUBLE_ giac gen") + raise TypeError("cannot convert non _DOUBLE_ giac gen") property help: def __get__(self): diff --git a/src/sage/libs/pari/convert_sage.pyx b/src/sage/libs/pari/convert_sage.pyx index 62fe5185cfb..96bce94ad5f 100644 --- a/src/sage/libs/pari/convert_sage.pyx +++ b/src/sage/libs/pari/convert_sage.pyx @@ -352,7 +352,7 @@ cpdef set_integer_from_gen(Integer self, Gen x): break elif paritype == t_PADIC: if x._valp() < 0: - raise TypeError("Cannot convert p-adic with negative valuation to an integer") + raise TypeError("cannot convert p-adic with negative valuation to an integer") # Lifting a PADIC yields an integer x = x.lift() break diff --git a/src/sage/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx index f103a3b8654..906f1e6c860 100644 --- a/src/sage/libs/singular/function.pyx +++ b/src/sage/libs/singular/function.pyx @@ -1304,7 +1304,7 @@ cdef class SingularFunction(SageObject): dummy_ring = PolynomialRing(QQ, "dummy", implementation="singular") # seems a reasonable default ring = dummy_ring if not (isinstance(ring, MPolynomialRing_libsingular) or isinstance(ring, NCPolynomialRing_plural)): - raise TypeError("Cannot call Singular function '%s' with ring parameter of type '%s'"%(self._name,type(ring))) + raise TypeError("cannot call Singular function '%s' with ring parameter of type '%s'" % (self._name,type(ring))) return call_function(self, args, ring, interruptible, attributes) def _instancedoc_(self): diff --git a/src/sage/modules/vector_rational_dense.pyx b/src/sage/modules/vector_rational_dense.pyx index ff1b4914295..1987e881151 100644 --- a/src/sage/modules/vector_rational_dense.pyx +++ b/src/sage/modules/vector_rational_dense.pyx @@ -326,7 +326,7 @@ cdef class Vector_rational_dense(free_module_element.FreeModuleElement): mpq_set_z(a.value, (left).value) else: # should not happen - raise TypeError("Cannot convert %s to %s" % (type(left).__name__, Rational.__name__)) + raise TypeError("cannot convert %s to %s" % (type(left).__name__, Rational.__name__)) z = self._new_c() cdef Py_ssize_t i for i in range(self._degree): @@ -343,7 +343,7 @@ cdef class Vector_rational_dense(free_module_element.FreeModuleElement): mpq_set_z(a.value, (right).value) else: # should not happen - raise TypeError("Cannot convert %s to %s" % (type(right).__name__, Rational.__name__)) + raise TypeError("cannot convert %s to %s" % (type(right).__name__, Rational.__name__)) z = self._new_c() cdef Py_ssize_t i for i in range(self._degree): diff --git a/src/sage/rings/asymptotic/asymptotic_ring.py b/src/sage/rings/asymptotic/asymptotic_ring.py index 1423513a993..ff419b69df5 100644 --- a/src/sage/rings/asymptotic/asymptotic_ring.py +++ b/src/sage/rings/asymptotic/asymptotic_ring.py @@ -4158,9 +4158,9 @@ def _element_constructor_(self, data, simplify=True, convert=True): elif is_PowerSeriesRing(P): raise NotImplementedError( - 'Cannot convert %s from the %s to an asymptotic expansion ' + 'cannot convert %s from the %s to an asymptotic expansion ' 'in %s, since growths at other points than +oo are not yet ' - 'supported.' % (data, P, self)) + 'supported' % (data, P, self)) # Delete lines above as soon as we can deal with growths # other than the that at going to +oo. from sage.rings.infinity import PlusInfinity diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx index e98b973b592..67d51b74ab4 100644 --- a/src/sage/rings/integer.pyx +++ b/src/sage/rings/integer.pyx @@ -571,7 +571,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement): sage: ZZ(pari(Qp(11)(11^-7))) Traceback (most recent call last): ... - TypeError: Cannot convert p-adic with negative valuation to an integer + TypeError: cannot convert p-adic with negative valuation to an integer Test converting a list with a very large base:: @@ -640,7 +640,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement): if n == x: mpz_set_pylong(self.value, n) else: - raise TypeError("Cannot convert non-integral float to integer") + raise TypeError("cannot convert non-integral float to integer") elif isinstance(x, pari_gen): global set_integer_from_gen diff --git a/src/sage/rings/number_field/number_field.py b/src/sage/rings/number_field/number_field.py index e10d4eeeb33..0d2271844ca 100644 --- a/src/sage/rings/number_field/number_field.py +++ b/src/sage/rings/number_field/number_field.py @@ -8063,7 +8063,7 @@ def _coerce_from_other_number_field(self, x): sage: L(a) Traceback (most recent call last): ... - ValueError: Cannot convert a to Number Field in b with defining polynomial x^3 - 4*x + 1 with b = 1.860805853111704? (using the specified embeddings) + ValueError: cannot convert a to Number Field in b with defining polynomial x^3 - 4*x + 1 with b = 1.860805853111704? (using the specified embeddings) Subfields automatically come with an embedding:: @@ -8156,7 +8156,7 @@ def _coerce_from_other_number_field(self, x): f = x.minpoly() ys = f.roots(ring=K, multiplicities=False) if not ys: - raise ValueError("Cannot convert %s to %s (regardless of embeddings)" % (x, K)) + raise ValueError("cannot convert %s to %s (regardless of embeddings)" % (x, K)) # Define a function are_roots_equal to determine whether two # roots of f are equal. A simple a == b does not suffice for @@ -8213,7 +8213,7 @@ def _coerce_from_other_number_field(self, x): emb_y = y.polynomial()(Kgen) if are_roots_equal(emb_x, emb_y): return y - raise ValueError("Cannot convert %s to %s (using the specified embeddings)" % (x, K)) + raise ValueError("cannot convert %s to %s (using the specified embeddings)" % (x, K)) def _coerce_map_from_(self, R): """ @@ -11220,7 +11220,7 @@ def _coerce_from_other_cyclotomic_field(self, x, only_canonical=False): if z == x: return self.zeta(m)**(r+1) z *= y - raise TypeError("Cannot coerce %s into %s" % (x, self)) + raise TypeError("cannot coerce %s into %s" % (x, self)) return self._element_class(self, x) def _coerce_from_gap(self, x): diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py index 71494eddbc0..aaee4cbeddf 100644 --- a/src/sage/rings/polynomial/multi_polynomial_ideal.py +++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py @@ -2187,7 +2187,7 @@ def transformed_basis(self, algorithm="gwalk", other_ring=None, singular=singula return PolynomialSequence(nR, sorted([nR(f) for f in nIs],reverse=True), immutable=True) else: - raise TypeError("Cannot convert basis with given algorithm") + raise TypeError("cannot convert basis with given algorithm") @handle_AA_and_QQbar def elimination_ideal(self, variables, algorithm=None, *args, **kwds): diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index a522af5457c..e8acc5a65b1 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -8027,11 +8027,11 @@ cdef class Polynomial(CommutativeAlgebraElement): sage: f.roots(RR) Traceback (most recent call last): ... - TypeError: Cannot evaluate symbolic expression to a numeric value. + TypeError: cannot evaluate symbolic expression to a numeric value sage: f.roots(CC) Traceback (most recent call last): ... - TypeError: Cannot evaluate symbolic expression to a numeric value. + TypeError: cannot evaluate symbolic expression to a numeric value We can find roots of polynomials defined over `\ZZ` or `\QQ` over the `p`-adics, see :trac:`15422`:: diff --git a/src/sage/rings/polynomial/polynomial_real_mpfr_dense.pyx b/src/sage/rings/polynomial/polynomial_real_mpfr_dense.pyx index 8fa744ff668..c13372dcd25 100644 --- a/src/sage/rings/polynomial/polynomial_real_mpfr_dense.pyx +++ b/src/sage/rings/polynomial/polynomial_real_mpfr_dense.pyx @@ -85,12 +85,12 @@ cdef class PolynomialRealDense(Polynomial): sage: PolynomialRealDense(RR['x'], [1,a]) Traceback (most recent call last): ... - TypeError: Cannot evaluate symbolic expression to a numeric value. + TypeError: cannot evaluate symbolic expression to a numeric value sage: R. = SR[] sage: (x-a).change_ring(RR) Traceback (most recent call last): ... - TypeError: Cannot evaluate symbolic expression to a numeric value. + TypeError: cannot evaluate symbolic expression to a numeric value sage: sig_on_count() 0 diff --git a/src/sage/rings/real_double.pyx b/src/sage/rings/real_double.pyx index 1341d2f65ff..d5760fd69e2 100644 --- a/src/sage/rings/real_double.pyx +++ b/src/sage/rings/real_double.pyx @@ -947,7 +947,7 @@ cdef class RealDoubleElement(FieldElement): sage: ZZ(RDF(-2345.67)) Traceback (most recent call last): ... - TypeError: Cannot convert non-integral float to integer + TypeError: cannot convert non-integral float to integer """ return Integer(self._value) diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx index 1f7d7d7f4f8..c6573448a93 100644 --- a/src/sage/rings/real_mpfi.pyx +++ b/src/sage/rings/real_mpfi.pyx @@ -5356,7 +5356,8 @@ def __create__RealIntervalField_version0(prec, sci_not): """ return RealIntervalField(prec, sci_not) -## Keep all old versions!!! + +# Keep all old versions!!! def __create__RealIntervalFieldElement_version0(parent, x, base=10): """ For pickling. @@ -5368,6 +5369,7 @@ def __create__RealIntervalFieldElement_version0(parent, x, base=10): """ return RealIntervalFieldElement(parent, x, base=base) + def __create__RealIntervalFieldElement_version1(parent, lower, upper): """ For pickling. diff --git a/src/sage/rings/real_mpfr.pyx b/src/sage/rings/real_mpfr.pyx index 421f489a559..32a3e0494f8 100644 --- a/src/sage/rings/real_mpfr.pyx +++ b/src/sage/rings/real_mpfr.pyx @@ -2247,7 +2247,7 @@ cdef class RealNumber(sage.structure.element.RingElement): 100000000000000000 """ if not mpfr_number_p(self.value): - raise ValueError('Cannot convert infinity or NaN to Sage Integer') + raise ValueError('cannot convert infinity or NaN to Sage Integer') cdef Integer z = Integer() mpfr_get_z(z.value, self.value, MPFR_RNDZ) @@ -3236,7 +3236,7 @@ cdef class RealNumber(sage.structure.element.RingElement): <... 'int'> """ if not mpfr_number_p(self.value): - raise ValueError('Cannot convert infinity or NaN to Python int') + raise ValueError('cannot convert infinity or NaN to Python int') cdef Integer z = Integer() mpfr_get_z(z.value, self.value, MPFR_RNDZ) @@ -3352,7 +3352,7 @@ cdef class RealNumber(sage.structure.element.RingElement): # as subject-to-change. if mpfr_nan_p(self.value) or mpfr_inf_p(self.value): - raise ValueError('Cannot convert NaN or infinity to Pari float') + raise ValueError('cannot convert NaN or infinity to Pari float') # wordsize for PARI cdef unsigned long wordsize = sizeof(long)*8 @@ -3678,14 +3678,14 @@ cdef class RealNumber(sage.structure.element.RingElement): sage: RR('nan').simplest_rational() Traceback (most recent call last): ... - ValueError: Cannot convert NaN or infinity to rational number + ValueError: cannot convert NaN or infinity to rational number sage: RR('-infinity').simplest_rational() Traceback (most recent call last): ... - ValueError: Cannot convert NaN or infinity to rational number + ValueError: cannot convert NaN or infinity to rational number """ if not mpfr_number_p(self.value): - raise ValueError('Cannot convert NaN or infinity to rational number') + raise ValueError('cannot convert NaN or infinity to rational number') if mpfr_zero_p(self.value): return Rational(0) @@ -3784,23 +3784,23 @@ cdef class RealNumber(sage.structure.element.RingElement): sage: RR('nan').nearby_rational(max_denominator=1000) Traceback (most recent call last): ... - ValueError: Cannot convert NaN or infinity to rational number + ValueError: cannot convert NaN or infinity to rational number sage: RR('nan').nearby_rational(max_error=0.01) Traceback (most recent call last): ... - ValueError: Cannot convert NaN or infinity to rational number + ValueError: cannot convert NaN or infinity to rational number sage: RR(oo).nearby_rational(max_denominator=1000) Traceback (most recent call last): ... - ValueError: Cannot convert NaN or infinity to rational number + ValueError: cannot convert NaN or infinity to rational number sage: RR(oo).nearby_rational(max_error=0.01) Traceback (most recent call last): ... - ValueError: Cannot convert NaN or infinity to rational number + ValueError: cannot convert NaN or infinity to rational number """ if not mpfr_number_p(self.value): - raise ValueError('Cannot convert NaN or infinity to rational number') + raise ValueError('cannot convert NaN or infinity to rational number') if ((max_error is None and max_denominator is None) or (max_error is not None and max_denominator is not None)): @@ -6105,7 +6105,7 @@ def create_RealField(*args, **kwds): See https://github.com/sagemath/sage/issues/24511 for details. Real Field with 53 bits of precision """ - #deprecation has already been imported in this file + # deprecation has already been imported in this file deprecation(24511, "Please import create_RealField from sage.rings.real_field") from sage.rings.real_field import create_RealField as cr return cr(*args, **kwds) diff --git a/src/sage/rings/universal_cyclotomic_field.py b/src/sage/rings/universal_cyclotomic_field.py index d238bce3450..0ef56bfd2d0 100644 --- a/src/sage/rings/universal_cyclotomic_field.py +++ b/src/sage/rings/universal_cyclotomic_field.py @@ -561,7 +561,7 @@ def to_cyclotomic_field(self, R=None): sage: CF(E(5)) # indirect doctest Traceback (most recent call last): ... - TypeError: Cannot coerce zeta5 into Cyclotomic Field of order 7 and + TypeError: cannot coerce zeta5 into Cyclotomic Field of order 7 and degree 6 sage: CF = CyclotomicField(10) diff --git a/src/sage/schemes/generic/ambient_space.py b/src/sage/schemes/generic/ambient_space.py index aa4645d4e88..0f9b9b55240 100644 --- a/src/sage/schemes/generic/ambient_space.py +++ b/src/sage/schemes/generic/ambient_space.py @@ -379,7 +379,7 @@ def dimension_absolute(self): base = self.base_scheme() if base.is_noetherian(): return self.dimension_relative() + base.dimension() - raise NotImplementedError("Cannot compute the dimension of this scheme.") + raise NotImplementedError("cannot compute the dimension of this scheme") dimension = dimension_absolute diff --git a/src/sage/structure/coerce_maps.pyx b/src/sage/structure/coerce_maps.pyx index 6675fc84019..3537c24e678 100644 --- a/src/sage/structure/coerce_maps.pyx +++ b/src/sage/structure/coerce_maps.pyx @@ -282,7 +282,7 @@ cdef class NamedConvertMap(Map): print(type(x), x) print(type(C), C) print(self.method_name) - raise TypeError("Cannot coerce {} to {}".format(x, C)) + raise TypeError(f"cannot coerce {x} to {C}") cdef Map m cdef Element e = method(C) if e is None: diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx index 6ad3075c5f4..9fd165e3336 100644 --- a/src/sage/structure/element.pyx +++ b/src/sage/structure/element.pyx @@ -4432,11 +4432,11 @@ def coerce_binop(method): Another real example:: - sage: R1=QQ['x,y'] - sage: R2=QQ['x,y,z'] - sage: f=R1(1) - sage: g=R1(2) - sage: h=R2(1) + sage: R1 = QQ['x,y'] + sage: R2 = QQ['x,y,z'] + sage: f = R1(1) + sage: g = R1(2) + sage: h = R2(1) sage: f.gcd(g) 1 sage: f.gcd(g,algorithm='modular') diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx index b287d13c118..54bfd3465ec 100644 --- a/src/sage/symbolic/expression.pyx +++ b/src/sage/symbolic/expression.pyx @@ -1603,7 +1603,7 @@ cdef class Expression(Expression_abc): sage: x._eval_self(CC) Traceback (most recent call last): ... - TypeError: Cannot evaluate symbolic expression to a numeric value. + TypeError: cannot evaluate symbolic expression to a numeric value Check if we can compute a real evaluation even if the expression contains complex coefficients:: @@ -1644,7 +1644,7 @@ cdef class Expression(Expression_abc): ans = ans.real return R(ans) else: - raise TypeError("Cannot evaluate symbolic expression to a numeric value.") + raise TypeError("cannot evaluate symbolic expression to a numeric value") cpdef _convert(self, kwds): """ @@ -7070,7 +7070,7 @@ cdef class Expression(Expression_abc): sage: p.coefficients(x, sparse=False) Traceback (most recent call last): ... - ValueError: Cannot return dense coefficient list with noninteger exponents. + ValueError: cannot return dense coefficient list with noninteger exponents Series coefficients are now handled correctly (:trac:`17399`):: @@ -7132,12 +7132,12 @@ cdef class Expression(Expression_abc): else: from sage.rings.integer_ring import ZZ if any(not c[1] in ZZ for c in l): - raise ValueError("Cannot return dense coefficient list with noninteger exponents.") + raise ValueError("cannot return dense coefficient list with noninteger exponents") if not l: l = [[0, 0]] val = l[0][1] if val < 0: - raise ValueError("Cannot return dense coefficient list with negative valuation.") + raise ValueError("cannot return dense coefficient list with negative valuation") deg = l[-1][1] ret = [ZZ(0)] * int(deg+1) for c in l: @@ -8264,7 +8264,7 @@ cdef class Expression(Expression_abc): sage: (x^(1/3)).horner(x) Traceback (most recent call last): ... - ValueError: Cannot return dense coefficient list with noninteger exponents. + ValueError: cannot return dense coefficient list with noninteger exponents """ coef = self.coefficients(x, sparse=False) res = coef[-1] @@ -12102,7 +12102,7 @@ cdef class Expression(Expression_abc): sage: wrong.convert() Traceback (most recent call last): ... - ValueError: Cannot convert + ValueError: cannot convert """ from . import units return units.convert(self, target) diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx index 20a576a3b5a..2bfb28f249e 100644 --- a/src/sage/symbolic/ring.pyx +++ b/src/sage/symbolic/ring.pyx @@ -1140,7 +1140,7 @@ cdef class SymbolicRing(sage.rings.abc.SymbolicRing): :doc:`subring` """ if self is not SR: - raise NotImplementedError('Cannot create subring of %s.' % (self,)) + raise NotImplementedError('cannot create subring of %s' % (self,)) from .subring import SymbolicSubring return SymbolicSubring(*args, **kwds) diff --git a/src/sage/symbolic/series_impl.pxi b/src/sage/symbolic/series_impl.pxi index 18c017066f6..4ddea0ffc6f 100644 --- a/src/sage/symbolic/series_impl.pxi +++ b/src/sage/symbolic/series_impl.pxi @@ -246,10 +246,10 @@ cdef class SymbolicSeries(Expression): else: from sage.rings.integer_ring import ZZ if any(not c[1] in ZZ for c in l): - raise ValueError("Cannot return dense coefficient list with noninteger exponents.") + raise ValueError("cannot return dense coefficient list with noninteger exponents") val = l[0][1] if val < 0: - raise ValueError("Cannot return dense coefficient list with negative valuation.") + raise ValueError("cannot return dense coefficient list with negative valuation") deg = l[-1][1] ret = [ZZ(0)] * int(deg+1) for c in l: diff --git a/src/sage/symbolic/subring.py b/src/sage/symbolic/subring.py index e30e29a16cf..05ec90861fd 100644 --- a/src/sage/symbolic/subring.py +++ b/src/sage/symbolic/subring.py @@ -181,33 +181,33 @@ def create_key_and_extra_args( sage: SymbolicSubring.create_key_and_extra_args() Traceback (most recent call last): ... - ValueError: Cannot create a symbolic subring since nothing is specified. + ValueError: cannot create a symbolic subring since nothing is specified sage: SymbolicSubring.create_key_and_extra_args( ....: accepting_variables=('a',), rejecting_variables=('r',)) Traceback (most recent call last): ... - ValueError: Cannot create a symbolic subring since input is ambiguous. + ValueError: cannot create a symbolic subring since input is ambiguous sage: SymbolicSubring.create_key_and_extra_args( ....: accepting_variables=('a',), no_variables=True) Traceback (most recent call last): ... - ValueError: Cannot create a symbolic subring since input is ambiguous. + ValueError: cannot create a symbolic subring since input is ambiguous sage: SymbolicSubring.create_key_and_extra_args( ....: rejecting_variables=('r',), no_variables=True) Traceback (most recent call last): ... - ValueError: Cannot create a symbolic subring since input is ambiguous. + ValueError: cannot create a symbolic subring since input is ambiguous """ if accepting_variables is None and \ rejecting_variables is None and \ not no_variables: - raise ValueError('Cannot create a symbolic subring ' - 'since nothing is specified.') + raise ValueError('cannot create a symbolic subring ' + 'since nothing is specified') if accepting_variables is not None and rejecting_variables is not None or \ rejecting_variables is not None and no_variables or \ no_variables and accepting_variables is not None: - raise ValueError('Cannot create a symbolic subring ' - 'since input is ambiguous.') + raise ValueError('cannot create a symbolic subring ' + 'since input is ambiguous') if accepting_variables is not None: vars = tuple(accepting_variables) diff --git a/src/sage/symbolic/units.py b/src/sage/symbolic/units.py index 9b5407786e1..5732f11ded3 100644 --- a/src/sage/symbolic/units.py +++ b/src/sage/symbolic/units.py @@ -61,7 +61,7 @@ sage: wrong.convert() Traceback (most recent call last): ... - ValueError: Cannot convert + ValueError: cannot convert TESTS: @@ -1434,12 +1434,12 @@ def convert_temperature(expr, target): sage: t.convert(units.length.foot) Traceback (most recent call last): ... - ValueError: Cannot convert + ValueError: cannot convert sage: wrong = units.length.meter*units.temperature.fahrenheit sage: wrong.convert() Traceback (most recent call last): ... - ValueError: Cannot convert + ValueError: cannot convert We directly call the convert_temperature function:: @@ -1449,7 +1449,7 @@ def convert_temperature(expr, target): 98.6000000000000 """ if len(expr.variables()) != 1: - raise ValueError("Cannot convert") + raise ValueError("cannot convert") elif target is None or unit_to_type[str(target)] == 'temperature': from sage.misc.sage_eval import sage_eval expr_temp = expr.variables()[0] @@ -1467,4 +1467,4 @@ def convert_temperature(expr, target): elif target_temp == units.temperature.rankine: return a[3]*target_temp else: - raise ValueError("Cannot convert") + raise ValueError("cannot convert")