These are chat archives for ipython/ipython

25th
Sep 2015
epifanio
@epifanio
Sep 25 2015 02:04
from the mailing list: IPython.notebook.kernel.execute("python_var = '" + IPython.notebook.notebook_name + "'”);works great … this way i can ‘pollute’ the namespace of the notebook from the js widget. cool!.
but ..I was wondering how can be possible to “store” the python_var in the cell output and in the cell metadata where the widget is executed ? i guess i should run something like :
IPython.notebook.kernel.execute("import IPython");
IPython.notebook.kernel.execute( "IPython.core.display.display(‘ python_var : %s' % '" + python_var+ "', metadata={'python_var': '" + python_var+ "'})”");
the import works fine … but the second line is wrong. Any hints on the correct syntax ?
Jonathan Frederic
@jdfreder
Sep 25 2015 02:40
I'm not familiar with that API
but I know a IPython.display.display exists
or used to
maybe drop the "core"?
epifanio
@epifanio
Sep 25 2015 02:43
this in a standard notebook cell :
import IPython
myvar = 10
IPython.core.display.display("python_var : %s" % myvar, metadata={"python_var": myvar})
works .. .metadata should be in the cell output-metadata (so not visible from the notebook but they should be there)
but i can’t get it running from the js side
@jdfreder actually dropping core (in the mython cell) works the same
i’ll try to drom the ‘core’ in the js code and see if something changes

.. but from the js side i tried also a simpler :

IPython.notebook.kernel.execute(“IPython.core.display.display(‘show this text’)”)

without results

epifanio
@epifanio
Sep 25 2015 02:48
i think i’m doing something wrong with “ ‘ ‘ “ quotes
Jonathan Frederic
@jdfreder
Sep 25 2015 02:54
ah
I bet I know what the problem is
it's probably because your executing outside of the context of a cell
epifanio
@epifanio
Sep 25 2015 02:54
or maybe … what i’m trying to do doesn’t make sense … becasue the display got replaced by the widget
Jonathan Frederic
@jdfreder
Sep 25 2015 02:55
it doesn't know how to route the output
epifanio
@epifanio
Sep 25 2015 02:57
i see, I’ve no idea yet how to do it , as little step ahead .. i’ll try to assign the
IPython.notebook.kernel.execute(’some code here') to a function, so it is trigged when i pick with the mouse .. instead of when the widget gets loaded
then hit the head against the output routing :worried:
You need to set the callbacks
epifanio
@epifanio
Sep 25 2015 02:59
i was reading this before, but I got lost
That may help
That article is not the right way to do that anymore
if you need simple bidirectional communication
use comms
if you need bidirectional communication plus context aware front-end content, use widgets
epifanio
@epifanio
Sep 25 2015 14:46
@jdfreder thanks! working on this … trying to read and understand the code you pointed out.
Jeff
@visualjeff
Sep 25 2015 17:01

Can anybody recommend an api or service for image comparison or image analysis? I need to flush through 40,000 portrait photos and I need to remove the overexposed ones.

Thanks in advance,

Jeff

Steven Silvester
@blink1073
Sep 25 2015 18:16
@visualjeff, http://scikit-image.org/ provides the necessary functions
Nicholas Bollweg
@bollwyvl
Sep 25 2015 19:53
is there a component we use that provides "when" or "all" for a list of promises?
(in the notebook js, i should specify)
the jquery one isn't really compatible with pure promises...
Nicholas Bollweg
@bollwyvl
Sep 25 2015 19:58
:facepunch: Promise.all is already natively there