Skip to content

Commit

Permalink
Merge pull request #646 from open-AIMS/julia-v1.10-updates
Browse files Browse the repository at this point in the history
Changes to make ADRIA precompilable under Julia v1.10
  • Loading branch information
ConnectedSystems authored Jan 10, 2024
2 parents 53c44dd + 2673224 commit 5f7db89
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
7 changes: 5 additions & 2 deletions ext/AvizExt/AvizExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ function ADRIA.viz.explore(rs::ResultSet)

# Trigger update only after some time since last interaction
# TODO: Add update notification (spinner animation or something...)
up_timer = Timer(x -> x, 0.25)
# up_timer = Timer(x -> x, 0.25)
onany(time_slider.interval, tac_slider.interval,
[t.active for t in t_toggles]...,
[sld.interval for sld in interv_sliders]...) do time_val, tac_val, rcp45, rcp60, rcp85, c_tog, u_tog, g_tog, intervs... # i1_val, i2_val, i3_val, i4_val, i5_val, i6_val, i7_val, i8_val, i9_val, i10_val, i11_val, i12_val
Expand All @@ -534,7 +534,9 @@ function ADRIA.viz.explore(rs::ResultSet)
tac_bot_val[] = tac_val[1]
tac_top_val[] = tac_val[2]

close(up_timer)
if @isdefined up_timer
close(up_timer)
end
up_timer = Timer(x -> update_disp(time_val, tac_val, rcp45, rcp60, rcp85, c_tog, u_tog, g_tog, intervs...), 2)
end

Expand All @@ -543,6 +545,7 @@ function ADRIA.viz.explore(rs::ResultSet)
# DataInspector()

wait(gl_screen)
# close(up_timer)
end
function ADRIA.viz.explore(rs_path::String)
return ADRIA.viz.explore(load_results(rs_path))
Expand Down
58 changes: 29 additions & 29 deletions src/ADRIA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,34 +167,34 @@ if ccall(:jl_generating_output, Cint, ()) == 1
end


@setup_workload begin
# Putting some things in `setup` can reduce the size of the
# precompile file and potentially make loading faster.
# ADRIA_DIR = pkgdir(ADRIA)
# EXAMPLE_DOMAIN_PATH = joinpath(ADRIA_DIR, "examples", "Example_domain")

@compile_workload begin

# Force precompiling of code that handles distributed infrastructure
addprocs(1)
@everywhere 1 + 1

# Compile progress bar
# f() = begin
# @showprogress 1 for _ in 1:10
# end
# end
# b = redirect_stdout(f, devnull)

# dom = ADRIA.load_domain(EXAMPLE_DOMAIN_PATH, "45")
# ADRIA.sample(dom, 16)
# ADRIA.model_spec(dom)

# ENV["ADRIA_DEBUG"] = "false"
# p_df = ADRIA.param_table(dom)
# rs1 = ADRIA.run_scenario(dom, p_df[1, :])
# delete!(ENV, "ADRIA_DEBUG")
end
end
# @setup_workload begin
# # Putting some things in `setup` can reduce the size of the
# # precompile file and potentially make loading faster.
# # ADRIA_DIR = pkgdir(ADRIA)
# # EXAMPLE_DOMAIN_PATH = joinpath(ADRIA_DIR, "examples", "Example_domain")

# @compile_workload begin

# # Force precompiling of code that handles distributed infrastructure
# addprocs(1)
# @everywhere 1 + 1

# # Compile progress bar
# # f() = begin
# # @showprogress 1 for _ in 1:10
# # end
# # end
# # b = redirect_stdout(f, devnull)

# # dom = ADRIA.load_domain(EXAMPLE_DOMAIN_PATH, "45")
# # ADRIA.sample(dom, 16)
# # ADRIA.model_spec(dom)

# # ENV["ADRIA_DEBUG"] = "false"
# # p_df = ADRIA.param_table(dom)
# # rs1 = ADRIA.run_scenario(dom, p_df[1, :])
# # delete!(ENV, "ADRIA_DEBUG")
# end
# end

end

0 comments on commit 5f7db89

Please sign in to comment.