Skip to content

Commit 1910086

Browse files
author
Release Manager
committed
gh-40655: remove some deprecated methods in matrix/ as deprecated in #30552 and #32984 ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: #40655 Reported by: Frédéric Chapoton Reviewer(s):
2 parents c3c5271 + 822ec4c commit 1910086

File tree

2 files changed

+3
-72
lines changed

2 files changed

+3
-72
lines changed

src/sage/matrix/matrix0.pyx

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6306,39 +6306,3 @@ def unpickle(cls, parent, immutability, cache, data, version):
63066306
else:
63076307
A._unpickle_generic(data, version)
63086308
return A
6309-
6310-
6311-
def set_max_rows(n):
6312-
"""
6313-
Set the global variable ``max_rows`` (which is used in deciding how to
6314-
output a matrix).
6315-
6316-
EXAMPLES::
6317-
6318-
sage: from sage.matrix.matrix0 import set_max_rows
6319-
sage: set_max_rows(20)
6320-
doctest:...: DeprecationWarning: 'set_max_rows' is replaced by 'matrix.options.max_rows'
6321-
See https://github.com/sagemath/sage/issues/30552 for details.
6322-
"""
6323-
from sage.misc.superseded import deprecation
6324-
deprecation(30552, "'set_max_rows' is replaced by 'matrix.options.max_rows'")
6325-
from sage.matrix.constructor import options
6326-
options.max_rows = n-1
6327-
6328-
6329-
def set_max_cols(n):
6330-
"""
6331-
Set the global variable ``max_cols`` (which is used in deciding how to
6332-
output a matrix).
6333-
6334-
EXAMPLES::
6335-
6336-
sage: from sage.matrix.matrix0 import set_max_cols
6337-
sage: set_max_cols(50)
6338-
doctest:...: DeprecationWarning: 'set_max_cols' is replaced by 'matrix.options.max_cols'
6339-
See https://github.com/sagemath/sage/issues/30552 for details.
6340-
"""
6341-
from sage.misc.superseded import deprecation
6342-
deprecation(30552, "'set_max_cols' is replaced by 'matrix.options.max_cols'")
6343-
from sage.matrix.constructor import options
6344-
options.max_cols = n-1

src/sage/matrix/matrix1.pyx

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,9 @@ cdef class Matrix(Matrix0):
132132
"""
133133
cdef Py_ssize_t i, j
134134
v = []
135-
for i from 0 <= i < self._nrows:
136-
tmp = []
137-
for j from 0 <= j < self._ncols:
138-
tmp.append(self.get_unsafe(i, j)._gap_init_())
135+
for i in range(self._nrows):
136+
tmp = [self.get_unsafe(i, j)._gap_init_()
137+
for j in range(self._ncols)]
139138
v.append('[%s]' % (','.join(tmp)))
140139
# It is needed to multiply with 'One(...)', because
141140
# otherwise the result would not be a gap matrix
@@ -930,22 +929,6 @@ cdef class Matrix(Matrix0):
930929
self.cache('row_ambient_module', x)
931930
return x
932931

933-
def _row_ambient_module(self, base_ring=None):
934-
r"""
935-
TESTS::
936-
937-
sage: M = matrix(Zmod(5), 2, 3)
938-
sage: M._row_ambient_module()
939-
doctest:warning
940-
...
941-
DeprecationWarning: the method _row_ambient_module is deprecated use row_ambient_module (without underscore) instead
942-
See https://github.com/sagemath/sage/issues/32984 for details.
943-
Vector space of dimension 3 over Ring of integers modulo 5
944-
"""
945-
from sage.misc.superseded import deprecation
946-
deprecation(32984, 'the method _row_ambient_module is deprecated use row_ambient_module (without underscore) instead')
947-
return self.row_ambient_module(base_ring)
948-
949932
cpdef column_ambient_module(self, base_ring=None, sparse=None):
950933
r"""
951934
Return the free module that contains the columns of the matrix.
@@ -987,22 +970,6 @@ cdef class Matrix(Matrix0):
987970
self.cache('column_ambient_module', x)
988971
return x
989972

990-
def _column_ambient_module(self):
991-
r"""
992-
TESTS::
993-
994-
sage: M = matrix(Zmod(5), 2, 3)
995-
sage: M._column_ambient_module()
996-
doctest:warning
997-
...
998-
DeprecationWarning: the method _column_ambient_module is deprecated use column_ambient_module (without underscore) instead
999-
See https://github.com/sagemath/sage/issues/32984 for details.
1000-
Vector space of dimension 2 over Ring of integers modulo 5
1001-
"""
1002-
from sage.misc.superseded import deprecation
1003-
deprecation(32984, 'the method _column_ambient_module is deprecated use column_ambient_module (without underscore) instead')
1004-
return self.column_ambient_module()
1005-
1006973
def columns(self, copy=True):
1007974
r"""
1008975
Return a list of the columns of ``self``.

0 commit comments

Comments
 (0)