arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2112.14825cs.SE
收藏

ReSplit:通过重新拆分单元来改进笔记本电脑的结构

ReSplit: Improving the Structure of Jupyter Notebooks by Re-Splitting Their Cells

Sergey Titov, Yaroslav Golubev, Timofey Bryksin

摘要:

字节笔记本代表了一种独特的编程格式-代码和Markdown的组合,具有丰富的格式,分隔成单独的单元格。我们建议感知一个笔记本电脑单元格作为一个简化和原始版本的编程功能。与函数类似,细胞应该努力包含单一的、自包含的动作。与此同时,研究表明,现实世界的笔记本电脑无法做到这一点,并且缺乏适当的结构。为了解决这个问题,我们提出了ReSplit,一种自动重新分割笔记本中单元格的算法。该算法分析笔记本中的定义-使用链,并由两部分组成-合并和分裂单元格。我们在一个大型笔记本语料库上运行该算法,以评估其性能及其对笔记本的整体影响,并由人类专家进行评估:我们向他们展示了几个笔记本的原始和重新拆分的形式。在29.5%的情况下,重新拆分的笔记本被选为感知代码的首选方式。我们分析了是什么影响了这一决定,并详细描述了几个个案。

英文摘要:

Jupyter notebooks represent a unique format for programming - a combination of code and Markdown with rich formatting, separated into individual cells. We propose to perceive a Jupyter Notebook cell as a simplified and raw version of a programming function. Similar to functions, Jupyter cells should strive to contain singular, self-contained actions. At the same time, research shows that real-world notebooks fail to do so and suffer from the lack of proper structure. To combat this, we propose ReSplit, an algorithm for an automatic re-splitting of cells in Jupyter notebooks. The algorithm analyzes definition-usage chains in the notebook and consists of two parts - merging and splitting the cells. We ran the algorithm on a large corpus of notebooks to evaluate its performance and its overall effect on notebooks, and evaluated it by human experts: we showed them several notebooks in their original and the re-split form. In 29.5% of cases, the re-split notebook was selected as the preferred way of perceiving the code. We analyze what influenced this decision and describe several individual cases in detail.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