lovelace-engine icon indicating copy to clipboard operation
lovelace-engine copied to clipboard

[Julia] Cannot properly parse input for Temperature Variations problem

Open BinaryFissionGames opened this issue 3 years ago • 0 comments

While poking around with Julia, I wanted to test if multiple returns would work, so I tried the "Temperature Variations" problem, but even with just the stub code, it refuses to work:

Return code from executing user code in docker container is nonzero. Returning falcon HTTP 400.

A stacktrace should appear below with more information about this error which might help
you debug your code. But if it's not your code then it might be our fault :( If this is a
website error and you have the time, we'd really appreciate it if you could report this
on Discourse (https://discourse.projectlovelace.net/) or via email ([email protected]).
All the information is embedded in the email link so all you have to do is press send.
Thanks so much!

Error: Traceback (most recent call last):
  File "/engine/engine/api.py", line 182, in on_post
    self.container_name, code_filename, function_name, input_tuples, output_tuples
  File "/engine/engine/code_runner.py", line 137, in run
    raise EngineExecutionError(exec_stdout)
engine.code_runner.EngineExecutionError: ERROR: LoadError: MethodError: no method matching Array{Float64,1}(::Array{Float64,2})

You might have used a 2d row vector where a 1d column vector was required.
Note the difference between 1d column vector [1,2,3] and 2d row vector [1 2 3].
You can convert to a column vector with the vec() function.
Closest candidates are:
  Array{Float64,1}(::AbstractArray{S,N}) where {T, N, S} at array.jl:562
  Array{Float64,1}() where T at boot.jl:425
  Array{Float64,1}(!Matched::UndefInitializer, !Matched::Int64) where T at boot.jl:406
  ...
Stacktrace:
 [1] convert(::Type{Array{Float64,1}}, ::Array{Float64,2}) at ./array.jl:554
 [2] juliafy_json(::Array{Any,1}) at /root/82946aaa170e576ae2af3846d4ae866e6f6fa1c1.jl:25
 [3] iterate at ./generator.jl:47 [inlined]
 [4] collect(::Base.Generator{Array{Any,1},typeof(juliafy_json)}) at ./array.jl:686
 [5] top-level scope at /root/82946aaa170e576ae2af3846d4ae866e6f6fa1c1.jl:34
 [6] include(::Function, ::Module, ::String) at ./Base.jl:380
 [7] include(::Module, ::String) at ./Base.jl:368
 [8] exec_options(::Base.JLOptions) at ./client.jl:296
 [9] _start() at ./client.jl:506
in expression starting at /root/82946aaa170e576ae2af3846d4ae866e6f6fa1c1.jl:32
Traceback (most recent call last):
  File "/root/82946aaa170e576ae2af3846d4ae866e6f6fa1c1.run.py", line 63, in 
    with open(output_json, mode='r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '82946aaa170e576ae2af3846d4ae866e6f6fa1c1.output1.json'

It looks like it's choking on the fact that the input is an array. I'm not super familiar with Julia, so I'm not even particularly sure what problem this whole juliafy_json step is solving, but maybe the problem is using hcat instead of vcat?

BinaryFissionGames avatar Apr 23 '21 22:04 BinaryFissionGames