JuliaMath / JuliaMath/Polynomials.jl
[Feature request] Unitful compatibility
- Dominant language
- Julia
- Stars
- 320
- Forks
- 80
- Avg merge
- 8h 46m
- Merged PRs (30d)
- 3
Description
_Issue discovered by @AndiMD originally in [#295](https://github.com/JuliaMath/Polynomials.jl/issues/295#issuecomment-737641577):_
Possibly related, [Unitful.jl](https://github.com/PainterQubits/Unitful.jl) compatibility:
```julia
julia> using Polynomials, Unitful
julia> fit([1.0,2.0,3.0,4.0].*u"m", [6.0,4.0,7.0,7.5].*u"m",2)
ERROR: DimensionError ...
```
---
Response from @jverzani on 5th Dec., 2020:
> Yeah, [...] I'm not sure there is a proper fix. For fitting, a Vandermonde matrix is constructed with columns which would need units of u^0, u^1, ...,u^n. So currently there is an error as we type that matrix by eltype(x).
>
> Some discussion on the issue of using units with matrices can be found here:
[PainterQubits/Unitful.jl#46](https://github.com/PainterQubits/Unitful.jl/issues/46)
>
> with the simplest recommendation being to strip the units and add them back, as needed.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.