Unitful.jl
Unchained
Unitful.jl | Unchained | |
---|---|---|
9 | 5 | |
575 | 106 | |
0.5% | 4.7% | |
7.0 | 7.0 | |
9 days ago | about 1 month ago | |
Julia | Nim | |
GNU General Public License v3.0 or later | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Unitful.jl
- What Is Dimensional Analysis?
- All I can say is that I relate, very much
-
Are there any languages that allow units?
Julia's Unitful package is one of my favorites. https://github.com/PainterQubits/Unitful.jl
Tangentially related, LaTeX's siunitx package makes typesetting units a joy. https://ctan.org/pkg/siunitx
-
Question solved unsuccessfully
Laughs in https://github.com/PainterQubits/Unitful.jl
-
Similitude.jl is new more powerful Quantity than Unitful.jl
Not sure why you think more units is more powerful. Defining specific units is seldom the difficult part of dealing with units in code. I'd say that just looking at the tests for Unitful (excluding the separate tests for dates) to the tests of Similitude that there seems to be a lot more functionality in Unitful. What are the advantages of these alternate packages? And I do not think focusing on "more powerful" is too useful unless qualified appropriately.
-
ModelingToolkit, Modelica, and Modia: The Composable Modeling Future in Julia
It's really two separate problems but they kinda interact.
Unitful quantities with heterogeneous units don't have a `zero` function that works correctly, which gets in the way inside numerical routines. [0] There are other places where 0 or 1 is added, which is an error for quantities but not for plain real numbers. [1]
Zygote doesn't handle mutating arrays. [2]
[0]: https://github.com/PainterQubits/Unitful.jl/pull/472
-
Atlas, a (hopefully) better engineering IDE
Julia has the Unitful package [1], which does a decent job. It's quite ergonomic, and Julia's design helps with making existing code/libraries play nicely with Unitful-encoded units/values.
[1] https://github.com/PainterQubits/Unitful.jl
- Lotus 1-2-3 arbitrary resolution
-
GNU Units
I've seen a few before, and a quick search yielded a bunch for me, right off the bat. By no means exhaustive:
Julia: https://github.com/PainterQubits/Unitful.jl
Python: https://pint.readthedocs.io/en/0.6/
C++: https://github.com/nholthaus/units
etc.
And yes, it has always struck me as strange that date/time/calendar libraries are standard as canonical libraries shipped with language distributions, but units are not.
Unchained
-
GNU Units
Anything with a finite (200 is small even) number of units misses the algebraic structure of the problem mentioned in https://news.ycombinator.com/item?id=36988497 wherein multiplying|dividing two things gives you a (potentially) new unit which implies an open ended "space" of units.
To be concrete (hah!), in C++ a template meta-type with 12 signed integer parameters (6 numerators & 6 denominators for rational exponents of SI base units) might be one way to model it.
Unlike C++ template stuff, Nim macros (like Lisp macros) makes metaprogramming more like procedural programming - just against abstract syntax trees. I think that helps to shield some of this type complexity from users, but the documentation README https://github.com/SciNim/Unchained does better job than I can in an HN comment.
Of course, for unit system conversion, the number of dimensions (6 in SI, 3 in CGS/Gaussian) changes. So, for full generality you need compile-time (if you want static type integration/CT errors) linear algebra over a rational field (at least & conventionally) to project|inverse project. That might be theoretically possible in C++. I would think it very un-fun and unlikely to ever have been done. There's probably a Mathematica package, though.
- Please Put Units in Names
- Pint: Makes Units Easy -Python
-
Atlas, a (hopefully) better engineering IDE
I've recently written a units library for Nim [0]. It's still WIP, but it's already proven extremely useful for me as a physicist.
Thanks to Nim's strong type system and metaprogramming features, it allows for a fully compile time design, without any runtime overhead (in form of special unit objects or such things; everything is a `distinct float`).
In addition Nim's unicode support, the code even looks nice!
A more complex use case (I can link more if desired): [1]
[0]: https://github.com/SciNim/Unchained/
[1]: https://github.com/SciNim/Unchained/tree/master/examples
What are some alternatives?
gnu-units - GNU Units (mirror)
SI - A header only C++ library that provides type safety and user defined literals for physical units
Zygote-Mutating-Arrays-WorkAround.jl - A tutorial on how to work around ‘Mutating arrays is not supported’ error while performing automatic differentiation (AD) using the Julia package Zygote.
mosdepth - fast BAM/CRAM depth calculation for WGS, exome, or targeted sequencing
NonlinearSolve.jl - High-performance and differentiation-enabled nonlinear solvers (Newton methods), bracketed rootfinding (bisection, Falsi), with sparsity and Newton-Krylov support.
nimbus-eth1 - Nimbus: an Ethereum Execution Client for Resource-Restricted Devices
UnitSystems.jl - Physical unit systems (Metric, English, Natural, etc...)
nimview - A Nim/Webview based helper to create Desktop/Server applications with Nim/C/C++ and HTML/CSS
Ruby Units - A unit handling library for ruby
zen
uom-se - JSR 363 - Implementation for Java SE 8
phpmnd - PHP Magic Number Detector