Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate is_RealField, is_ComplexField, is_RealDoubleField, is_ComplexDoubleField #32610

Closed
mkoeppe opened this issue Oct 2, 2021 · 33 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 2, 2021

Follow up from #32566, which introduced the new pattern isinstance(..., sage.rings.abc.RealField)

Depends on #32566
Depends on #32606

Component: refactoring

Author: Matthias Koeppe

Branch/Commit: 8cc3500

Reviewer: Travis Scrimshaw

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

@mkoeppe mkoeppe added this to the sage-9.5 milestone Oct 2, 2021
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 2, 2021

Dependencies: #32566

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 2, 2021

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 2, 2021

comment:3

Setting to "needs_review" to get the patchbot to run


New commits:

6081489git grep -l -E 'is_(Real|Complex)(Double)?Field' | xargs sed -E -i.bak 's/^from sage[.]rings.*import is_((Real|Complex)(Double)?Field) *$/import sage.rings.abc/;s/is_((Real|Complex)(Double)?Field)[(]([^)]*)[)]/isinstance(\4, sage.rings.abc.\1)/g;'
28e328aRemove repeated imports of sage.rings.abc
45cc21ais_Real[Double]Field, is_Complex[Double]Field: Undo automatic edits, deprecate
e003603sage.dynamics: Fix up replacement of is_{Real,Complex}[Double]Field
4adc553sage.functions: Fix up replacement of is_{Real,Complex}[Double]Field
5b988c6sage.schemes: Fix up replacement of is_{Real,Complex}[Double]Field
402dbecsage.rings.number_field: Fix up replacement of is_{Real,Complex}[Double]Field
e82709csage.rings.polynomial: Fix up replacement of is_{Real,Complex}[Double]Field
1d29569sage.{modular,quadratic_forms}: Fix up replacement of is_{Real,Complex}[Double]Field
a4ad3d4sage.matrix: Fix up replacement of is_{Real,Complex}[Double]Field

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 2, 2021

Commit: a4ad3d4

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 2, 2021

Author: Matthias Koeppe

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 2, 2021

Changed commit from a4ad3d4 to 49e75d1

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 2, 2021

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

cee081asage.rings.real_mpfr.RealField_class: Inherit through a new class sage.rings.abc.RealField
99f4f10sage.rings.real_double.RealDoubleField_class: Inherit through a new class sage.rings.abc.RealDoubleField
29871d0ComplexField_class, ComplexDoubleField: Inherit through new classes sage.rings.abc.*
e1bb944src/sage/rings/polynomial/polynomial_element.pyx: Replace use of is_RealField by isinstance(sage.rings.abc.RealField) etc.
6e2c3c4src/sage/rings/abc.pyx: Add class docstrings
49e75d1Merge #32566

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 2, 2021

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

c7aa947sage.probability: Fix up replacement of is_{Real,Complex}[Double]Field
b8691ccsrc/sage/rings/number_field/number_field_element.pyx: Remove unused import
abbe26dsrc/sage/modules/free_module.py: Remove another use of is_... functions

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 2, 2021

Changed commit from 49e75d1 to abbe26d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 2, 2021

Changed commit from abbe26d to 65e9b98

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 2, 2021

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

65e9b98src/sage/rings/polynomial/polynomial_singular_interface.py: Fixup

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 2, 2021

Changed commit from 65e9b98 to a00d97a

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 2, 2021

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

a00d97asrc/sage/rings/number_field/number_field.py: Fixup

@tscrim
Copy link
Collaborator

tscrim commented Oct 3, 2021

comment:8

Patchbot reports

