FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Automatically open a comm on creation of widgets by jasongrout · Pull Request #6151 · ipython/ipython · GitHub

Automatically open a comm on creation of widgets - #6151

Closed
jasongrout wants to merge 7 commits into
ipython:masterfrom
jasongrout:immediate-widget-comm
Closed

Automatically open a comm on creation of widgets#6151
jasongrout wants to merge 7 commits into
ipython:masterfrom
jasongrout:immediate-widget-comm

Conversation

Copy link
Copy Markdown
Member

This will immediately create a model on the javascript side when a widget is created. This means that, for example, a widget that only interacts with its model can work without "displaying" it.

This will immediately create a model on the javascript side when a widget is created.  This means that, for example, a widget that only interacts with its model can work without "displaying" it.

Copy link
Copy Markdown
Member Author

Pinging @jdfreder for review. We talked about this last week.

Copy link
Copy Markdown
Contributor

I just looked over the code, it's a small change and it looks good to me. I'll give it a quick test and we can wait to see what Travis thinks.

Copy link
Copy Markdown
Contributor

Pinging @ellisonbg so he is aware of this change in behavior.

Copy link
Copy Markdown
Member Author

Looks like a lot of the tests are failing because creating a widget now tries to open a comm, but TerminalInteractiveShell doesn't have comms. These seem more like failures in the tests than the code. The JS failures look like they might be linked to timeouts? I'm not sure. Can you look at these tests, @jdfreder (in your plentiful spare time :)

Copy link
Copy Markdown
Member

Awesome, I think this makes sense, just have to figure out the tests.

On Thu, Jul 17, 2014 at 12:58 PM, Jason Grout notifications@github.com
wrote:

Looks like a lot of the tests are failing because creating a widget now
tries to open a comm, but TerminalInteractiveShell doesn't have comms.
These seem more like failures in the tests than the code.


Reply to this email directly or view it on GitHub
#6151 (comment).

Brian E. Granger
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com

Copy link
Copy Markdown
Contributor

Honestly, I don't think the problem was with the tests, but the comm itself. I've opened a PR against this branch, let me know what you think.

Don't register comm with comm_manager if comm_manager is undefined

Copy link
Copy Markdown
Member Author

@jdfreder: it looks like your change wasn't enough to satisfy Travis.

Copy link
Copy Markdown
Contributor

This makes me sad, it passed on my local machine... One more PR coming your way, after I figure out what to do.

Copy link
Copy Markdown
Contributor

Could you take a look at jasongrout#3 ?

Check for null session in _publish_msg and _session_default

Copy link
Copy Markdown
Member Author

I merged your change. How do I restart the Travis tests?

Edit: never mind, it appears they already restarted

Copy link
Copy Markdown
Member

Any new commit (including a merge) will trigger a new test run on Travis. If you need to restart a test run on the same commit, one of us with push access to the repo has to do it.

Copy link
Copy Markdown
Member Author

@jdfreder: Travis is happy! Thanks!

Instead of automagically instantiating a comm when it is accessed, require a call to open().  This makes the comm attribute much less magical, and hopefully more understandable.

Copy link
Copy Markdown
Member Author

I think this is ready to go.

Copy link
Copy Markdown
Member

👍 +1

Copy link
Copy Markdown
Contributor

@jasongrout the code here looks good, but I want to mention a couple things:

  • When I implement JS side widget initiation, I'll have to be careful about trying to open a comm when the widget is constructed in the front-end, because that code will complicate the persistant widget stuff, where the widget needs to "reconnect" to itself in the backend if possible.
  • I really think @minrk should take a quick look to the changes I made to the comm in here to make sure they make sense, before we merge this.

Copy link
Copy Markdown
Member Author

Since comm is now a trait of the widget, and the open call only does anything if comm is None, then I imagine that you can just pass the existing comm into the widget (IntSlider(comm=EXISTING_COMM)), and things will just work. It won't try to create a new comm, but will use the existing one.

Copy link
Copy Markdown
Member

Assigned to @minrk for review.

@jasongrout note this also needs a rebase.

Copy link
Copy Markdown
Member Author

this might actually be superseded by Sylvain's pull requests dealing with widget lifetimes. Next week I'll work on reviewing his widget lifetime commits, and nagging you guys to look at them too 😄.

jdfreder commented Aug 2, 2014

Copy link
Copy Markdown
Contributor

Does he need to cherry-pick or reimplement the comm fix from here too?

Copy link
Copy Markdown
Member

I cleaned up #6194. It has all the commits of this PR and a couple more.

jdfreder commented Aug 2, 2014

Copy link
Copy Markdown
Contributor

Great! Does that mean we should close this @jasongrout ?

Copy link
Copy Markdown
Member Author

Yes, please.

jasongrout closed this Aug 2, 2014
SylvainCorlay mentioned this pull request Sep 14, 2014
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL