sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.31k stars 449 forks source link

UniqueFactory for QuaternionAlgebras #15897

Closed saraedum closed 10 years ago

saraedum commented 10 years ago

Quaternion algebras use a generic dictionary to cache objects (instead of UniqueRepresentation or UniqueFactory). This ticket replaces this generic cache with a UniqueFactory implementation.

Component: algebra

Author: Julian Rueth

Branch/Commit: bdaaaff

Reviewer: David Roe, Peter Bruin

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

saraedum commented 10 years ago

Branch: u/saraedum/ticket/15897

saraedum commented 10 years ago

New commits:

dba5677Use a UniqueFactory to cache instances of QuaternionAlgebra
saraedum commented 10 years ago

Author: Julian Rueth

saraedum commented 10 years ago

Commit: dba5677

roed314 commented 10 years ago
comment:3

Looks good to me.

roed314 commented 10 years ago

Reviewer: David Roe

vbraun commented 10 years ago
comment:5
sage -t src/sage/algebras/quaternion_algebra.py
**********************************************************************
File "src/sage/algebras/quaternion_algebra.py", line 12, in sage.algebras.quaternion_algebra.unpickle_QuaternionAlgebra_v0
Failed example:
    f, t = Q.__reduce__()
Exception raised:
    Traceback (most recent call last):
      File "/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 480, in _run
        self.execute(example, compiled, test.globs)
      File "/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 839, in execute
        exec compiled in globs
      File "<doctest sage.algebras.quaternion_algebra.unpickle_QuaternionAlgebra_v0[1]>", line 1, in <module>
        f, t = Q.__reduce__()
    ValueError: too many values to unpack
**********************************************************************
File "src/sage/algebras/quaternion_algebra.py", line 14, in sage.algebras.quaternion_algebra.unpickle_QuaternionAlgebra_v0
Failed example:
    sage.algebras.quaternion_algebra.unpickle_QuaternionAlgebra_v0(*t)
Exception raised:
    Traceback (most recent call last):
      File "/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 480, in _run
        self.execute(example, compiled, test.globs)
      File "/home/release/Sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 839, in execute
        exec compiled in globs
      File "<doctest sage.algebras.quaternion_algebra.unpickle_QuaternionAlgebra_v0[3]>", line 1, in <module>
        sage.algebras.quaternion_algebra.unpickle_QuaternionAlgebra_v0(*t)
    NameError: name 't' is not defined
**********************************************************************
1 item had failures:
   2 of   5 in sage.algebras.quaternion_algebra.unpickle_QuaternionAlgebra_v0
    [4 tests, 2 failures, 0.01 s]
----------------------------------------------------------------------
sage -t src/sage/algebras/quaternion_algebra.py  # 2 doctests failed
----------------------------------------------------------------------
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Changed commit from dba5677 to bdaaaff

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

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

bdaaaffFixed a pickling doctest for QuaternionAlgebras
pjbruin commented 10 years ago

Changed reviewer from David Roe to David Roe, Peter Bruin

pjbruin commented 10 years ago
comment:9

Looks good and the patchbot is happy. (But quaternion algebras are not commutative!)

vbraun commented 10 years ago

Changed branch from u/saraedum/ticket/15897 to bdaaaff