Opened 6 years ago

Closed 6 years ago

#18360 closed enhancement (fixed)

doctest fix for: symbolic matrices fail operations minus and mul

Reported by: rws Owned by:
Priority: minor Milestone: sage-6.9
Component: symbolics Keywords:
Cc: nbruin Merged in:
Authors: Ralf Stephan Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: 919b954 (Commits, GitHub, GitLab) Commit: 919b9542ae39de3a2bc049899f5146b9e6912d7e
Dependencies: #17321 Stopgaps:

Status badges

Description (last modified by rws)

In examples like this:

sage: f(x)=matrix()
sage: bool(f(x)-f(x)==0)
...
TypeError: mutable matrices are unhashable
sage: f(x)*1
...
TypeError: mutable matrices are unhashable

a Pynac bug manifests, see https://github.com/pynac/pynac/issues/34

This ticket should provide doctests, it depends on pynac-0.4.2/0.3.9.2.

Change History (12)

comment:1 Changed 6 years ago by rws

  • Cc nbruin added
  • Description modified (diff)
  • Milestone changed from sage-6.7 to sage-6.8

comment:2 Changed 6 years ago by rws

This is quite funny. By chance I hit on the real bug with this issue (note that f(x)+1 and f(x)^1 will work) in Pynac. No fiddling with mutable/immutable necessary it seems. Investigating.

comment:3 Changed 6 years ago by rws

  • Dependencies set to pynac-0.3.9.2
  • Description modified (diff)
  • Report Upstream changed from N/A to Fixed upstream, in a later stable release.
  • Summary changed from handle mutable objects better in symbolic evaluation to SR(Matrix) fails operations minus and mul

comment:4 Changed 6 years ago by rws

  • Priority changed from major to critical

Critical because it prevents crashing (#14211).

Last edited 6 years ago by rws (previous) (diff)

comment:5 Changed 6 years ago by rws

  • Branch set to u/rws/sr_matrix__fails_operations_minus_and_mul

comment:6 Changed 6 years ago by rws

  • Authors set to Ralf Stephan
  • Commit set to 7521a06466847db835c8b3ee0c7b84bac976fd18
  • Dependencies changed from pynac-0.3.9.2 to #17321
  • Report Upstream changed from Fixed upstream, in a later stable release. to N/A
  • Status changed from new to needs_review

Depends on #17321 because of merge conflict.


New commits:

522bf9617321: doctest fixed Pynac RuntimeErrors
7521a0618360: doctest fix for: SR(Matrix) fails operations minus and mul

comment:7 Changed 6 years ago by rws

  • Priority changed from critical to minor

The fix is already in, so no longer critical.

comment:8 Changed 6 years ago by git

  • Commit changed from 7521a06466847db835c8b3ee0c7b84bac976fd18 to 1de278b54fa100d419a54b19c27ec56fe6169406

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

420af5417321: replace bool with assert in doctests
1de278bMerge branch 'u/rws/doctest_fixed_pynac_runtimeerrors' of trac.sagemath.org:sage into t/18360/sr_matrix__fails_operations_minus_and_mul

comment:9 Changed 6 years ago by git

  • Commit changed from 1de278b54fa100d419a54b19c27ec56fe6169406 to 919b9542ae39de3a2bc049899f5146b9e6912d7e

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

919b954Merge branch 'develop' into t/18360/sr_matrix__fails_operations_minus_and_mul

comment:10 Changed 6 years ago by rws

  • Summary changed from SR(Matrix) fails operations minus and mul to doctest fix for: symbolic matrices fail operations minus and mul

comment:11 Changed 6 years ago by chapoton

  • Milestone changed from sage-6.8 to sage-6.9
  • Reviewers set to Frédéric Chapoton
  • Status changed from needs_review to positive_review

ok, this works in 6.9.b1

comment:12 Changed 6 years ago by vbraun

  • Branch changed from u/rws/sr_matrix__fails_operations_minus_and_mul to 919b9542ae39de3a2bc049899f5146b9e6912d7e
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.