Ticket #3485 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: cwitty Owned by: cwitty
Priority: major Milestone: sage-3.1
Component: misc Keywords: editor_mabshoff
Cc: ncalexan, wstein Author(s):
Report Upstream: Reviewer(s):
Merged in: Work issues:

Description (last modified by cwitty) (diff)

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 Download (55.0 KB) - added by cwitty 2 years ago.
trac3485-sage_input-v2.patch Download (105.6 KB) - added by cwitty 2 years ago.
trac3485-sage_input-review-response.patch Download (1.0 KB) - added by cwitty 2 years ago.

Change History

Changed 2 years ago by cwitty

Changed 2 years ago by cwitty

Changed 2 years ago by cwitty

  • description modified (diff)
  • 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

Changed 2 years ago by mabshoff

  • keywords editor_mabshoff added

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

Cheers,

Michael

Changed 2 years ago 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.

Changed 2 years ago by was

  • milestone changed from sage-3.1.1 to sage-3.1

Changed 2 years ago 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

Changed 2 years ago 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.

Changed 2 years ago by cwitty

Changed 2 years ago 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

Note: See TracTickets for help on using tickets.