Ticket #4254 (closed defect: fixed)

Opened 2 months ago

Last modified 2 days ago

[with patch, positive review] mq.SR improvements for convenience

Reported by: malb Assigned to: malb
Priority: major Milestone: sage-3.2.1
Component: misc Keywords:
Cc:

Description

correct_only is only valid for GF(2). Make sure it is passed on correctly.

Attachments

sr_convenience.patch (2.8 kB) - added by malb on 11/23/2008 02:25:31 PM.
apply before other patch
sr_parameters.2.patch (1.5 kB) - added by malb on 11/23/2008 02:25:56 PM.
added doctests

Change History

11/23/2008 07:40:05 AM changed by cwitty

This patch should probably have some doctests.

11/23/2008 02:25:31 PM changed by malb

  • attachment sr_convenience.patch added.

apply before other patch

11/23/2008 02:25:56 PM changed by malb

  • attachment sr_parameters.2.patch added.

added doctests

11/23/2008 02:26:58 PM changed by malb

  • summary changed from [with patch, needs review] better parameter parsing for mq.SR to [with patch, needs review] mq.SR improvements for convenience.

I added doctests and the patch this patch depends on which I forgot to submit last time.

11/28/2008 02:11:43 PM changed by was

  • summary changed from [with patch, needs review] mq.SR improvements for convenience to [with patch, needs work] mq.SR improvements for convenience.

REFEREE REPORT: I tried to figure out how to apply the above patches in their confusing order, but I guess I failed or something. See below (last patch fails to apply). Please clarify, and I'll referee this:

was@sage:~/build/sage-3.2.1.alpha1$ ./sage
----------------------------------------------------------------------
| Sage Version 3.2.1.alpha1, Release Date: 2008-11-26                |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
hgsage: hg_sage.apply('http://trac.sagemath.org/sage_trac/attachment/ticket/4254/sr_convenience.patch')
Attempting to load remote file: http://trac.sagemath.org/sage_trac/attachment/ticket/4254/sr_convenience.patch?format=raw
Loading: [.]
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg status
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg status
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg import   "/home/was/.sage/temp/sage/15295/tmp_0.patch"
applying /home/was/.sage/temp/sage/15295/tmp_0.patch
sage: hg_sage.apply('http://trac.sagemath.org/sage_trac/attachment/ticket/4254/sr_parameters.patch')
Attempting to load remote file: http://trac.sagemath.org/sage_trac/attachment/ticket/4254/sr_parameters.patch?format=raw
Loading: [.]
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg status
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg status
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg import   "/home/was/.sage/temp/sage/15295/tmp_1.patch"
applying /home/was/.sage/temp/sage/15295/tmp_1.patch
sage: hg_sage.apply('http://trac.sagemath.org/sage_trac/attachment/ticket/4254/sr_parameters.2.patch')
Attempting to load remote file: http://trac.sagemath.org/sage_trac/attachment/ticket/4254/sr_parameters.2.patch?format=raw
Loading: [.]
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg status
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg status
cd "/home/was/build/sage-3.2.1.alpha1/devel/sage" && hg import   "/home/was/.sage/temp/sage/15295/tmp_2.patch"
applying /home/was/.sage/temp/sage/15295/tmp_2.patch
patching file sage/crypto/mq/sr.py
Hunk #2 FAILED at 288
1 out of 2 hunks FAILED -- saving rejects to file sage/crypto/mq/sr.py.rej
abort: patch failed to apply

and

was@sage:~/build/sage-3.2.1.alpha1$ more devel/sage/sage/crypto/mq/sr.py.rej
--- sr.py
+++ sr.py
@@ -284,8 +289,20 @@
             polybori = self._polybori
         except AttributeError:
             polybori = False
+        kwds.setdefault("polybori", polybori)
 
-        kwds.setdefault("polybori", polybori)
+        try:
+            correct_only = self._correct_only
+        except AttributeError:
+            correct_only = False
+        kwds.setdefault("correct_only", correct_only)
+
+        try:
+            biaffine_only = self._biaffine_only
+        except AttributeError:
+            biaffine_only = False
+        kwds.setdefault("biaffine_only", biaffine_only)
+
         return SR(**kwds)
 
     def __getattr__(self, attr):

11/30/2008 12:27:39 PM changed by malb

Here is how to apply the patches:

$ hg qimport sr_convenience.patch
adding sr_convenience.patch to series file
$ hg qpush
applying sr_convenience.patch
Now at: sr_convenience.patch
$ hg qimport sr_parameters.patch
adding sr_parameters.patch to series file
$ hg qpush
applying sr_parameters.patch
Now at: sr_parameters.patch
$ sage -b

Note that sr_parameters.2.patch is sr_parameters.patch

11/30/2008 03:30:35 PM changed by was

  • summary changed from [with patch, needs work] mq.SR improvements for convenience to [with patch, needs review] mq.SR improvements for convenience.

If this passes doctests, then I give it a positive review.

11/30/2008 03:49:41 PM changed by mabshoff

  • summary changed from [with patch, needs review] mq.SR improvements for convenience to [with patch, positive review] mq.SR improvements for convenience.

Doctests pass, so this is a positive review by William.

Cheers,

Michael

11/30/2008 03:49:56 PM changed by mabshoff

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone changed from sage-3.2.2 to sage-3.2.1.

Merged in Sage 3.2.1.rc1