Scientific temperatures

Discussion thread for Scientific temperatures.

I was directed to report an issue with code execution failure. It is quite the rookie error, I forgot javascript’s function for exponents was Math.pow() and not exp(). The compiler doesn’t recognise exp() and throws this.

Error: Traceback (most recent call last):
File “/root/lovelace-engine/engine/api.py”, line 128, in on_post
user_outputs, p_infos = runner.run(self.container_name, code_filename, function_name, input_tuples)
File “/root/lovelace-engine/engine/code_runner.py”, line 92, in run
raise EngineExecutionError(exec_stdout)
engine.code_runner.EngineExecutionError: /root/4489d837fa65461b4b42ae726b59a2854e79f57e.js:4
T_wc = 13.12 + (0.6215 * T_a) - (11.37 * exp(v, 0.16)) + (0.3965 * T_a * exp(v, 0.16))
^

ReferenceError: exp is not defined
at wind_chill (/root/4489d837fa65461b4b42ae726b59a2854e79f57e.js:4:18)
at Object. (/root/4489d837fa65461b4b42ae726b59a2854e79f57e.js:9:22)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
at executeUserCode (internal/bootstrap/node.js:342:17)
at startExecution (internal/bootstrap/node.js:276:5)
Traceback (most recent call last):
File “/root/4489d837fa65461b4b42ae726b59a2854e79f57e.run.py”, line 50, in
with open(output_json, mode=‘r’) as f:
FileNotFoundError: [Errno 2] No such file or directory: ‘4489d837fa65461b4b42ae726b59a2854e79f57e.output0.json’

For quite a standard error, I didn’t expect such a need to report such issues to the Discourse, but I err on the side of caution and report it anyway.

Hey again @LECAGO! Thanks for reporting this. I think we were a little generous with the errors lol, but glad to know that it does work! I changed the error message slightly in case it’s an error in the code vs. an error in the website.

PS: I thought Javascript did have a Math.exp() but you’re right it’s not the function for this problem.