sagemath/sage

Use sage.rings.abc.RealField, sage.rings.abc.ComplexField more

Closed this issue · 24 comments

As a follow-up on #32566 and #32610, we replace isinstance tests with RealField_class by the sage.rings.abc.RealField.

git grep -E 'isinstance.*(Real|Complex)Field_class' finds these uses.

Depends on #32665
Depends on #32758
Depends on #32635

CC: @tobiasdiez @tscrim @EnderWannabe @bhutz

Component: refactoring

Author: Matthias Koeppe

Branch/Commit: 29e784b

Reviewer: Travis Scrimshaw

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

Description changed:

--- 
+++ 
@@ -1,2 +1,3 @@
 As a follow-up on #32566 and #32610, we replace `isinstance` tests with `RealField_class` by the `sage.rings.abc.RealField`.
 
+`git grep -E 'isinstance.*(Real|Complex)Field_class'` finds these uses.

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

6dce213src/sage/schemes/projective/projective_morphism.py: Use sage.rings.abc
7e8f0bbsrc/sage/rings/real_double.pyx: Use sage.rings.abc

Author: Matthias Koeppe

Changed commit from 7e8f0bb to a665529

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

fbf6666src/sage/rings/continued_fraction.py: Use sage.rings.abc
9f17894src/sage/matrix/matrix_space.py: Use sage.rings.abc
2dd97basrc/sage/rings/asymptotic/asymptotic_ring.py: Use sage.rings.abc
41b7860src/sage/rings/convert/mpfi.pyx: Use sage.rings.abc
5d2e72csrc/sage/rings/infinity.py: Use sage.rings.abc
a665529src/sage/rings/polynomial/polynomial_ring.py: Use sage.rings.abc

Dependencies: #32665

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

fad87c0Expression.is_callable: New
4bc059bsrc/sage/ext/fast_callable.pyx: Remove use of is_CallableSymbolicExpression
8624925src/sage/symbolic/ring.pyx: Update doctest output with deprecation warning
37da733src/sage/sets/condition_set.py: Remove use of is_CallableSymbolicExpression
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
1ee09aaMerge #32665
8c38bafsrc/sage/rings/continued_fraction.py: Add missing import

Changed commit from a665529 to 8c38baf

comment:8

The doctest failure in integer.pyx is not from this ticket.

Changed dependencies from #32665 to #32665, #32758

Changed commit from 8c38baf to b3c1667

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

c8499d1fix E713 and E714 in schemes
b3c1667Merge #32758

Changed commit from b3c1667 to a1362ee

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

ce8687bMerge #32612
15884f3src/sage/matrix/matrix_space.py: Import element classes on demand, fall back to generic on ImportError
ac58286Matrix.gram_schmidt: Use sage.rings.abc
6d4ee6eMatrix.gram_schmidt: Use sage.rings.abc (fixup)
a1362eeMerge #32635

Changed dependencies from #32665, #32758 to #32665, #32758, #32635

comment:14

LGTM.

Reviewer: Travis Scrimshaw

comment:15

Thank you!

Changed commit from a1362ee to 29e784b

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

29e784bMerge tag '9.5.beta5' into t/32742/use_sage_rings_abc_realfield__sage_rings_abc_complexfield_more
comment:17

trivial merge