Closed tomasaschan closed 10 years ago
Thanks for reporting this and figuring out the problem!
Off-topic, but it turns out our travis script was not actually running the tests. I just turned that on, and also fixed another problem that cropped up due to changes in Julia over the last couple of weeks. Hopefully we'll be good to go, but it's possible we may get PkgEvaluator failures for a little bit.
I am still getting this error with InterpCubic:
using Grid
x = 0:0.1:6
y = 10:0.1:15
z = sin(x * y')
zi = CoordInterpGrid((x,y),z, BCnil,InterpCubic)
Results in ERROR: DimensionMismatch("Coordinate lengths do not match grid size.") in CoordInterpGrid at c:\home\simonp.julia\v0.3\Grid\src\coord.jl:7
@simonp0420 InterpCubic
isn't correctly implemented for all boundary conditions (yet). I thought I had made sure that attempting to construct an InterpGrid
with boundary conditions that don't work correctly threw an error, but it seems I didn't :(
Thanks for reporting the issue - I'll see if I can spend some time on correctly implementing the remaining boundary conditions.
Try the following:
This happens because for certain combinations of boundary conditions and interpolation types, the matrix with interpolation coefficients is extended with a "frame" of extra values. Because of this,
size(grid)
from here doesn't return the size of the original data array, and thus the assertion here fails, although the data provided by the user is actually valid.I think the easiest fix is to provide methods for
size
which take this into account, and I'll probably try to put together a PR to this effect. (There might be further problems withInterpCubic
related to this matrix resize, too...) However, it'll be a while, since I currently have to focus on finishing up my thesis.