ProjectTorreyPines / SOLPS2ctrl.jl

Synthetic diagnostic workflow manager for use with SOLPS models
Apache License 2.0
2 stars 0 forks source link

Tests failing on `dev` #19

Closed eldond closed 1 year ago

eldond commented 1 year ago
julia> include("test/runtests.jl")
[ Info: Precompiling SD4SOLPS [d8db6f1b-e564-4c04-bba3-ef399f78c070]
Test Summary:         | Pass  Total  Time
lightweight_utilities |    4      4  2.9s
Test Summary: | Pass  Total  Time
actuator      |    2      2  5.2s
/home/eldond/.julia/dev/SD4SOLPS/src/../sample/ITER_Lore_2296_00000/baserun/b2fgmtry
/home/eldond/.julia/dev/SD4SOLPS/src/../sample/ITER_Lore_2296_00000/extended_output/b2time.nc
/home/eldond/.julia/dev/SD4SOLPS/src/../sample/ITER_Lore_2296_00000/run_restart/b2mn.dat
/home/eldond/.julia/dev/SOLPS2IMAS/src/../samples/gridspacedesc.yml
/home/eldond/.julia/dev/SD4SOLPS/src/../sample/ITER_Lore_2296_00000/EQDSK/Baseline2008-li0.70.x4.mod2.eqdsk
from_subset not represented in the property yet
core_profile_extension: Error During Test at /home/eldond/.julia/dev/SD4SOLPS/test/runtests.jl:120
  Got exception outside of a @test
  type Nothing has no field grid_index
  Stacktrace:
    [1] getproperty(x::Nothing, f::Symbol)
      @ Base ./Base.jl:37
    [2] project_prop_on_subset!(prop::Vector{OMAS.edge_profiles__ggd___electrons__density}, from_subset::OMAS.edge_profiles__grid_ggd___grid_subset, to_subset::OMAS.edge_profiles__grid_ggd___grid_subset, space::OMAS.edge_profiles__grid_ggd___space)
      @ GGDUtils ~/.julia/dev/GGDUtils/src/GGDUtils.jl:140
    [3] fill_in_extrapolated_core_profile!(dd::OMAS.dd, quantity_name::String; method::String, eq_time_idx::Int64, eq_profiles_2d_idx::Int64, grid_ggd_idx::Int64, space_idx::Int64)
      @ SD4SOLPS ~/.julia/dev/SD4SOLPS/src/supersize_profile.jl:151
    [4] fill_in_extrapolated_core_profile!
      @ ~/.julia/dev/SD4SOLPS/src/supersize_profile.jl:103 [inlined]
    [5] macro expansion
      @ ~/.julia/dev/SD4SOLPS/test/runtests.jl:158 [inlined]
    [6] macro expansion
      @ ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
    [7] top-level scope
      @ ~/.julia/dev/SD4SOLPS/test/runtests.jl:122
    [8] include(fname::String)
      @ Base.MainInclude ./client.jl:478
    [9] top-level scope
      @ REPL[3]:1
   [10] eval
      @ ./boot.jl:370 [inlined]
   [11] eval_user_input(ast::Any, backend::REPL.REPLBackend, mod::Module)
      @ REPL ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:153
   [12] repl_backend_loop(backend::REPL.REPLBackend, get_module::Function)
      @ REPL ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:249
   [13] start_repl_backend(backend::REPL.REPLBackend, consumer::Any; get_module::Function)
      @ REPL ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:234
   [14] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool, backend::Any)
      @ REPL ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:379
   [15] run_repl(repl::REPL.AbstractREPL, consumer::Any)
      @ REPL ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/REPL/src/REPL.jl:365
   [16] (::Base.var"#1017#1019"{Bool, Bool, Bool})(REPL::Module)
      @ Base ./client.jl:421
   [17] #invokelatest#2
      @ ./essentials.jl:819 [inlined]
   [18] invokelatest
      @ ./essentials.jl:816 [inlined]
   [19] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
      @ Base ./client.jl:405
   [20] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:322
   [21] _start()
      @ Base ./client.jl:522
Test Summary:          | Pass  Error  Total   Time
core_profile_extension |    6      1      7  16.4s
ERROR: LoadError: Some tests did not pass: 6 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /home/eldond/.julia/dev/SD4SOLPS/test/runtests.jl:120

julia> 

GGDUtils on dev at dea75179f168c1a75a6265d14c18967a0c83e1d5 SD4SOLPS on dev at 31dafe5936b038d372ba2c3e36b8163cc5db7c8b

anchal-physics commented 1 year ago

Most probably this is because your SOLPS2IMAS package is out of date locally. I remember seeing an issue like this before. For me it got fixed after https://github.com/ProjectTorreyPines/SOLPS2IMAS.jl/commit/4ca3759c8c10d43b385c7506d837a27dbd0d16a7

Solution

Please pull SOLPS2IMAS dev branch. If the problem persists, try doing following:

cd SD4SOLPS.jl   # Your SD4SOLPS.jl repo path
julia --project=./
julia>]
(SD4SOLPS) pkg > rm SOLPS2IMAS.jl
(SD4SOLPS) pkg > add "git@github.com:ProjectTorreyPines/SOLPS2IMAS.jl.git"#dev
(SD4SOLPS) pkg > instantiate

Then try running the test again as:

cd SD4SOLPS.jl   # Your SD4SOLPS.jl repo path
julia --project=./ test/runtests.jl

My method of using local packages as dev

I can confirm that all tests are passing on current dev branch on my machine where latest dev branches have been pulled. One other way of keeping your local project manifest up to date with changing dependencies is to add the packages using dev with local addressing. For example, I have following tree structure:

(base) gupta@F-CJXNMY7L7 ProjectTorreyPines % tree -L 1  
.
├── FUSEDivertor.jl
├── GGDUtils.jl
├── OMAS.jl
├── SD4SOLPS.jl
├── SOLPS2IMAS.jl
├── SOLPSTestSamples
├── Scratch
└── SynthDiag.jl

Then for ensuring that local packages with latest updates are used, I add them as:

cd SD4SOLPS.jl
julia --project=./
julia>]
(SD4SOLPS) pkg > dev ../OMAS.jl
(SD4SOLPS) pkg > dev ../SOLPS2IMAS.jl
(SD4SOLPS) pkg > dev ../GGDUtils.jl

You might have to remove some of these in order to add them again with dev tag. This might not be the best way to do this, but it has been working out fine with me. Note that the hash in Project.toml does not change even when we use local packages. Once we release the packages in future, people should be able to use Project.toml directly.

Let me know if you still face this error.

eldond commented 1 year ago

Thanks. It was out of date dependencies. I'm going to try using mr to avoid this next time.