Skip to content

Can't run examples #254

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

Closed
navidcy opened this issue May 30, 2019 · 3 comments · Fixed by #257
Closed

Can't run examples #254

navidcy opened this issue May 30, 2019 · 3 comments · Fixed by #257
Labels
bug 🐞 Even a perfect program still has bugs

Comments

@navidcy
Copy link
Member

navidcy commented May 30, 2019

Am I doing something wrong?

navid:Oceananigans.jl/ (master) $ julia --project                                                                                                [19:00:13]
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.0 (2019-01-21)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |

julia> include("examples/internal_wave.jl")
ERROR: LoadError: could not open file /Users/navid/Research/Oceananigans.jl/examples/utils.jl
...

I guess the problem is the include("utils.jl") line found in all example .jl scripts. Is this supposed to be src/utils.jl?

@ali-ramadhan
Copy link
Member

Ah woops, sorry! Embarrassing mistake on my part. I cleaned up the examples/ directory recently and accidently moved examples/utils.jl to sandbox/utils.jl.

Thanks for posting this!

Should be fixed now (#255).

@ali-ramadhan ali-ramadhan added the bug 🐞 Even a perfect program still has bugs label May 30, 2019
@navidcy
Copy link
Member Author

navidcy commented May 30, 2019

Now I get this...

julia> include("internal_wave.jl")
[ Info: Recompiling stale cache file /Users/navid/.julia/compiled/v1.1/Plots/ld3vC.ji for Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
σ / f = 1.0456506175619953
ERROR: LoadError: DimensionMismatch("array could not be broadcast to match destination")
Stacktrace:
 [1] check_broadcast_shape at ./broadcast.jl:456 [inlined]
 [2] check_broadcast_axes at ./broadcast.jl:459 [inlined]
 [3] check_broadcast_axes at ./broadcast.jl:462 [inlined]
 [4] instantiate at ./broadcast.jl:258 [inlined]
 [5] materialize!(::OffsetArrays.OffsetArray{Float64,3,Array{Float64,3}}, ::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{3},Nothing,typeof(u₀),Tuple{Array{Float64,3},Array{Float64,3},Array{Float64,3}}}) at ./broadcast.jl:756
 [6] #set_ic!#3(::Function, ::Function, ::Function, ::Function, ::Function, ::Function, ::Model{CPU,RegularCartesianGrid{Float64,StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}},Oceananigans.TurbulenceClosures.ConstantAnisotropicDiffusivity{Float64},Float64}) at /Users/navid/Research/Oceananigans.jl/examples/utils.jl:17
 [7] (::getfield(Main, Symbol("#kw##set_ic!")))(::NamedTuple{(:u, :v, :w, :T),Tuple{typeof(u₀),typeof(v₀),typeof(w₀),typeof(T₀)}}, ::typeof(set_ic!), ::Model{CPU,RegularCartesianGrid{Float64,StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}},Oceananigans.TurbulenceClosures.ConstantAnisotropicDiffusivity{Float64},Float64}) at ./none:0
 [8] top-level scope at none:0
 [9] include at ./boot.jl:326 [inlined]
 [10] include_relative(::Module, ::String) at ./loading.jl:1038
 [11] include(::Module, ::String) at ./sysimg.jl:29
 [12] include(::String) at ./client.jl:403
 [13] top-level scope at none:0
in expression starting at /Users/navid/Research/Oceananigans.jl/examples/internal_wave.jl:110

@ali-ramadhan
Copy link
Member

Ah I think we forgot to update the example when we merged in the halo regions feature yesterday...

Should be able to fix this in a few minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Even a perfect program still has bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants