Comments (3)
Hey @briochemc,
Just to let you know we are now also adding the behavior you requested in #98. i.e.,
using DynamicQuantities: m, s
v = 3m/s
will work after that PR merges.
Note that you can still use using DynamicQuantities.Units: m, s
if you prefer. Also note that using DynamicQuantities.Constants: c
is still required for constants.
Regarding your question about symbolic units: you can do Quantity(1.0, SymbolicDimensions(m=1))
for meters and Quantity(1.0, SymbolicDimensions(s=1))
for seconds. However you can not explicitly import them (yet). This is because those symbols are lazily loaded at first call to the @us_str
macro, because they take about half a second to load.
In the future I think it would be nice to have this though. We need a way of declaring an immutable SymbolicDimensions
so this can work.
Cheers,
Miles
from dynamicquantities.jl.
You can currently do
using DynamicQuantities.Units: m, s
but maybe I could put the units in DynamicQuantities if that's better? Let me know and I can add it.
The only reason I didn't was to avoid polluting namespaces, and also to avoid name collisions between DynamicQuantities.Constants
and DynamicQuantities.Units
.
from dynamicquantities.jl.
Oh I did not know about this and I think that's good enough!
Side (but related) question: How does one do the same thing for symbolic units?
from dynamicquantities.jl.
Related Issues (20)
- u"Ω" errors in precompilation HOT 6
- Base.isapprox fails for Vector{Quantity} HOT 14
- Meshes.jl test failure HOT 10
- Round tripping Quantities through String HOT 3
- `bionomial` and `factorial` functions not defined? HOT 5
- Molar units not supported HOT 7
- Why `one(1u"kg")` no dimension? HOT 2
- Pretty print element types of `QuantityArray` HOT 2
- Logo HOT 7
- Immutable constants for symbolic dimensions
- Registering custom unit propagation rules
- Choosing type of quantity value based on type used in construction HOT 1
- Further improvements to startup time HOT 1
- Behavior with `missing` HOT 6
- Adding "missing" units HOT 4
- Compatibility with `zero(::Type{T})` HOT 6
- Unitful conversion fails for symbolic units HOT 7
- Sweep: Define `NoDims` for indicating something is not a quantity HOT 2
- `reduce(vcat` returns corrupted result HOT 1
- `map` fails with `QuantityArray` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
`
from dynamicquantities.jl.