Interact options by jdemeyer · Pull Request #771 · jupyter-widgets/ipywidgets (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

jdemeyer

Implement #430:

@interact.option(manual=True)
def function(...):
      pass

@jdemeyer

No idea why Travis CI is failing here. It seems to be complaining about Javascript-related issues while I didn't make any changes to that.

@SylvainCorlay

@SylvainCorlay

Leaving this open to give @Carreau the opportunity to comment.

@jdemeyer

Let me just remind that only the last 2 commits need to be reviewed (the first commits are from #762).

@SylvainCorlay

@jdemeyer if you rebase, we should only see those commits.

@jdemeyer

if you rebase, we should only see those commits.

<rant>
I consider that a GitHub bug/misfeature since those first commits are literally (with the same hash) in master now, so it shouldn't show them in the diff.

This is IMHO yet another thing that Trac gets right but GitHub does not.
</rant>

Anyway, should I rebase or merge in master or just leave it?

@SylvainCorlay

I completely agree. I am out for lunch and my desktop computer screen shows two ongoing 3-pane merges. I am constantly in the middle of a rebase... Meld is my ide :)

But I prefer rebase over merge and here the rebase would not require any manual action...

@jdemeyer

@jdemeyer

@Carreau

I'm happy with that, I'll trust Sylvain on it, haven't touched widgets in a while.

@jdemeyer

@jdemeyer

This was referenced

Sep 20, 2016

@minrk

@jasongrout

Noting for future people: one huge issue with this implementation is that it can't be used as a decorator anymore:

from ipywidgets import interact @interact.options(manual=True)(x=(0,10)) def f(x): print(x)

gives a syntax error. That's because decorators are syntactically limited to a single function call. A way around it is to store the partial interact as another variable:

from ipywidgets import interact myinteract = interact.options(manual=True) @myinteract(x=(0,10)) def f(x): print(x)

(for convenience, an ipywidgets.interact_manual is defined with this option.)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators

Feb 21, 2021

Labels

resolved-locked

Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.