MindTheGap-ERC / CarboKitten.jl

Julia implementation of carbonate platform model
https://mindthegap-erc.github.io/CarboKitten.jl/
GNU General Public License v3.0
0 stars 0 forks source link

Documentation incomplete wrt reproducing Figure 3 from Burgess 2013 #36

Closed HannoSpreeuw closed 2 months ago

HannoSpreeuw commented 2 months ago

I am following the Cellular Automaton instructions to reproduce Figure 3 from Burgess 2013:

init = rand(0:3, 50, 50)
result = Iterators.take(CA.run(Reflected{2}, init, 3), 8)

The first instruction works flawlessly, but the second one gives

ERROR: UndefVarError: `CA` not defined
HannoSpreeuw commented 2 months ago

Going one page back, i.e. to the CarboCAT Summary page, perhaps one first has to issue include("src/Burgess2013.jl").

But that gives

ERROR: LoadError: UndefVarError: `Stencil` not defined
HannoSpreeuw commented 2 months ago

include("src/Stencil.jl") works, but then include("src/Burgess2013.jl") gives a different error

WARNING: replacing module Burgess2013.
ERROR: LoadError: ArgumentError: Package Transducers not found in current path.
HannoSpreeuw commented 2 months ago

Okay, but that can be fixed easily:

import Pkg; Pkg.add("Transducers")
HannoSpreeuw commented 2 months ago

The first two of these commands

include("src/Burgess2013/Config.jl")
include("src/Burgess2013/CA.jl")
result = Iterators.take(CA.run(Reflected{2}, init, 3), 8)

succesfully import CA - the first one is needed prior to the second - but the last one still gives an error, albeit a different one:

ERROR: UndefVarError: `Reflected` not defined
HannoSpreeuw commented 2 months ago

using CarboKitten.Stencil: Reflected fixes this and result = Iterators.take(CA.run(Reflected{2}, init, 3), 8) brings us to a new error message:

ERROR: MethodError: no method matching run(::Type{Reflected{2}}, ::Matrix{Int64}, ::Int64)

Closest candidates are:
  run(::Base.AbstractCmd, ::Any...; wait)
   @ Base process.jl:477

Stacktrace:
 [1] top-level scope
   @ REPL[15]:1
HannoSpreeuw commented 2 months ago

Okay, this works:

using CarboKitten.Stencil: Reflected
using CarboKitten.Burgess2013
init = rand(0:3, 50, 50)
result = Iterators.take(run_ca(Reflected{2}, MODEL1, init, 3), 8)
using Plots
plot((heatmap(r, colorbar=:none) for r in result)..., layout=(2, 4))