Skip to content

Commit 1210bbf

Browse files
author
Release Manager
committed
sagemathgh-36594: Replace relative imports by absolute ones in `sage.{matrix,matroids,modules,stats}` <!-- ^^^^^ 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". --> - Cherry-picked from sagemath#35095 - This is for sagemath#36228 <!-- 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. - [ ] 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#36594 Reported by: Matthias Köppe Reviewer(s): David Coudert, Matthias Köppe
2 parents 4ae2731 + 4370ea2 commit 1210bbf

File tree

83 files changed

+220
-201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+220
-201
lines changed

src/sage/matrix/action.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ AUTHOR:
6262

6363
import operator
6464

65-
from .matrix_space import MatrixSpace, is_MatrixSpace
65+
from sage.matrix.matrix_space import MatrixSpace, is_MatrixSpace
6666
from sage.modules.free_module import FreeModule, is_FreeModule
6767
from sage.structure.coerce cimport coercion_model
6868
from sage.categories.homset import Hom, End

src/sage/matrix/args.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ cdef class MatrixArgs:
983983
if self.space is None:
984984
global MatrixSpace
985985
if MatrixSpace is None:
986-
from .matrix_space import MatrixSpace
986+
from sage.matrix.matrix_space import MatrixSpace
987987
self.space = MatrixSpace(self.base, self.nrows, self.ncols,
988988
sparse=self.sparse, **self.kwds)
989989

@@ -1114,7 +1114,7 @@ cdef class MatrixArgs:
11141114
if not (e.flags.c_contiguous is True or e.flags.f_contiguous is True):
11151115
raise TypeError('numpy matrix must be either c_contiguous or f_contiguous')
11161116

1117-
from .constructor import matrix
1117+
from sage.matrix.constructor import matrix
11181118
from sage.rings.real_double import RDF
11191119
from sage.rings.complex_double import CDF
11201120

src/sage/matrix/change_ring.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
Functions for changing the base ring of matrices quickly
33
"""
44

5-
from .matrix_space import MatrixSpace
6-
from .matrix_real_double_dense cimport Matrix_real_double_dense
7-
from .matrix_integer_dense cimport Matrix_integer_dense
5+
from sage.matrix.matrix_space import MatrixSpace
6+
from sage.matrix.matrix_real_double_dense cimport Matrix_real_double_dense
7+
from sage.matrix.matrix_integer_dense cimport Matrix_integer_dense
88

99
from sage.rings.real_double import RDF
1010

src/sage/matrix/constructor.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ General matrix Constructor and display options
1414
# http://www.gnu.org/licenses/
1515
#*****************************************************************************
1616

17-
from .args cimport MatrixArgs
17+
from sage.matrix.args cimport MatrixArgs
1818
from sage.structure.global_options import GlobalOptions
1919

2020

@@ -654,7 +654,7 @@ def matrix(*args, **kwds):
654654
Matrix = matrix
655655

656656

657-
from .special import *
657+
from sage.matrix.special import *
658658

659659

660660
@matrix_method

src/sage/matrix/matrix.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from .matrix2 cimport Matrix
1+
from sage.matrix.matrix2 cimport Matrix

src/sage/matrix/matrix0.pyx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ from sage.rings.integer_ring import is_IntegerRing
4747

4848
import sage.modules.free_module
4949

50-
from .matrix_misc import row_iterator
50+
from sage.matrix.matrix_misc import row_iterator
5151

5252
_Fields = Fields()
5353
_IntegralDomains = IntegralDomains()
@@ -1750,7 +1750,7 @@ cdef class Matrix(sage.structure.element.Matrix):
17501750
100 x 100 dense matrix over Integer Ring]
17511751
17521752
"""
1753-
from .constructor import options
1753+
from sage.matrix.constructor import options
17541754
if self._nrows <= options.max_rows() and self._ncols <= options.max_cols():
17551755
return self.str()
17561756
if self.is_sparse():
@@ -2051,7 +2051,7 @@ cdef class Matrix(sage.structure.element.Matrix):
20512051

