On 7/27/12 2:01 PM, Nils Bruin wrote:
OK, I figured it out myself. It is indeed a problem in how sliders are
defined. See

devel/sagenb/sagenb/notebook/interact.py line 3078

             if num_steps <= 2:
                 vals = [self.__vmin, self.__vmax]
             else:
                 vals = srange(self.__vmin, self.__vmax,
self.__step_size, include_endpoint=True)

The include_endpoint suggests that this should be " num_steps <= 1 ".
I don't know how to submit patches to sagenb, so can someone please
format an appropriate patch?

In addition, we could save some work by giving "debug" immediately a
list of integers, avoiding dodgy float operations to compute num_steps
(things being integers):

devel/sage/sage/interacts/debugger.py line 226

def dbg(frame = slider(range(len(self._stack)-1-4),
default=len(self._stack)-1-5, label='stack frame'),
         lines = slider(range(3,100,2), default=11, label='lines of
context'),
         command = input_box("", label="", type=str),
         button = selector(['Evaluate'], label='', buttons=True)

so give ranges right away rather than vmin,vmax,step_size

Indeed, that fix seems to work on aleph (I just pushed your fix [1])

To format a "patch", log into github, go to the file: https://github.com/sagemath/sagenb/blob/master/sagenb/notebook/interact.py

Click on "edit in the upper right of the file listing

Make the change in the browser editor, then click "Submit pull request"

Thanks for tracking this down!

Jason



--
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org



Reply via email to