Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display of interpolation objects is broken (soon...) #14

Closed
tomasaschan opened this issue Dec 26, 2014 · 5 comments
Closed

Display of interpolation objects is broken (soon...) #14

tomasaschan opened this issue Dec 26, 2014 · 5 comments

Comments

@tomasaschan
Copy link
Contributor

julia> using Interpolations

julia> A1 = rand(3)
3-element Array{Float64,1}:
 0.305873 
 0.0887733
 0.981168 

julia> i1 = Interpolation(A1, Linear(OnGrid()), ExtrapError())
[3]-element Interpolation{Float64,1,Linear{OnGrid},ExtrapError}Error showing value of type Interpolation{Float64,1,Linear{OnGrid},ExtrapError}:
ERROR: type: writemime: in typeassert, expected Int64, got Array{Int64,1}
 in writemime at replutil.jl:19
 in display at REPL.jl:117
 in display at REPL.jl:120
 in display at multimedia.jl:149
 in print_response at REPL.jl:139
 in print_response at REPL.jl:124
 in anonymous at REPL.jl:586
 in run_interface at ./LineEdit.jl:1379
 in run_frontend at ./REPL.jl:818
 in run_repl at ./REPL.jl:169
 in _start at ./client.jl:400

It works on master, but will break as soon as #9 merges. I have no idea what I did to break it. @timholy, any ideas?

@timholy
Copy link
Member

timholy commented Dec 27, 2014

I'm not sure which julia version you're using, but for me line 19 of replutil.jl is a call to isempty. You could test that stand-alone and use @which to figure out the chain of calls. One likely possibility is a broken size function, or iteration if you've defined start, next, and done.

@tomasaschan
Copy link
Contributor Author

I have modified the size function on interpolation objects, similarly to how it's done in Grid - when the coefficient matrix is padded, I return the size of the un-padded matrix. So if breaking size can break this, that's a very probable culprit =)

Is there any documentation/information on what contract size should fulfil to work in these contexts? I'll see if I can hunt this down with @which calls anyhow...

@tomasaschan
Copy link
Contributor Author

Oh, and for what it's worth:

julia> versioninfo()
Julia Version 0.3.5-pre+2
Commit ddfbc6c (2014-12-26 10:47 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

@timholy
Copy link
Member

timholy commented Dec 27, 2014

Plain size(A) needs to return a tuple; size(A,d) needs to return an Int.

@tomasaschan
Copy link
Contributor Author

Ah - I was returning a 1-tuple with an array, rather than a tuple with the array contents. The difference between tuple([1,2]) and tuple([1,2]...)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants