sagemath/sage

Allow some imports of RLF to fail

Closed this issue · 31 comments

The RealLazyField implementation is tied closely to real_mpfr.

We modify some imports for the purpose of modularization, in particular sagemath-polyhedra (#32432)

In particular for ... is RLF tests:

$ git grep 'is RLF'
src/sage/rings/complex_double.pyx:        if S is ZZ or S is QQ or S is RDF or S is RLF:
src/sage/rings/number_field/number_field_base.pyx:        if codomain is AA or codomain is RLF:
src/sage/rings/real_double.pyx:        if S is ZZ or S is QQ or S is RLF:
src/sage/schemes/plane_conics/con_number_field.py:                if not (isinstance(p, Map) and p.category_for().is_subcategory(Rings())) or p.codomain() is AA or p.codomain() is RLF:

Depends on #32742
Depends on #32750
Depends on #32733

CC: @kliem @tscrim @sagetrac-tmonteil

Component: refactoring

Author: Matthias Koeppe

Branch/Commit: b49bbdf

Reviewer: Travis Scrimshaw

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

Dependencies: #32742

Author: Matthias Koeppe

Last 10 new commits:

b3c1667Merge #32758
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
c53d15dMerge #32742
26df548src/sage/rings/number_field/number_field_base.pyx: Handle failing import of AA, RLF
054a8a6src/sage/rings/real_double.pyx: Handle failing import of RLF, RR
5ff97b1src/sage/schemes/plane_conics/con_number_field.py: Move imports of RLF, AA into methods

Commit: 5ff97b1

comment:5

This failure is not from this ticket:

sage -t --long --random-seed=321172385432269463934777057410284981568 src/sage/rings/integer.pyx  # 1 doctest failed

This failure is likely from random seed fuzzing, not this ticket:

sage -t --long --random-seed=321172385432269463934777057410284981568 src/sage/rings/polynomial/multi_polynomial_ring_base.pyx  # 1 doctest failed

reported in #32544.

Changed commit from 5ff97b1 to bda5ef8

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

bda5ef8Merge tag '9.5.beta5' into t/32777/allow_some_imports_of_rlf_to_fail

Changed commit from bda5ef8 to 59b67d3

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

35cdcffsrc/sage/groups/misc_gps/argument_groups.py: Remove unused imports
59b67d3src/sage/schemes/projective/projective_morphism.py: Remove unused imports
comment:9

One green bot; one bot that's not feeling well

comment:10

Replying to @mkoeppe:

One green bot; one bot that's not feeling well

I stopped all my patchbots.

Reviewer: Travis Scrimshaw

comment:12

Thank you!

comment:13

Merge conflict

Changed dependencies from #32742 to #32742, #32750

Changed commit from 59b67d3 to c219c17

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

96a778bsrc/sage/schemes/elliptic_curves/constructor.py: Use sage.rings.abc.pAdicField
b672836src/sage/schemes/hyperelliptic_curves: Use sage.rings.abc.pAdicField
e1412c7src/sage/schemes/projective/projective_morphism.py: Use sage.rings.abc.pAdicField
fc7025asrc/sage/rings/padics/generic_nodes.py: Update doctests with deprecation warning output
070d05bsrc/sage/schemes/projective/projective_morphism.py: Avoid merge conflict
59271be32750: added missing imports
0a1b9acsrc/sage/rings/padics/generic_nodes.py: Remove unused imports
c46eb46Merge #32665
03b24bdsrc/sage/schemes/berkovich/berkovich_space.py: Whitespace fix
c219c17Merge #32750
comment:17

trivial merge

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

8b888e0Merge tag '9.5.beta6' into t/32777/allow_some_imports_of_rlf_to_fail

Changed commit from c219c17 to 8b888e0

comment:19

Trivial merge with 9.5.beta6

comment:20

It was already merged, but then the branch changed and now its a merge conflict

Changed commit from 8b888e0 to c219c17

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

comment:23

Sorry. Back to the previous commit.

comment:25

still merge conflict

Changed commit from c219c17 to b49bbdf

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

5fe8aa6src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx: Avoid imports from .all
6d5ec0agit grep -l 'all import cached' src/sage | xargs sed -E -i.bak $'s/^( *)from sage.*all import (cached_[a-z]*) *$/\1from sage.misc.cachefunc import \2/'
299bd0cgit grep -l 'all import .*Integer' src/sage | xargs sed -E -i.bak $'s/^( *)from sage.*all import Integer *$/\1from sage.rings.integer import Integer/'
54fa2eegit grep -l 'all import .*GF' src/sage | xargs sed -E -i.bak $'s/^( *)from sage.*all import GF *$/\1from sage.rings.finite_rings.finite_field_constructor import GF/'
f9182b4Merge tag '9.5.beta5' into t/32733/remove_more__all_imports
2ce2751src/sage/interacts/library.py: Remove unused imports
23d8441src/sage/interacts/library.py: suppress pyflakes warning
48360b7src/sage/libs/eclib/interface.py: Remove unused import
e2d1765Merge tag '9.5.beta6' into t/32733/remove_more__all_imports
b49bbdfMerge #32733

Changed dependencies from #32742, #32750 to #32742, #32750, #32733