Sebastian Stock

Results 124 comments of Sebastian Stock

Issue regarding statistics functions like `mean` in affine spaces: https://github.com/JuliaStats/Statistics.jl/issues/47

> But is it possible to get float values with methods ∈ Base? By “get float values”, do you mean stripping the units? That is, you want to convert `1.0u"ng/ml"`...

It will work if `uvec` is constructed like this, but for a general vector it might not. Basically, for this to work, the `eltype` of `uvec` must be a concrete...

> ``` > vec = uvec ./ oneunit(eltype(uvec )) > ``` This will not work for vectors whose `eltype` is not concrete: ```julia julia> uvec = [1u"m", 1u"s"] 2-element Vector{Quantity{Int64}}:...

We could either add a new function for this or use `IOContext` properties. The latter is already in use for formatting exponents in units: ```julia julia> io = IOContext(stdout, :fancy_exponent=>true);...

> Interestingly DataFrames does some rounding: DataFrames probably sets the `IOContext` property `:compact => true`, as containers usually do: ```julia julia> println((1/7)u"mm") 0.14285714285714285 mm julia> println(IOContext(stdout, :compact=>true), (1/7)u"mm") 0.142857 mm...

IMO, the best solution would be to add a third parameter to `convfact` that specifies the type of the value that is to be converted, i.e., ```julia convfact(Int, m, cm)...

I think the best way to fix this would be to add a `ReshapedSparseArray

That would be a simple solution, but seems inefficient. It would also create a completely new array that shares no memory with the original one, in contrast to the current...

Now that I’ve looked at this, I’m surprised that it ever worked. The problem is here: https://github.com/PainterQubits/Unitful.jl/blob/dc044eeed30405a4b87be569d5eb1f291e97e795/src/units.jl#L304-L307 This is a generated function that depends on non-constant global state (`Unitful.promotion`), which...