Davos: A Python package “smuggler” for constructing lightweight reproducible notebooks

Davos: A Python package “smuggler” for constructing lightweight reproducible notebooks
复制标题

Davos:一个 Python 包“走私者”,用于构建轻量级可复制笔记本

DOI:
10.1016/j.softx.2023.101614
复制
发表时间:
2024
期刊:
影响因子:
3.4
通讯作者:
Manning, Jeremy R.
Manning, Jeremy R.
中科院分区:
计算机科学4区
文献类型:
--
作者:
Fitzpatrick, Paxton C.;Manning, Jeremy R.

文献摘要

相似文献

可重复性是现代科学研究的核心要求。对于计算研究来说,可重复性意味着即使在不同的系统上运行,代码也应该产生相同的结果。确保可重复性的标准方法需要将项目的依赖项与其主要代码库一起打包。现有的解决方案在指定这些依赖关系的深度方面有所不同,从虚拟环境到容器,再到虚拟机。这些现有解决方案中的每一个都需要安装或设置一个系统来运行所需的代码,从而增加了共享和参与可重复科学的复杂性和时间成本。在这里,我们提出了一个更轻量级的解决方案:Davos 包。当与基于笔记本的 Python 项目结合使用时,Davos 提供了一种机制,可以直接在需要项目依赖项的代码中指定项目依赖项的正确版本,并在代码运行时自动将它们安装在隔离的环境中。 Davos 包进一步确保每次执行笔记本代码时都使用这些包和特定版本。这使得研究人员能够在单个 Jupyter 笔记本文件中共享其代码的完整可复制副本。
Reproducibility is a core requirement of modern scientific research. For computational research, reproducibility means that code should produce the same results, even when run on different systems. A standard approach to ensuring reproducibility entails packaging a project’s dependencies along with its primary code base. Existing solutions vary in how deeply these dependencies are specified, ranging from virtual environments, to containers, to virtual machines. Each of these existing solutions requires installing or setting up a system for running the desired code, increasing the complexity and time cost of both sharing and engaging with reproducible science. Here, we propose a lighter-weight solution: theDavospackage. When used in combination with a notebook-based Python project,Davosprovides a mechanism for specifying the correct versions of the project’s dependencies directly within the code that requires them, and automatically installing them in an isolated environment when the code is run. TheDavospackage further ensures that these packages and specific versions are used every time the notebook’s code is executed. This enables researchers to share a complete reproducible copy of their code within a single Jupyter notebook file.