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

MakieOutput Unknown error #248

Open
nicolasmerino41 opened this issue May 7, 2024 · 4 comments
Open

MakieOutput Unknown error #248

nicolasmerino41 opened this issue May 7, 2024 · 4 comments

Comments

@nicolasmerino41
Copy link

Hi,

I've been using MakieOutput and it works fine when used as the default visualisation (e.g.):

output = MakieOutput(
    reverse(init, dims=2);
    tspan = tspan, 
    ruleset = ruleset, 
    fps = 100) 

However, I cannot manage to make it work in the personalized fashion:

output = MakieOutput(init; tspan, ruleset) do layout, frame, t
      image!(Axis(layout[1, 1]), frame; interpolate=false, colormap=:inferno)
  end

I always get the same error:
ERROR: MethodError: no method matching (::var"#37#38")(::DynamicGridsMakieExt.MakieSim)

The stacktrace shows ::var"#37#38" is associated to the f:: keyword:

Stacktrace:

MakieOutput(; frames::Vector{…}, running::Bool, extent::Extent{…}, ruleset::Ruleset{…}, extrainit::Dict{…}, interactive::Bool, figure::Figure, layout::GridLayout, inputgrid::GridLayout, f::var"#37#38", graphicconfig::Nothing, simdata::Nothing, ncolumns::Int64, sim_kw::@NamedTuple{}, slider_kw::@NamedTuple{}, kw::Base.Pairs{…}) at DynamicGridsMakieExt.jl

I've found f to be f=_plot! by default but I don't know what other arguments it can take nor if the solution lies there.

Ps: I have tried the example in the documentation and it throws the exact same error so idk.
Here the example for ease:

ruleset = Ruleset(Life())
# And the time-span for it to run
tspan = 1:100
# Create our own plots with Makie.jl
output = MakieOutput(rand(Bool, 200, 300); tspan, ruleset) do layout, frame, t
    image!(Axis(layout[1, 1]), frame; interpolate=false, colormap=:inferno)
end

Thank you,
Nico

@rafaqz
Copy link
Member

rafaqz commented May 8, 2024

Hi Nico, Yes I think I've changed the code as I've been using it (another reason I haven't registered it yet...)

But there are a bunch of complicated multi-window examples here in my PhD script mess:
https://github.com/rafaqz/MauritiusExtinctions/blob/master/makie.jl

@rafaqz
Copy link
Member

rafaqz commented May 8, 2024

And this code works for me:

ruleset = Ruleset(Life())
# And the time-span for it to run
tspan = 1:100
# Create our own plots with Makie.jl
output = MakieOutput(rand(Bool, 200, 300); tspan, ruleset) do (; layout, frame)
    image!(Axis(layout[1, 1]), frame; interpolate=false, colormap=:inferno)
end

I made it so it passes a single object, the (; layout, frame) is property destructuring where before they were separate arguments.

(I'm going to make a new documentation + makie fixes PR, thanks for the motivation)

@rafaqz
Copy link
Member

rafaqz commented May 8, 2024

Ok I've pushed some more accurate docs to dev and fixed a few things

@nicolasmerino41
Copy link
Author

Awesome! Very much appreciated, I'm really banking on the cesar framework for my PhD project :)

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