Jupyter is quite clever about how it renders objects.  Essentially the last 
object in scope is examined for special properties, like __svg__ in this case.  
In a loop, this doesn't happen the way you might expect.

You might want to use MolsToGridImage in this case.  Greg also recently made an 
svg version of this recently, but I don't think it is officially released yet.

If you need something right now, there are some Python utilities for combining 
svg images:

https://github.com/astraw/svg_stack/blob/master/README.rst


----
Brian Kelley

> On Oct 10, 2016, at 2:32 AM, Peter S. Shenkin <[email protected]> wrote:
> 
> Please see the attached .png and .ipynb. 
> 
> Basically, this renders:
> 
> svg = render_mol(m, q)
> SVG(svg)
> 
> But this does not render:
> 
> if (True):
> svg = render_mol(m, q)
> SVG(svg)
> 
> Nor does rendering work within a for loop, a function, or a method.
> 
> Where this is going is that I want to make a list of SMILES, put them in a 
> list, and render them all.
> 
> Thanks,
> -P.
> 
> 
> <Render_outermost.png>
> <Render_outermost.ipynb>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most 
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to