<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 26, 2017 at 3:32 PM, Zoltán Vörös <span dir="ltr"><<a href="mailto:zvoros@gmail.com" target="_blank">zvoros@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Matthias,<span><br>
<br>
<br>
On 01/26/2017 10:03 PM, Matthias Bussonnier wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If I were you I would go the route of a custom ContentManager which<br>
expose actual folders as notebooks (something akin ipymd/notedown but<br>
with folders) and start kernels in these folders.<br>
Then you "just" zip and share the folder. That would also solve the<br>
fact that notebooks are text-based fileformats, which are inherently<br>
bad for binary data, andd o not support incremental updates.<br>
</blockquote>
<br></span>
If the data are pickled, then one wouldn't have to save anything in binary format. All I want to do is write a single ascii line in the metadata if the notebook. That in itself is actually recommended (From the help: " We recommend putting custom metadata attributes in an appropriately named sub-structure, so they don't conflict with those of others."), and supports incremental updates. This magic command or whatever would simply save the step of having to open the metadata editor manually, and inserting the line by hand.<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
One of the problem is that what you are trying to do will not work on<br>
many system and it is relatively hard to make it part of Jupyter if it<br>
only work on some limited use case as we'd like to have a clear<br>
message of what is vetted by the core.<br>
</blockquote>
<br></span>
I am not sure I see the difficulty: this would be pure python, pure javascript. You take the variable, pickle it, attach the resulting string to the notebook metadata under "user_variables", and you are done. Of course, it is a different question, what happens, if your kernel is not python. Well, then it's a problem, I admit. But there are other magic commands that are python specific, e.g., prun, or the debugger, so this in itself can't be an obstacle.<br></blockquote><div><br></div><div>But pickles aren't portable. You wouldn't only be able to share this data unless others use the same OS/arch/python version. Seems less flexible than a sidecar file with the data stored in a portable format (e.g. hdf5, csv, etc...).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I have looked at the documentation, but it seems to me that no functions could expose the notebook metadata, or the cell metadata for that matter, is that correct? (I don't want to divert the discussion, but this latter functionality could be used for creating plots/tables etc. with caption in the notebook. The caption would be displayed in the notebook as an extra div, and the content of the caption could be written in the cell metadata. Nbconvert could then strip the div from the output, and take the raw content of the metadata, and insert it in the LaTeX document. Captions for figures are a long-standing problem in the notebook.)<br>
<br>
<br>
<br>
Cheers,<br>
Zoltán<div class="m_-2820701538011924009HOEnZb"><div class="m_-2820701538011924009h5"><br>
<br>
<br>
______________________________<wbr>_________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/ipython-dev" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman<wbr>/listinfo/ipython-dev</a><br>
</div></div></blockquote></div><br></div></div>