sagemath/sage

Deprecate is_[Callable]SymbolicExpressionRing, remove use of is_Symbolic{Equation,Variable}, is_CallableSymbolicExpression

Closed this issue · 24 comments

We deprecate the functions is_SymbolicExpressionRing and is_CallableSymbolicExpressionRing and replace all uses by isinstance with new ABCs sage.rings.abc.SymbolicRing, sage.rings.abc.CallableSymbolicExpressionRing.

As a follow-up on #32638, which deprecated is_Expression, we remove uses of is_SymbolicEquation, is_CallableSymbolicExpression, is_SymbolicVariable outside of sage.symbolic, sage.calculus, sage.interfaces.maxima_lib.

We replace these uses by isinstance(x, Expression) and a method call. We add a new method Expression.is_callable.

This is part of meta-ticket #32414.

Depends on #32638
Depends on #32593
Depends on #32606
Depends on #32612

CC: @tscrim @orlitzky @kliem

Component: symbolics

Author: Matthias Koeppe

Branch: 341337a

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/32665

Dependencies: #32638

Changed dependencies from #32638 to #32638, #32593

Changed dependencies from #32638, #32593 to #32638, #32593, #32606

Changed dependencies from #32638, #32593, #32606 to #32638, #32593, #32606, #32612

Description changed:

--- 
+++ 
@@ -1,3 +1,5 @@
+We deprecate the functions `is_SymbolicExpressionRing` and `is_CallableSymbolicExpressionRing` and replace all uses by `isinstance` with new ABCs `sage.rings.abc.SymbolicRing`, `sage.rings.abc.CallableSymbolicExpressionRing`.
+
 As a follow-up on #32638, which deprecated `is_Expression`, we deprecate `is_SymbolicEquation`, `is_CallableSymbolicExpression`, `is_SymbolicVariable`. We replace uses by `isinstance(x, Expression)` and a method call (may need a new method `is_callable`).
 
 This is part of meta-ticket #32414.
comment:7

Setting to "needs_review" so that the patchbot runs


Last 10 new commits:

fc039f1src/sage/symbolic/ring.pyx: Fix imports
19ac6fdsrc/sage/rings/complex_interval_field.py: Fixup deprecation warning in doctest output
f31deb3src/sage/rings/qqbar.py: Remove unused import
362f5c0Merge branch 't/32606/replace_is_integermodring_by_isinstance_with_new_class_sage_rings_abc_integermodring' into t/32612/sage_rings_abc__real_complex__interval_ball_field__deprecate_is__real_complex_intervalfield
355dbcbMerge #32606
fb56937Merge tag '9.5.beta3' into t/32610/deprecate_is_realfield__is_complexfield__is_realdoublefield__is_complexdoublefield
8cc3500src/sage/rings/polynomial/polynomial_singular_interface.py: Fixup merge
124f213Merge #32610
80eff2aMerge #32612
5fb862eDeprecate is_[Callable]SymbolicExpressionRing, replace uses by isinstance(..., sage.rings.abc....)

Author: Matthias Koeppe

Commit: 5fb862e

Changed commit from 5fb862e to ee4bd52

Branch pushed to git repo; I updated commit sha1. New commits:

ee4bd52sage.rings.abc, sage.symbolic.ring: Fixup

Changed commit from ee4bd52 to 4bc059b

Branch pushed to git repo; I updated commit sha1. New commits:

b484d51src/sage/symbolic/callable.py: Fixup
fad87c0Expression.is_callable: New
4bc059bsrc/sage/ext/fast_callable.pyx: Remove use of is_CallableSymbolicExpression

Changed commit from 4bc059b to 37da733

Branch pushed to git repo; I updated commit sha1. New commits:

8624925src/sage/symbolic/ring.pyx: Update doctest output with deprecation warning
37da733src/sage/sets/condition_set.py: Remove use of is_CallableSymbolicExpression

Changed commit from 37da733 to 341337a

Branch pushed to git repo; I updated commit sha1. New commits:

80a8f9esage.plot: Remove use of is_CallableSymbolicExpression, is_SymbolicEquation
a287531src/sage/schemes/elliptic_curves/constructor.py: Remove use of SR, is_SymbolicEquation; add test for symbolic input
c9861d1src/sage/interfaces/qepcad.py: Remove use of is_SymbolicEquation
341337asrc/sage/ext/fast_callable.pyx: Remove use of is_SymbolicVariable

Description changed:

--- 
+++ 
@@ -1,6 +1,8 @@
 We deprecate the functions `is_SymbolicExpressionRing` and `is_CallableSymbolicExpressionRing` and replace all uses by `isinstance` with new ABCs `sage.rings.abc.SymbolicRing`, `sage.rings.abc.CallableSymbolicExpressionRing`.
 
-As a follow-up on #32638, which deprecated `is_Expression`, we deprecate `is_SymbolicEquation`, `is_CallableSymbolicExpression`, `is_SymbolicVariable`. We replace uses by `isinstance(x, Expression)` and a method call (may need a new method `is_callable`).
+As a follow-up on #32638, which deprecated `is_Expression`, we remove uses of `is_SymbolicEquation`, `is_CallableSymbolicExpression`, `is_SymbolicVariable` outside of `sage.symbolic`, `sage.calculus`, `sage.interfaces.maxima_lib`.
+
+We replace these uses by `isinstance(x, Expression)` and a method call. We add a new method `Expression.is_callable`.
 
 This is part of meta-ticket #32414.
 
comment:13

If this is fully ready for review (just checking relative to comment:7), then you can set a positive review.

Reviewer: Travis Scrimshaw

comment:14

Thank you! Yes, I was finished here.

comment:16

Follow up in #34215

Changed commit from 341337a to none