确实与Jupyter Notebook,Lab,扩展和ipywidget混淆 [英] Really confused with Jupyter Notebook, Lab, extensions, and ipywidgets

查看:443
本文介绍了确实与Jupyter Notebook,Lab,扩展和ipywidget混淆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个交互式JupyterLab Notebook应用程序,并且需要创建一系列自定义Widget.因此,我开始研究这个问题,而且我看起来越困惑,我就会变得越困惑.为简单起见,我会问一堆简单的问题:

I want to create an interactive JupyterLab Notebook application, and I need to create a series of custom Widgets. So I started looking into this matter, and the more I look the more confused I become. To make things simple I will ask a bunch of simple questions:

  1. 在Jupyter Notebooks上使用小部件的最常见方法之一是使用ipywidgets库.对吧?
  2. 与传统的Notebook不同,JupyterLab的Notebook无法直接呈现JavaScript.结果,ipywidgets文档中有关自定义小部件创建的教程无法在JupyterLab上运行.对吧?
  3. 如果要在JupyterLab的Notebook上运行JavaScript,她或他将必须通过扩展来实现.如果是ipywidget,则必须安装@ jupyter-widgets/jupyterlab-manager.对吧?
  4. 如果要使用ipywidgets库编写自定义窗口小部件,可以将两个GitHub项目用作起点:widget-cookiecutter和widget-ts-cookiecutter.据我了解,前者基于JavaScript,而后者基于TypeScript.同样,第一个在某种类型上似乎处于非活动状态,而第二个则处于活动状态. JupyterWidgets团队是否计划专注于TypeScript?我应该跟随哪一个?
  5. cookiecutter项目实际上没有文档.我真的很困惑,也很难理解他们的代码.当然,我可以复制粘贴它们,然后开始弄乱,直到弄清楚整个过程是如何工作的,以及代码中的钩子"或入口点"是什么,但是如果有人可以给我一些额外的指针,我将不胜感激.
  6. JupyterWidgets是Jupyter项目的官方"项目吗?考虑到该项目中的成员数量很少,我想知道基于ipywidgets进行工作的安全性如何.请记住,"DeclarativeWidgets"项目很久以前就已放弃.
  7. 是否有其他库比ipywidgets中实现的小部件更多,并且还可以在JupyterLab上运行?
  8. 我想创建一个用于服务器端数据处理的Web应用程序.我的最初目标是创建一个不希望用户进行任何编码的应用程序/服务,并通过使用html/JavaScript小部件来执行所有操作.可以使用Angular/React前端和Python/Django/Flask后端来实现.但是,后来,我意识到在某些情况下,用户可能希望在服务器上执行一些其他自定义/任意处理.这就是为什么我考虑使用JupyterLab.我想知道这是否是最好的方法,是否有可能仅创建例如正常的Angular/Python字体/后端,然后以某种方式将其包装在JupyterLab扩展程序中,该扩展程序将提供一种从该程序访问数据的机制.应用程序/服务,并将其带到笔记本电脑中进行进一步处理.

预先感谢

推荐答案

通常,stackoverflow问题应尝试仅在一个时间问一个问题.话虽这么说,我会尽力回答这些问题:

In general, stackoverflow question should try to only ask one question at the time. That being said, I'll try to answer the questions as best I can:

  1. ipywidgets是主要方法,是的.这就是人们谈论笔记本小部件时的意思.
  2. jupyterlab存储库上的jupyterlab中有一个跟踪通用JS的问题.
  3. @jupyter-widgets/jupyterlab-manager是jupyterlab的小部件,是的,但是您仍然需要ipywidgets中的python代码.请参见 http://ipywidgets.readthedocs.io/en/stable/user_install.html了解详情.
  4. 虽然一个确实是JS,另一个确实是TS,但TS本身也具有所有的花哨功能.因此,它也更加复杂. JS较简单,因此可能更适合理解最重要的部分.
  5. 我同意,两者都可以提供更好的文档!我一直想这样做.实现此目标的最佳方法可能是在各个存储库中打开带有特定问题的问题,并建议在README或类似文档中进行解释.这样,您可以确保解决您的痛点.
  6. 鉴于窗口小部件的庞大用户群,我认为它是安全的.尽管总线系数不是很高,但是如果维护人员下降,人们往往会加紧努力.
  7. 是的,但是对于开发人员和用户而言,在jupyterlab中使用小部件仍然需要较高的维护成本.
  8. 您可能想学习的是Comms( http://jupyter -notebook.readthedocs.io/en/stable/comms.html ),这是小部件在后台进行同步的方式.但是,这是较低的级别,因此您必须判断哪种最适合您.
  1. ipywidgets is the main way, yes. It is what people mean when they talk about notebook widgets.
  2. There is an issue tracking general JS in jupyterlab on the jupyterlab repo.
  3. @jupyter-widgets/jupyterlab-manager is the widgets for jupyterlab, yes, but you will still need the python code in ipywidgets. See http://ipywidgets.readthedocs.io/en/stable/user_install.html for details.
  4. While it is true that one is JS and the other TS, the TS one also has all the bells and whistles. It is therefore also more complex. The JS one is more bare-bones and might therefore be better for understanding the most important bits.
  5. I agree that both could do with better documentation! I've been meaning to do this for a while. The best way to make this happen is probably to open issues with specific questions on the respective repositories, and suggesting the explanation go in the README or similar. That way you can ensure that your pain-points gets addressed.
  6. Given the large user base of widgets, I would consider it safe. While the bus factor isn't very high, people tend to step up if there is a drop in maintainers.
  7. Yes, but using widgets for jupyterlab is still slightly high maintenance both for developers and users.
  8. What you might want to study is Comms (http://jupyter-notebook.readthedocs.io/en/stable/comms.html), which is what widgets use under the hood for its synchronization. This is lower level though, so you will have to judge which is most suitable for you.

这篇关于确实与Jupyter Notebook,Lab,扩展和ipywidget混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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