@@ -109,29 +109,23 @@ expand_units(q::QuantityArray) = expand_units.(q)
109
109
110
110
"""
111
111
uconvert(qout::AbstractQuantity{<:Any, <:SymbolicDimensions}, q::AbstractQuantity{<:Any, <:Dimensions})
112
- uconvert(ustr::String, q::AbstractQuantity{<:Any, <:Dimensions})
113
112
114
113
Convert a quantity `q` with base SI units to the symbolic units of `qout`, for `q` and `qout` with compatible units.
115
114
Mathematically, the result has value `q / expand_units(qout)` and units `dimension(qout)`.
116
- For string input, `qout` is created by parsing `ustr` as a symbolic unit, i.e. `qout = sym_uparse(ustr)`.
117
115
"""
118
116
function uconvert (qout:: AbstractQuantity{<:Any, <:SymbolicDimensions} , q:: AbstractQuantity{<:Any, <:Dimensions} )
119
117
qout_expanded = expand_units (qout)
120
118
dimension (q) == dimension (qout_expanded) || throw (DimensionError (q, qout_expanded))
121
119
return new_quantity (typeof (qout), ustrip (q) / ustrip (qout_expanded), dimension (qout))
122
120
end
123
- uconvert (ustr:: String , q:: AbstractQuantity{<:Any, <:Dimensions} ) = uconvert (sym_uparse (ustr), q)
124
121
125
122
"""
126
123
uconvert(qout::AbstractQuantity{<:Any, <:SymbolicDimensions})
127
- uconvert(ustr::String)
128
124
129
125
Create a function that converts an input quantity `q` with base SI units to the symbolic units of `qout`, i.e
130
126
a function equivalent to `q -> uconvert(qout, q)`.
131
- For string input, `qout` is created by parsing `ustr` as a symbolic unit, i.e. `qout = sym_uparse(ustr)`.
132
127
"""
133
128
uconvert (qout:: AbstractQuantity{<:Any, <:SymbolicDimensions} ) = Base. Fix1 (uconvert, qout)
134
- uconvert (ustr:: String ) = uconvert (sym_uparse (ustr))
135
129
136
130
Base. copy (d:: SymbolicDimensions ) = SymbolicDimensions (copy (getfield (d, :nzdims )), copy (getfield (d, :nzvals )))
137
131
function Base.:(== )(l:: SymbolicDimensions , r:: SymbolicDimensions )
0 commit comments