Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We can call render_image multiple times within a cell now, no threading, no wait. #808

Merged
merged 6 commits into from
May 22, 2019

Conversation

hainm
Copy link
Collaborator

@hainm hainm commented May 22, 2019

Screen Shot 2019-05-22 at 1 22 05 AM

Code

import nglview as nv
import threading
import time
from ipywidgets import Widget
import pytraj as pt
from nglview.contrib.movie import MovieMaker

v = nv.demo()
v

v.clear()
v.add_rope()
s0 = v.render_image()
v.clear()
v.add_cartoon()
s1 = v.render_image()

s0

s1

@hainm hainm merged commit f8f374b into nglviewer:master May 22, 2019
@hainm hainm deleted the export_image branch May 22, 2019 05:42
@hainm
Copy link
Collaborator Author

hainm commented May 22, 2019

cc @jbloom to update your notebooks in dms_struct to use render_image directly in v2.1.0

e.g.:

# cell 1
image = view.render_image()

# cell 2
with open('abc.png', 'wb') as fh:
    fh.write(image.value)

@jbloom
Copy link

jbloom commented May 22, 2019

@hainm: This is awesome, thanks so much!

This is the project for which we're using nglview; the idea is that along with the static figure images we can include as figures the dynamic images as well as mybinder links:
https://github.com/jbloomlab/map_flu_serum_Perth2009_H3_HA

We are working on paper right now, interested in being a co-author? Basically, the idea is we are mapping which viral mutations are selected by polyclonal human serum.

@hainm
Copy link
Collaborator Author

hainm commented May 22, 2019

We are working on paper right now, interested in being a co-author?

Hi, it's my company's policy to prevent me being a co-author. But do feel free to raise any issues here, it's good chance to enhance nglview anyway. Thanks.

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.

2 participants