Python units/quantities packages

Entreprises > Dévelopement informatique > Frameworks
2
2021-12-14 21:40:54
There are far too many different packages for unit conversion / quantities calculations in Python. Developers should cooperate on one package instead of fragmenting development across many different ones. This documents which features are supported by each package.
Site webPyPI DLs/monthGitHub StarsUsed byBuilt-in unitsBuilt-in constantsArbitrary prefixesnp scalar arraynp object arrayDecimalFractionUncertaintiesstringabsolute °CdBSyntaxeCommentaires
scipy.constantshttp://docs.scipy.org/doc/scipy/reference/constants.html1673857087181360Oui 50Oui 400 in CODATANon- no unit objects- no unit objects- no unit objects- no unit objects- no unit objects- no unit objectsNonNonconstants.c == 299792458.0Just tables of numerical constants; unit-aware calculations not supported. scipy.constants.physical_constants specifies units as strings and uncertainties. Could be used to supply other packages with coefficients.
sympy.physics.unitshttp://docs.sympy.org/dev/modules/physics/units.html55424692418324Oui 200?Oui- u.mega*u.meter but not u.megameterNonOui array([1, 2, 3])*u.m- converts to sympy- converts to sympycm = u.m/100
astropy.unitshttp://docs.astropy.org/en/stable/units/11358243513777OuiOuiNonOui-OuiOui15.1 * u.meter / (32.0 * u.second)
Pinthttps://github.com/hgrecco/pint3574611281579OuiOuiOui Mm, GV, etc.Oui array([1,2,3])*ureg.m or ureg.m*array([1,2,3])Non ValueErrorOuiOuiOui built-inOuiOuiNonV = 1*ureg.dm**3
unythttps://unyt.readthedocs.io/en/stable/24329Oui 101Oui 33Oui km4*m + 3*cm - 5*ft + 6*yard
Quantitieshttp://python-quantities.readthedocs.org3917147231Oui array([1,2,3]) * pq.JNon
Unitshttps://bitbucket.org/adonohue/units/1376
numericalunitshttps://pypi.python.org/pypi/numericalunits44569Overflow issues, random set of units = not deterministic, need to do calculations twice to confirm they are being done correctly
SciMath Unitshttp://scimath.readthedocs.org/en/latest/units/index.html43036Oui built-in
Buckinghamhttps://github.com/mdipierro/buckingham361200Oui 53NonOuiV = Number(1,dims='decimeter^3')Single file
Unumhttps://bitbucket.org/kiv/unum334
natuhttp://kdavies4.github.io/natu/315OuiOui 40OuiOui m*array([1, 2, 3])Oui array([1, 2, 3])*mNonNonOuiNonOuiOuiV = 1*dm**3weird format for dB, Hz != 1/s, "pre-release state"
misuhttps://github.com/cjrh/misu308110
Magnitudehttp://juanreyero.com/open/magnitude/2381631OuiOuiOui
udunitspyhttps://github.com/blazetopher/udunitspy/18820Python wrapper for UDUNITS2
DimPyhttp://www.inference.phy.cam.ac.uk/db410/0
Scalarhttp://russp.us/scalar-python.htm0
ScientificPython PhysicalQuantitieshttp://dirac.cnrs-orleans.fr/ScientificPython/ScientificPythonManual/Scientific.Physics.PhysicalQuantities-module.html0
Inclure
  • 2016-03-06 19:38:38
    2021-12-14 21:40:54
  • Frameworks
    English
  • Compare Python packages for units/quantities conversions
  • Publique
    Publique
  • Creative Commons License CC-BY-SA 3.0 / GNU FDL
    Gérer les sauvegardes

Commentaires

  • a voté pour ce Comparatif (J'aime)
    Posté 2020-05-06 18:58:19 par Alexis
  • a voté pour ce Comparatif (J'aime)
    Posté 2020-05-06 00:36:47 par wkpk2x62vz

Laisser un commentaire

S'inscrire Se connecter