unyt:使用Python中的单位处理、操作和转换数据
unyt: Handle, manipulate, and convert data with units in Python
摘要:
处理真实世界数据或模拟物理系统的软件必须有某种管理单元的方法。虽然简单的方法,如所有数据都在单位制(如MKS SI单位制)中的理解惯例,在实践中确实有效,但它们充满了软件开发人员和用户可能的错误来源。在本文中,我们介绍了unyt,一个基于NumPy和SymPy的Python库,用于处理具有单位的数据。它旨在帮助快速交互式计算,并紧密集成到更大的Python应用程序或库中。我们将unyt与另外两个处理单位的Python库Pint和astropy.units进行比较,发现unyt更快,测试覆盖率更高,代码行更少。
英文摘要:
Software that processes real-world data or that models a physical system must have some way of managing units. While simple approaches like the understood convention that all data are in a unit system (such as the MKS SI unit system) do work in practice, they are fraught with possible sources of error both by developers and users of the software. In this paper we present unyt, a Python library based on NumPy and SymPy for handling data that has units. It is designed both to aid quick interactive calculations and to be tightly integrated into a larger Python application or library. We compare unyt with two other Python libraries for handling units, Pint and astropy.units, and find that unyt is faster, has higher test coverage, and has fewer lines of code.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。