20522052
# only use floating point formatting for inexact types that have
20532053
# custom implementation of __format__
2054-
from .constructor import options
2054+
from sage.matrix.constructor import options
20552055
prec = options.precision()
20562056
if prec is None or callable(rep_mapping) or not entries \
20572057
or type(entries[0]).__format__ is Element.__format__ \
@@ -2135,7 +2135,7 @@ cdef class Matrix(sage.structure.element.Matrix):
21352135
-0.35104242112828943 0.5084492941557279]
21362136
-0.9541798283979341 -0.8948790563276592]
21372137
"""
2138-
from .constructor import options
2138+
from sage.matrix.constructor import options
21392139
if self._nrows <= options.max_rows() and self._ncols <= options.max_cols():
21402140
return self.str(character_art=True)
21412141
else:
@@ -2164,7 +2164,7 @@ cdef class Matrix(sage.structure.element.Matrix):
21642164
sage: unicode_art(A)
21652165
100 x 100 dense matrix over Integer Ring
21662166
"""
2167-
from .constructor import options
2167+
from sage.matrix.constructor import options
21682168
if self._nrows <= options.max_rows() and self._ncols <= options.max_cols():
21692169
return self.str(unicode=True, character_art=True)
21702170
else:
@@ -2375,7 +2375,7 @@ cdef class Matrix(sage.structure.element.Matrix):
23752375
[ 5 25]
23762376
[125 625]
23772377
"""
2378-
from .constructor import matrix
2378+
from sage.matrix.constructor import matrix
23792379
return matrix(self.nrows(), self.ncols(), [e(*args, **kwargs) for e in self.list()])
23802380

23812381
###################################################
@@ -3850,7 +3850,7 @@ cdef class Matrix(sage.structure.element.Matrix):
38503850
raise ValueError("length of v must be at most the number of rows of self")
38513851
if not self._nrows:
38523852
return self.parent().row_space().zero_vector()
3853-
from .constructor import matrix
3853+
from sage.matrix.constructor import matrix
38543854
v = matrix(list(v)+[0]*(self._nrows-len(v)))
38553855
return (v * self)[0]
38563856

@@ -3927,7 +3927,7 @@ cdef class Matrix(sage.structure.element.Matrix):
39273927
raise ValueError("length of v must be at most the number of columns of self")
39283928
if not self._ncols:
39293929
return self.parent().column_space().zero_vector()
3930-
from .constructor import matrix
3930+
from sage.matrix.constructor import matrix
39313931
v = matrix(self._ncols, 1, list(v)+[0]*(self._ncols-len(v)))
39323932
return (self * v).column(0)
39333933

@@ -6178,7 +6178,7 @@ def set_max_rows(n):
61786178
"""
61796179
from sage.misc.superseded import deprecation
61806180
deprecation(30552, "'set_max_rows' is replaced by 'matrix.options.max_rows'")
6181-
from .constructor import options
6181+
from sage.matrix.constructor import options
61826182
options.max_rows = n-1
61836183

61846184
def set_max_cols(n):
@@ -6195,5 +6195,5 @@ def set_max_cols(n):
61956195
"""
61966196
from sage.misc.superseded import deprecation
61976197
deprecation(30552, "'set_max_cols' is replaced by 'matrix.options.max_cols'")
6198-
from .constructor import options
6198+
from sage.matrix.constructor import options
61996199
options.max_cols = n-1

src/sage/matrix/matrix1.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .matrix0 cimport Matrix as Matrix0
1+
from sage.matrix.matrix0 cimport Matrix as Matrix0
22

33
cdef class Matrix(Matrix0):
44
cdef _stack_impl(self, bottom) noexcept

src/sage/matrix/matrix2.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Generic matrices
1212
# http://www.gnu.org/licenses/
1313
#*****************************************************************************
1414

15-
from .matrix1 cimport Matrix as Matrix1
15+
from sage.matrix.matrix1 cimport Matrix as Matrix1
1616

1717
cdef class Matrix(Matrix1):
1818
cdef _det_by_minors(self, Py_ssize_t level) noexcept

src/sage/matrix/matrix2.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ from sage.arith.numerical_approx cimport digits_to_bits
9999
from copy import copy
100100

101101
import sage.modules.free_module
102-
from . import berlekamp_massey
102+
from sage.matrix import berlekamp_massey
103103
from sage.modules.free_module_element import is_FreeModuleElement
104104
from sage.matrix.matrix_misc import permanental_minor_polynomial
105105

@@ -8832,7 +8832,7 @@ cdef class Matrix(Matrix1):
88328832
output_window = output.matrix_window()
88338833

88348834

8835-
from . import strassen
8835+
from sage.matrix import strassen
88368836
strassen.strassen_window_multiply(output_window, self_window, right_window, cutoff)
88378837
return output
88388838

@@ -8870,7 +8870,7 @@ cdef class Matrix(Matrix1):
88708870
self._echelon_in_place_classical()
88718871
return
88728872

8873-
from . import strassen
8873+
from sage.matrix import strassen
88748874
pivots = strassen.strassen_echelon(self.matrix_window(), cutoff)
88758875
self.cache('pivots', pivots)
88768876
verbose('done with strassen', tm)
@@ -8909,7 +8909,7 @@ cdef class Matrix(Matrix1):
89098909
...
89108910
IndexError: matrix window index out of range
89118911
"""
8912-
from . import matrix_window
8912+
from sage.matrix import matrix_window
89138913
if nrows == -1:
89148914
nrows = self._nrows - row
89158915
if ncols == -1:
@@ -15117,7 +15117,7 @@ cdef class Matrix(Matrix1):
1511715117
except (OverflowError, TypeError):
1511815118
from sage.rings.real_mpfr import RealField
1511915119
# Try using MPFR, which handles large numbers much better, but is slower.
15120-
from .misc_mpfr import hadamard_row_bound_mpfr
15120+
from sage.matrix.misc_mpfr import hadamard_row_bound_mpfr
1512115121
R = RealField(53, rnd='RNDU')
1512215122
A = self.change_ring(R)
1512315123
m1 = hadamard_row_bound_mpfr(A)

src/sage/matrix/matrix_complex_ball_dense.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from sage.libs.arb.types cimport acb_mat_t
2-
from .matrix_dense cimport Matrix_dense
2+
from sage.matrix.matrix_dense cimport Matrix_dense
33
from sage.matrix.matrix_generic_dense cimport Matrix_generic_dense
44
from sage.structure.parent cimport Parent
55

0 commit comments

Comments
 (0)