Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit ff99c7f

Browse files
committed
Trac #19259: change to has_valid_variable
1 parent e4837e9 commit ff99c7f

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/sage/symbolic/subring.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def _repr_variables_(self):
301301
return s + ', '.join(str(v) for v in sorted(self._vars_, key=str))
302302

303303

304-
def is_variable_valid(self, variable):
304+
def has_valid_variable(self, variable):
305305
r"""
306306
Return whether the given ``variable`` is valid in this subring.
307307
@@ -316,7 +316,7 @@ def is_variable_valid(self, variable):
316316
EXAMPLES::
317317
318318
sage: from sage.symbolic.subring import GenericSymbolicSubring
319-
sage: GenericSymbolicSubring(vars=tuple()).is_variable_valid(x)
319+
sage: GenericSymbolicSubring(vars=tuple()).has_valid_variable(x)
320320
Traceback (most recent call last):
321321
...
322322
NotImplementedError: Not implemented in this abstract base class
@@ -351,7 +351,7 @@ def _element_constructor_(self, x):
351351
"""
352352
expression = super(GenericSymbolicSubring, self)._element_constructor_(x)
353353
assert(expression.parent() is self)
354-
if not all(self.is_variable_valid(var)
354+
if not all(self.has_valid_variable(var)
355355
for var in expression.variables()):
356356
raise TypeError('%s is not contained in %s' % (x, self))
357357
return expression
@@ -626,7 +626,7 @@ def _repr_(self):
626626
(self._repr_variables_())
627627

628628

629-
def is_variable_valid(self, variable):
629+
def has_valid_variable(self, variable):
630630
r"""
631631
Return whether the given ``variable`` is valid in this subring.
632632
@@ -642,11 +642,11 @@ def is_variable_valid(self, variable):
642642
643643
sage: from sage.symbolic.subring import SymbolicSubring
644644
sage: S = SymbolicSubring(accepting_variables=('a',))
645-
sage: S.is_variable_valid('a')
645+
sage: S.has_valid_variable('a')
646646
True
647-
sage: S.is_variable_valid('r')
647+
sage: S.has_valid_variable('r')
648648
False
649-
sage: S.is_variable_valid('x')
649+
sage: S.has_valid_variable('x')
650650
False
651651
"""
652652
return SR(variable) in self._vars_
@@ -811,7 +811,7 @@ def _repr_(self):
811811
(self._repr_variables_())
812812

813813

814-
def is_variable_valid(self, variable):
814+
def has_valid_variable(self, variable):
815815
r"""
816816
Return whether the given ``variable`` is valid in this subring.
817817
@@ -827,11 +827,11 @@ def is_variable_valid(self, variable):
827827
828828
sage: from sage.symbolic.subring import SymbolicSubring
829829
sage: S = SymbolicSubring(rejecting_variables=('r',))
830-
sage: S.is_variable_valid('a')
830+
sage: S.has_valid_variable('a')
831831
True
832-
sage: S.is_variable_valid('r')
832+
sage: S.has_valid_variable('r')
833833
False
834-
sage: S.is_variable_valid('x')
834+
sage: S.has_valid_variable('x')
835835
True
836836
"""
837837
return SR(variable) not in self._vars_
@@ -918,7 +918,7 @@ def _an_element_(self):
918918
Symbolic Subring rejecting the variables some_some_variable, some_variable
919919
"""
920920
v = SR.an_element()
921-
while not self.is_variable_valid(v):
921+
while not self.has_valid_variable(v):
922922
v = SR('some_' + str(v))
923923
return self(v)
924924

@@ -1016,7 +1016,7 @@ def _repr_(self):
10161016
return 'Symbolic Constants Subring'
10171017

10181018

1019-
def is_variable_valid(self, variable):
1019+
def has_valid_variable(self, variable):
10201020
r"""
10211021
Return whether the given ``variable`` is valid in this subring.
10221022
@@ -1032,11 +1032,11 @@ def is_variable_valid(self, variable):
10321032
10331033
sage: from sage.symbolic.subring import SymbolicSubring
10341034
sage: S = SymbolicSubring(no_variables=True)
1035-
sage: S.is_variable_valid('a')
1035+
sage: S.has_valid_variable('a')
10361036
False
1037-
sage: S.is_variable_valid('r')
1037+
sage: S.has_valid_variable('r')
10381038
False
1039-
sage: S.is_variable_valid('x')
1039+
sage: S.has_valid_variable('x')
10401040
False
10411041
"""
10421042
return False

0 commit comments

Comments
 (0)