IPython Notebook会话中的多个目录和/或子目录? [英] Multiple directories and/or subdirectories in IPython Notebook session?

查看:198
本文介绍了IPython Notebook会话中的多个目录和/或子目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IPython文档页面建议,打开IPython笔记本的几个不同的会话是与不同目录或子目录中保存的笔记本电脑交互的唯一方法,但这并不是在任何地方明确地确认。


$ b $我正面临一种情况,我可能需要与数百种不同的笔记本进行交互,这些笔记本根据不同的属性分类,并存储在主目录的子目录中。我已将 ipython_notebook_config.py 配置文件中的主目录(让我们称之为 / main )设置为默认目录。



当我启动IPython笔记本时,确实会显示任何已保存的笔记本,它们位于 / main (但

如何实现单个IPython仪表板?这显示了 / main 中的笔记本,还有显示子目录,让我扩展一个子目录并从其内容中选择,或者只显示所有笔记本所有子目录?



每次启动IPython的新实例都是完全没有问题。



如果我有这个能力,我愿意修改源代码。这是一个非常基本的功能,我们需要它,令人惊讶的是,它不仅仅是默认的IPython行为。对于任何数量超过10或15的保存笔记本,此功能必须

解决方案


IPython文档页面表明,打开几个不同的IPython笔记本会话是与不同目录或子目录中保存的笔记本电脑交互的唯一方法,但这并不是在任何地方明确确认。


是的,这是Notebook服务器的当前(临时)限制。笔记本电脑列表中的多目录支持非常高(不幸的是,列表很长,开发人员很少,有天工作),它还没有。通过0.14(Fall,可能),您应该没有理由运行多个nb服务器,但现在这是多个目录的唯一选项。一个简单的初稿缺少的是:


  1. 将个别笔记本与目录关联起来(相当微不足道),

  2. 简单文件系统导航的网页界面(略微微不足道)。




如果我有这个能力,愿意修改源代码


限制因素,如果你想在源代码中,是 NotebookManager ,其中与特定目录相关联。如果你调整list_notebooks()方法来处理子目录,那么你就是90%。



我也很好奇,所以我把一个快速的例子href =https://github.com/minrk/ipython/tree/nbwalk =nofollow>这里,允许您至少在子目录中读/运行/编辑/保存笔记本(步行深度为限于2,但容易改变)。任何新的笔记本都将在顶级目录中,并且没有UI可以移动他们。


The IPython documentation pages suggest that opening several different sessions of IPython notebook is the only way to interact with saved notebooks in different directories or subdirectories, but this is not explicitly confirmed anywhere.

I am facing a situation where I might need to interact with hundreds of different notebooks, which are classified according to different properties and stored in subdirectories of a main directory. I have set that main directory (let's call it /main) in the ipython_notebook_config.py configuration file to be the default directory.

When I launch IPython notebook, indeed it displays any saved notebooks that are within /main (but not saved notebooks within subdirectories within /main).

How can I achieve one single IPython dashboard that shows me the notebooks within /main and also shows subdirectories, lets me expand a subdirectory and choose from its contents, or just shows all notebooks from all subdirectories?

Doing this by launching new instances of IPython every time is completely out of the question.

I'm willing to tinker with source code if I have to for this ability. It's an extremely basic sort of feature, we need it, and it's surprising that it's not just the default IPython behavior. For any amount of saved notebooks over maybe 10 or 15, this feature is necessary.

解决方案

The IPython documentation pages suggest that opening several different sessions of IPython notebook is the only way to interact with saved notebooks in different directories or subdirectories, but this is not explicitly confirmed anywhere.

Yes, this is a current (temporary) limitation of the Notebook server. Multi-directory support is very high on the notebook todo list (unfortunately that list is long, and devs are few and have day jobs), it is just not there yet. By 0.14 (Fall, probably), you should have no reason to be running more than one nb server, but for now that's the only option for multiple directories. All that is missing for a simple first draft is:

  1. Associating individual notebooks with directories (fairly trivial), and
  2. Web UI for simple filesystem navigation (slightly less trivial).

I'm willing to tinker with source code if I have to for this ability

The limiting factor, if you want to poke around in the source, is the NotebookManager, which is associated with a particular directory. If you tweak the list_notebooks() method to handle subdirectories, you are 90% there.

I was curious about this as well, so I tossed together an quick example here that allows you to at least read/run/edit/save notebooks in subdirs (walk depth is limited to 2, but easy to change). Any new notebooks will be in the top-level dir, and there is no UI for moving them around.

这篇关于IPython Notebook会话中的多个目录和/或子目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