timholy/Grid.jl — pull request #35 by mbauman (2014-07-15 20:52:42+00:00)
Title: Allow interpolation with units!

This patch allows InterpIrregular grids to be unitful (from SIUnits). InterpIrregular grids now accept Numbers for both creation and indexing. Because getindex is defined for Real on AbstractArrays, Grid needs to define both getindex(..., ::Real) *and* getindex(..., ::Number) to avoid ambiguity.

Here's what this allows:

julia> InterpIrregular([1.s,2.s,3.s], big([2.,3.,4.]), 0., InterpLinear)[1.5s:2.5s]
2-element Array{BigFloat,1}:
2.5e+00
3.5e+00

Of course, if you have a unitful grid, you must index it with compatible units.