|
132 | 132 |
|
133 | 133 | import sage.geometry.abc
|
134 | 134 | from sage.schemes.toric.variety import ToricVariety_field
|
135 |
| -from sage.schemes.toric.divisor import is_ToricDivisor |
| 135 | +from sage.schemes.toric.divisor import ToricDivisor_generic |
136 | 136 |
|
137 | 137 |
|
138 | 138 | class ChowCycle(FGP_Element):
|
@@ -408,7 +408,7 @@ def intersection_with_divisor(self, divisor):
|
408 | 408 | (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
|
409 | 409 | (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)]
|
410 | 410 | """
|
411 |
| - assert is_ToricDivisor(divisor), f'{divisor} is not a toric divisor' |
| 411 | + assert isinstance(divisor, ToricDivisor_generic), f'{divisor} is not a toric divisor' |
412 | 412 |
|
413 | 413 | A = self.parent() # the Chow group
|
414 | 414 | X = A._variety # the toric variety
|
@@ -610,7 +610,7 @@ def __init__(self, toric_variety, base_ring, check):
|
610 | 610 | Chow group of 2-d CPR-Fano toric variety covered by 3 affine patches
|
611 | 611 | sage: isinstance(A, ChowGroup_class)
|
612 | 612 | True
|
613 |
| - sage: is_ChowCycle(A.an_element()) |
| 613 | + sage: isinstance(A.an_element(), ChowCycle) |
614 | 614 | True
|
615 | 615 |
|
616 | 616 | TESTS::
|
@@ -701,7 +701,7 @@ def _element_constructor_(self, x, check=True):
|
701 | 701 | if isinstance(x, sage.geometry.abc.ConvexRationalPolyhedralCone):
|
702 | 702 | cone = fan.embed(x)
|
703 | 703 | return self.element_class(self, self._cone_to_V(cone), False)
|
704 |
| - if is_ToricDivisor(x): |
| 704 | + if isinstance(x, ToricDivisor_generic): |
705 | 705 | v = sum(x.coefficient(i) * self._cone_to_V(onecone)
|
706 | 706 | for i, onecone in enumerate(fan(1)))
|
707 | 707 | return self.element_class(self, v, False)
|
@@ -1244,10 +1244,18 @@ def is_ChowCycle(x) -> bool:
|
1244 | 1244 | sage: A = P2.Chow_group()
|
1245 | 1245 | sage: from sage.schemes.toric.chow_group import *
|
1246 | 1246 | sage: is_ChowCycle(A)
|
| 1247 | + doctest:warning... |
| 1248 | + DeprecationWarning: The function is_ChowCycle is deprecated; |
| 1249 | + use 'isinstance(..., ChowCycle)' instead. |
| 1250 | + See https://github.com/sagemath/sage/issues/38277 for details. |
1247 | 1251 | False
|
1248 | 1252 | sage: is_ChowCycle(A.an_element())
|
1249 | 1253 | True
|
1250 | 1254 | sage: is_ChowCycle('Victoria')
|
1251 | 1255 | False
|
1252 | 1256 | """
|
| 1257 | + from sage.misc.superseded import deprecation |
| 1258 | + deprecation(38277, |
| 1259 | + "The function is_ChowCycle is deprecated; " |
| 1260 | + "use 'isinstance(..., ChowCycle)' instead.") |
1253 | 1261 | return isinstance(x, ChowCycle)
|
0 commit comments