Opened 7 months ago

Closed 7 months ago

#26835 closed defect (fixed)

Failing introspection with wildcards on matrices / remove M.I

Reported by: nthiery Owned by:
Priority: major Milestone: sage-8.5
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

Example:

    sage: M = random_matrix(QQ, 3,4)
    sage: M.*row*?
    ArithmeticError
    ...
    sage.matrix.matrix_rational_dense.Matrix_rational_dense.inverse (build/cythonized/sage/matrix/matrix_rational_dense.c:8519)()
    717         """
    718         if self._nrows != self._ncols:
--> 719             raise ArithmeticError("self must be a square matrix")
    720 
    721         if self._nrows == 0:

    ArithmeticError: self must be a square matrix

Analysis: M has an attribute I which is supposed to evaluate to the inverse of M. When ipython does its introspection to recover the list of attributes of M with M.*row*?, that attribute is evaluated. Which triggers an error since M is not square.

Proposed solution: remove M.I that was deprecated two years ago in #20904 .

Change History (3)

comment:1 Changed 7 months ago by nthiery

M.I was actually removed in #26647. Testing now whether introspection works. If yes, I'll close the ticket as resolved.

comment:2 Changed 7 months ago by nthiery

sage: M = random_matrix(QQ, 3,4)
sage: M.*row*?
M.add_multiple_of_row
M.automorphisms_of_rows_and_columns
M.delete_rows
M.dense_rows
M.linear_combination_of_rows
M.matrix_from_rows

So this works now. Cool!

comment:3 Changed 7 months ago by nthiery

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.