sage -t --long --random-seed=0 src/sage/probability/random_variable.py  # 9 doctests failed
sage -t --long --random-seed=0 src/sage/monoids/string_monoid.py  # 2 doctests failed
sage -t --long --random-seed=0 src/sage/monoids/string_monoid_element.py  # 8 doctests failed
sage -t --long --random-seed=0 src/sage/monoids/string_ops.py  # 1 doctest failed
sage -t --long --random-seed=0 src/sage/functions/special.py  # 9 doctests failed
sage -t --long --random-seed=0 src/sage/crypto/classical.py  # 18 doctests failed
sage -t --long --random-seed=0 src/sage/schemes/elliptic_curves/cm.py  # 2 doctests failed
sage -t --long --random-seed=0 src/sage/schemes/elliptic_curves/ell_number_field.py  # 2 doctests failed
sage -t --long --random-seed=0 src/sage/rings/complex_mpfr.pyx  # 1 doctest failed
sage -t --long --random-seed=0 src/sage/rings/complex_double.pyx  # 1 doctest failed
sage -t --long --random-seed=0 src/sage/rings/real_mpfr.pyx  # 1 doctest failed
sage -t --long --random-seed=0 src/sage/rings/real_double.pyx  # 1 doctest failed

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 3, 2021

Changed commit from a00d97a to 94fd9c5

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 3, 2021

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

fa79b10Add missing imports of sage.rings.abc
94fd9c5is_{Real,Complex}[Double]Field: In doctests, add deprecation warning to expected output

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 3, 2021

comment:10

Another round of patchbot testing...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 3, 2021

Changed commit from 94fd9c5 to dd7e96c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 3, 2021

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

dd7e96csrc/sage/schemes/elliptic_curves/ell_number_field.py: Add missing import

@tscrim
Copy link
Collaborator

tscrim commented Oct 3, 2021

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Oct 3, 2021

comment:12

Green bot => positive review.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 4, 2021

Changed commit from dd7e96c to 13607cb

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 4, 2021

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

13607cbsrc/sage/dynamics/arithmetic_dynamics/projective_ds.py: Remove unused import

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 4, 2021

comment:14

Thanks! It's green now

@vbraun
Copy link
Member

vbraun commented Oct 13, 2021

comment:15

Merge conflict

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 13, 2021

Changed dependencies from #32566 to #32566, #32606

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 13, 2021

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

9e74b6asage.rings.abc: Add IntegerModRing, Order; use them in sage.matrix, sage.modules
8ef2b35sage.structure, sage.rings, sage.matrix: Use sage.rings.abc for IntegerModRing
335cd3eReplace all uses of is_IntegerModRing by isinstance(..., sage.rings.abc.IntegerModRing)
f596395sage.rings.finite_rings.integer_mod_ring: Fixup
af06e5bis_IntegerModRing: Deprecate
1b0a5absrc/sage/modules/vector_space_morphism.py: Do not fail if sage.symbol is not present
83b5038src/sage/modules/free_module_element.pyx: Move import from sage.misc.derivative into method
acca6c2src/sage/matrix/matrix2.pyx: Move import from sage.misc.derivative into method
907b57cMerge #32593
b1efd57Merge #32606

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 13, 2021

Changed commit from 13607cb to b1efd57

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 13, 2021

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

355dbcbMerge #32606

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 13, 2021

Changed commit from b1efd57 to 355dbcb

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 13, 2021

Changed commit from 355dbcb to 8cc3500

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 13, 2021

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

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

@vbraun
Copy link
Member

vbraun commented Oct 19, 2021

@vbraun vbraun closed this as completed in c4e5b94 Oct 19, 2021
mkoeppe added a commit to mkoeppe/sage that referenced this issue Feb 12, 2023
mkoeppe added a commit to mkoeppe/sage that referenced this issue Feb 12, 2023
mkoeppe added a commit to mkoeppe/sage that referenced this issue Feb 12, 2023
mkoeppe added a commit to mkoeppe/sage that referenced this issue Sep 21, 2023
vbraun pushed a commit to vbraun/sage that referenced this issue Sep 23, 2023
, sagemath#24483, sagemath#24371, sagemath#24511, sagemath#25848, sagemath#26105, sagemath#28481, sagemath#29010, sagemath#29412, sagemath#30332, sagemath#30372, sagemath#31345, sagemath#32375, sagemath#32606, sagemath#32610, sagemath#32612, sagemath#32641, sagemath#32660, sagemath#32750, sagemath#32869, sagemath#33602

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36307
Reported by: Matthias Köppe
Reviewer(s):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants