Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Interact slider with values vmin=0 vmax=2, stepsize=1 seems to have problems
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nils Bruin  
View profile  
 More options Jul 27 2012, 4:39 pm
From: Nils Bruin <nbr...@sfu.ca>
Date: Fri, 27 Jul 2012 13:39:18 -0700 (PDT)
Local: Fri, Jul 27 2012 4:39 pm
Subject: Interact slider with values vmin=0 vmax=2, stepsize=1 seems to have problems
I ran into this when trying to use the amazing debug() in the sage
notebook on a particularly shallow traceback. However, the problem
seems to be for interact sliders in general. This is on sage 5.0
notebook using Firefox 13.0 (the present standard with Fedora 16). It
may be browser dependent, but I don't know.

With the following fragment:

N=2
@interact
def F(frame = slider(vmin=0, vmax=N, step_size=1, default=1,
label='stack frame')):
      pass

I'm unable to select "frame=1". Only "frame=0" and "frame=2" work. If
I increase N, things work as expected as far as I've tested.

If this a problem in firefox's javascript? Does it occur on other
browsers? Does someone know a workaround?

Cheers,

Nils


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nils Bruin  
View profile  
 More options Jul 27 2012, 5:01 pm
From: Nils Bruin <nbr...@sfu.ca>
Date: Fri, 27 Jul 2012 14:01:02 -0700 (PDT)
Local: Fri, Jul 27 2012 5:01 pm
Subject: Re: Interact slider with values vmin=0 vmax=2, stepsize=1 seems to have problems
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Grout  
View profile  
 More options Jul 27 2012, 11:45 pm
From: Jason Grout <jason-s...@creativetrax.com>
Date: Fri, 27 Jul 2012 20:45:05 -0700
Local: Fri, Jul 27 2012 11:45 pm
Subject: Re: Interact slider with values vmin=0 vmax=2, stepsize=1 seems to have problems
On 7/27/12 2:01 PM, Nils Bruin wrote:

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/intera...

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nils Bruin  
View profile  
 More options Jul 28 2012, 4:53 pm
From: Nils Bruin <nbr...@sfu.ca>
Date: Sat, 28 Jul 2012 13:53:31 -0700 (PDT)
Local: Sat, Jul 28 2012 4:53 pm
Subject: Re: Interact slider with values vmin=0 vmax=2, stepsize=1 seems to have problems
On Jul 27, 8:45 pm, Jason Grout <jason-s...@creativetrax.com> wrote:

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

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

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

Thanks! The amazing thing is that you describe the full process! I
didn't use github before. Sage's trac submission process is a long
string of tedium interspersed with boredom and administrative red tape
by comparison (especially for a 1 character patch).

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Keshav Kini  
View profile  
 More options Jul 28 2012, 7:49 pm
From: Keshav Kini <keshav.k...@gmail.com>
Date: Sun, 29 Jul 2012 07:49:38 +0800
Local: Sat, Jul 28 2012 7:49 pm
Subject: Re: Interact slider with values vmin=0 vmax=2, stepsize=1 seems to have problems

Nils Bruin <nbr...@sfu.ca> writes:
> On Jul 27, 8:45 pm, Jason Grout <jason-s...@creativetrax.com> wrote:
>> To format a "patch", log into github, go to the file:https://github.com/sagemath/sagenb/blob/master/sagenb/notebook/intera...

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

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

> Thanks! The amazing thing is that you describe the full process! I
> didn't use github before. Sage's trac submission process is a long
> string of tedium interspersed with boredom and administrative red tape
> by comparison (especially for a 1 character patch).

Yup, that's a really nice thing about github's online editor. It's great
for typo fixes and other trivial edits.

Of course, if your patch was a bit more complicated, or touched multiple
files, you'd have needed to do a bit more footwork - forking the
repository on github, cloning your fork to your local computer,
committing your changes, pushing them to a branch on your github fork,
and then creating a pull request from your fork's new branch to the
sagemath user's fork's master branch.

So, not that much easier than Sage's trac submission process on first
glance, though IMO once you get used to it it's really nice to not have
to deal with patch files bitrotting and such.

-Keshav

----
Join us in #sagemath on irc.freenode.net !


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »