-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add constructors for identity conversions? #113
Comments
Out of curiosity, are you trying this out of interest in something units-related or is this an example to explore defaults for constructors etc.? Worth cross-referencing Unitful.jl, where the first works and the second fails (though it works if you change the first argument to |
I found this by trying to create an AxisArray with SIUnit spacings (it works if you use Unitful), just for demo purposes. Naturally, the construct-vs-convert issue jumped out at me. It's been a while since I looked in on Unitful.jl, and it is really quite glorious! I might even look the other way on its overloading |
Personally I don't think so. SIUnits was started using a pretty early version of Julia (in particular, before Also, @ajkeller34 has been awesome as a designer, developer, and maintainer. Really nice to have this part of the Julia landscape in such good hands, in no small measure because it also frees up @Keno to do other cool stuff. If @Keno is amenable, we could put a more aggressive redirection in the README. It's just plain fun to attach units to all your variables and see how many packages choke 🙂. (Beyond code, this also applies on purely theoretical grounds to whole fields of applied mathematics, like about 80% of the widely-used algorithms in optimization theory.) My own packages are not immune from that kind of failure. It's consistently a good test of whether you're thinking about things in a clean way. |
Please do whatever with this package. It was written for my physics/EE homework, which I don't have any more, so I'm no longer regularly using this package. |
|
Currently we get this:
Generally subtypes of
Number
should be able to handleT(x::T)
calls. This causes problems e.g. with ranges of unit quantities:The text was updated successfully, but these errors were encountered: