Opened 12 years ago

Closed 12 years ago

#2884 closed defect (fixed)

[with patch; positive review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?)

Reported by: was Owned by: boothby
Priority: major Milestone: sage-3.0.2
Component: notebook Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by was)

To replicate this bug:

  1. Put show(plot(sin)) in a cell and press shift-enter
  1. Then in the *same* cell *delete* show(plot(sin)) and replace it by this and press shift-enter:
    @interact
    def _(n=(1,100)):
       print n^2
    
  1. Observe that the plot of sin is still there.

Attachments (2)

sage-2884.patch (891 bytes) - added by was 12 years ago.
2884-docfix.patch (1.1 KB) - added by boothby 12 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by was

  • Description modified (diff)

Changed 12 years ago by was

comment:2 Changed 12 years ago by was

  • Summary changed from notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?) to [with patch; needs review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?)

comment:3 Changed 12 years ago by boothby

  • Summary changed from [with patch; needs review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?) to [with patch; negative review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?)

The following is now broken:

plot(sin,0,1).show()
@interact
def foo(a="1"):
    a

comment:4 Changed 12 years ago by was

  • Summary changed from [with patch; negative review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?) to [with patch; needs review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?)

Hi,

Your only reason for giving a negative review was a claim that

plot(sin,0,1).show()
@interact
def foo(a="1"):
    a

is now "broken". However, this never did what you thought it did. The behavior in fact hasn't changed at all from how it was before, except to remove the bug where old graphics from the previous version of the cell remained.

@interact *by design* is only supposed to work when it is the only thing in a cell.

Having multiple interacts in a cell, having additional graphics in a cell, having nested interacts -- none of that should work at present, since none of it has been implemented. They're all things that would possibly be very nice to implement, but they were not part of the design goals for the first version of interact.

Changed 12 years ago by boothby

comment:5 Changed 12 years ago by boothby

  • Summary changed from [with patch; needs review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?) to [with patch; positive review] notebook -- bug; @interact cell eval doesn't clear out the old html output (easy to fix?)

It was not clear to me, even upon rereading the documentation, that @interact had to be alone in a cell. The attached "fixes" the issue. :)

comment:6 Changed 12 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from new to closed

Merged both patches in Sage 3.0.2.alpha1

Note: See TracTickets for help on using tickets.