Pluto.jl icon indicating copy to clipboard operation
Pluto.jl copied to clipboard

Function call works in REPL, but not in Pluto

Open Hofsmo opened this issue 3 years ago • 4 comments

Hi, I recently discovered a nice library https://nrel-siip.github.io/PowerSimulationsDynamics.jl/stable/ . I manage to run the library using REPL, but the same code doesn't work in Pluto. It may be a user error. In any case, I hope you can help me with my error, or the bug, if it is a bug.

Here is a video demonstrating the expected result by running the notebook from REPL:

https://user-images.githubusercontent.com/14806089/156186532-2364534a-b139-498a-b498-8ff146002ed7.mp4

Here is a video demonstrating what happens in Pluto.

https://user-images.githubusercontent.com/14806089/156186727-7fcd5203-bd70-4ff0-900b-a66a141f2d36.mp4

From the video, you can see that the function execute! fails in Pluto.

The notebook is uploaded here:

https://gist.github.com/Hofsmo/9b6199e5b8cba57569b4f3701907bd58

Hope to hear from you soon and many thanks for your nice work on Pluto :)

Hofsmo avatar Mar 01 '22 14:03 Hofsmo

Hey! It looks like a big problem here is that you can't read the error message that is being logged! I made #1962 to fix this, so do pkg> add Pluto#main or wait for our next release to try this again, and take a close look at the error message and stacktrace (post a screenshot here).

fonsp avatar Mar 02 '22 19:03 fonsp

Hi, many thanks for the quick reply. I tried running on Pluto#main. The error message was too long for a screen shot and I didn't figure out how to increase the width of the notebook. I therefore, pasted the first part of the message here, and created a gist for the full error message https://gist.github.com/Hofsmo/84f92ab4c9617454e87330d2c8ff80d9#file-error-txt .

MethodError: no method matching split_callbacks(::Tuple{}, ::Tuple{}, ::SciMLBase.CallbackSet{Tuple{}, Tuple{SciMLBase.DiscreteCallback{PowerSimulationsDynamics.var"#72#73"{PowerSimulationsDynamics.BranchTrip}, PowerSimulationsDynamics.var"#25#26"{PowerSystems.Line}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT)}}})

Closest candidates are:

split_callbacks(::Any, ::Any) at ~/.julia/packages/DiffEqBase/ge0vq/src/callbacks.jl:338

split_callbacks(::Any, ::Any, !Matched::SciMLBase.AbstractContinuousCallback, !Matched::Any...) at ~/.julia/packages/DiffEqBase/ge0vq/src/callbacks.jl:340

split_callbacks(::Any, ::Any, !Matched::SciMLBase.AbstractDiscreteCallback, !Matched::Any...) at ~/.julia/packages/DiffEqBase/ge0vq/src/callbacks.jl:341

P.S. I like the boxes showing the information that was previously printed to the terminal. It's a nice improvement.

Hofsmo avatar Mar 03 '22 07:03 Hofsmo

The error message was too long for a screen shot and I didn't figure out how to increase the width of the notebook.

Could you share a screenshot of this problem?

fonsp avatar Mar 03 '22 10:03 fonsp

Yes, of course. Here is the left part of the error message. image image

Here is the right part of the message after scrolling image

Here is a picture of the cell and the message image

Please tell me if you want additional information.

Hofsmo avatar Mar 03 '22 10:03 Hofsmo