Ticket #3485 (closed defect: fixed)

Opened 6 months ago

Last modified 4 months ago

[with patch, positive review] new sage_input function gives a sequence of commands to reproduce sage values

Reported by: cwitty Assigned to: cwitty
Priority: major Milestone: sage-3.1
Component: misc Keywords: editor_mabshoff
Cc: ncalexan, wstein

Description (Last modified by cwitty)

This patch creates a new sage_input function, that does things like this:

sage: sage_input((polygen(GF(3))+1)^4)

R.<x> = GF(3)[]
x^4 + x^3 + x + 1

sage_input is implemented for only a few types; but I picked "complicated" types, so I think the underlying framework is ready to go. Once this patch has been accepted, I plan to go through and add support for many more types.

This patch depends on #3484.

Attachments

trac3485-sage_input.patch (55.0 kB) - added by cwitty on 06/20/2008 01:28:28 AM.
trac3485-sage_input-v2.patch (105.6 kB) - added by cwitty on 06/26/2008 07:55:39 PM.
trac3485-sage_input-review-response.patch (1.0 kB) - added by cwitty on 08/13/2008 11:19:32 AM.

Change History

06/20/2008 01:28:28 AM changed by cwitty

  • attachment trac3485-sage_input.patch added.

06/26/2008 07:55:39 PM changed by cwitty

  • attachment trac3485-sage_input-v2.patch added.

06/26/2008 07:58:15 PM changed by cwitty

  • description changed.
  • summary changed from [with patch, request comments, not ready for review] new sage_input function gives a sequence of commands to reproduce sage values to [with patch, needs review] new sage_input function gives a sequence of commands to reproduce sage values.

07/06/2008 03:59:54 AM changed by mabshoff

  • keywords set to editor_mabshoff.

I will ping somebody to review this patch and #3484 soon.

Cheers,

Michael

08/13/2008 02:20:12 AM changed by was

  • summary changed from [with patch, needs review] new sage_input function gives a sequence of commands to reproduce sage values to [with patch, positive review] new sage_input function gives a sequence of commands to reproduce sage values.

REFEREE REPORT:

  • My god, this is some of the most beautiful and well documented systematic code I've ever soon. I have no problems with any of it. Damn. Positive review.

08/13/2008 02:20:17 AM changed by was

  • milestone changed from sage-3.1.1 to sage-3.1.

08/13/2008 10:59:29 AM changed by mabshoff

There is some slight problem applying this:

sage-3.1.alpha2/devel/sage$ patch -p1 --dry-run < trac_3485-sage_input-v2.patch 
patching file sage/misc/all.py
Hunk #1 succeeded at 65 (offset 2 lines).
patching file sage/misc/sage_input.py
patching file sage/rings/integer.pyx
Hunk #1 succeeded at 2943 (offset 16 lines).
patching file sage/rings/integer_mod.pyx
patching file sage/rings/integer_ring.pyx
Hunk #1 succeeded at 823 with fuzz 2 (offset 8 lines).
patching file sage/rings/polynomial/polynomial_element.pyx
patching file sage/rings/polynomial/polynomial_ring.py
Hunk #1 succeeded at 392 with fuzz 2 (offset 17 lines).
patching file sage/rings/real_mpfr.pyx
Hunk #1 succeeded at 280 (offset 12 lines).
Hunk #2 succeeded at 966 (offset 16 lines).
patching file sage/rings/ring.pyx
Hunk #1 FAILED at 1505.
1 out of 1 hunk FAILED -- saving rejects to file sage/rings/ring.pyx.rej

It also seems that only trac3485-sage_input-v2.patch should be applied.

Thoughts?

Cheers,

Michael

08/13/2008 11:14:06 AM changed by cwitty

Yes, only apply -v2.patch.

The patch to ring.pyx only adds a new method, so it should be easy to apply by hand. But if you don't want to do that, I can rebase the patch against alpha1 tonight.

08/13/2008 11:19:32 AM changed by cwitty

  • attachment trac3485-sage_input-review-response.patch added.

08/13/2008 11:57:18 AM changed by mabshoff

  • status changed from new to closed.
  • resolution set to fixed.

Merged trac3485-sage_input-v2.patch and trac3485-sage_input-review-response.patch in Sage 3.1.alpha2