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

Fix CI tests for macoOS and ubuntu OS. #538

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
59f66e5
fix macos and ubuntu tests
Stockless Jan 27, 2025
c5117f0
add call to macro
Stockless Jan 27, 2025
e208255
try remove Kaleido_jll to fix macOS-latest test
Stockless Feb 3, 2025
c0ce80e
disable sandbox in window generation + Kaleido_jll step back
Stockless Feb 11, 2025
53f7d68
replace macro "Unsafe_Blink" with evaluation inside the function
Stockless Feb 17, 2025
22b4634
disable sandbox before window generation
Stockless Feb 17, 2025
761a0d2
import macro from module
Stockless Feb 18, 2025
479a79a
using Blink.Sockets instead of using Sockets + Correction of Kaleido_…
Stockless Feb 19, 2025
1e53218
Merge branch 'master' into master
cncastillo Feb 24, 2025
c7f4e95
insert macro modification in KomaUI.jl
Stockless Feb 25, 2025
a16cffa
Merge remote-tracking branch 'origin/master'
Stockless Feb 25, 2025
49bb77a
macos-13 -> macos-latest in CI test
Stockless Feb 25, 2025
6b54054
replace all "cmin" and "cmax" with "zmin" and "zmax" respectibly
Stockless Mar 4, 2025
fa74970
keep change "cmin -> zmin" just in interface.
Stockless Mar 5, 2025
772f64a
corrected definition of cmin/cmax as zmin/zmax
Stockless Mar 5, 2025
15af96d
Merge pull request #546 from JuliaHealth/script_corrections
cncastillo Mar 6, 2025
2e2b22e
bump v0.9.0 to v0.9.1
Stockless Mar 6, 2025
065130a
Merge pull request #547 from JuliaHealth/script_corrections
cncastillo Mar 6, 2025
1b9b1b7
fix macos and ubuntu tests
Stockless Jan 27, 2025
54ad333
add call to macro
Stockless Jan 27, 2025
0deb76d
try remove Kaleido_jll to fix macOS-latest test
Stockless Feb 3, 2025
6d2095b
disable sandbox in window generation + Kaleido_jll step back
Stockless Feb 11, 2025
afc4c60
replace macro "Unsafe_Blink" with evaluation inside the function
Stockless Feb 17, 2025
fdbfba9
disable sandbox before window generation
Stockless Feb 17, 2025
eb5dc4a
import macro from module
Stockless Feb 18, 2025
d9eb469
using Blink.Sockets instead of using Sockets + Correction of Kaleido_…
Stockless Feb 19, 2025
5d44561
insert macro modification in KomaUI.jl
Stockless Feb 25, 2025
c4a32fb
macos-13 -> macos-latest in CI test
Stockless Feb 25, 2025
eba99ba
Merge remote-tracking branch 'origin/master'
Stockless Mar 12, 2025
cb9ba19
Update Kaleido_jll version 0.1.0 -> 0.2.1
Stockless Mar 18, 2025
c7119ec
test skip ci runtest@v1 and step back Kaleido_jll version 0.2.1 -> 0.1
Stockless Mar 19, 2025
83964f0
defining show window false in runtest and uncomment test
Stockless Mar 20, 2025
ffcfe0f
disable unsafe_blink macro and activate asyncronus functions with win…
Stockless Mar 20, 2025
a13e9e7
check if debug is eneabled
Stockless Mar 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion KomaMRIBase/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KomaMRIBase"
uuid = "d0bc0b20-b151-4d03-b2a4-6ca51751cb9c"
authors = ["Carlos Castillo Passi <[email protected]>"]
version = "0.9.0"
version = "0.9.1"

[deps]
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
Expand Down
2 changes: 1 addition & 1 deletion KomaMRICore/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KomaMRICore"
uuid = "4baa4f4d-2ae9-40db-8331-a7d1080e3f4e"
authors = ["Carlos Castillo Passi <[email protected]>"]
version = "0.9.0"
version = "0.9.1"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
2 changes: 1 addition & 1 deletion KomaMRIFiles/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KomaMRIFiles"
uuid = "fcf631a6-1c7e-4e88-9e64-b8888386d9dc"
authors = ["Carlos Castillo Passi <[email protected]>"]
version = "0.9.0"
version = "0.9.1"

[deps]
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Expand Down
4 changes: 2 additions & 2 deletions KomaMRIPlots/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KomaMRIPlots"
uuid = "76db0263-63f3-4d26-bb9a-5dba378db904"
authors = ["Carlos Castillo Passi <[email protected]>"]
version = "0.9.0"
version = "0.9.1"

[deps]
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
Expand All @@ -20,7 +20,7 @@ KomaPlotsPlutoPlotlyExt = "PlutoPlotly"

[compat]
Interpolations = "0.13, 0.14, 0.15"
Kaleido_jll = "0.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you putting this here? The solution should be to remove the compat. This is already done in #530

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did remove Kaleido_jll to test if that was the reason why the CI test in macOS-latest wasn't running, but when you told me that this change shouldn't be included because it is from another PR, I did an stepback in this commit c0ce80e

Copy link
Member

@cncastillo cncastillo Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but now it says Kaleido_jll = "0.2.1" which is not the same as before Kaleido_jll = "0.1"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be careful is Kaleido_jll = "0.1" not Kaleido_jll = "0.1.0"

Kaleido_jll = "0.1.0"
KomaMRIBase = "0.9"
MAT = "0.10"
PlotlyJS = "0.18"
Expand Down
4 changes: 2 additions & 2 deletions KomaMRIPlots/src/ui/DisplayFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1110,8 +1110,8 @@ function plot_phantom_map(
unit = ""
colormap = "Greys"
end
cmin_key = get(kwargs, :cmin, factor * cmin_key)
cmax_key = get(kwargs, :cmax, factor * cmax_key)
cmin_key = get(kwargs, :zmin, factor * cmin_key)
cmax_key = get(kwargs, :zmax, factor * cmax_key)

t = process_times(obj.motion)
x, y, z = get_spin_coords(obj.motion, obj.x, obj.y, obj.z, t')
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KomaMRI"
uuid = "6a340f8b-2cdf-4c04-99be-4953d9b66d0a"
authors = ["Carlos Castillo Passi <[email protected]>"]
version = "0.9.0"
version = "0.9.1"

[deps]
AssetRegistry = "bf4720bc-e11a-5d0c-854e-bdca1663c893"
Expand Down
3 changes: 3 additions & 0 deletions src/KomaMRI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import KomaMRICore: update_blink_window_progress!

# GUI
using Blink, Interact, AssetRegistry
using Blink.Sockets: @ip_str
using MAT

# Reconstruction
Expand All @@ -20,6 +21,7 @@ using MRIReco
@reexport using MRIReco: reconstruction

#GUI

include("ui/ExportMATFunctions.jl")
include("ui/ExportUIFunctions.jl")
include("KomaUI.jl")
Expand All @@ -28,4 +30,5 @@ include("KomaUI.jl")
export KomaUI
export sys_ui, seq_ui, obj_ui, raw_ui, img_ui


end
24 changes: 22 additions & 2 deletions src/KomaUI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ obj_ui = Observable{Phantom{Float64}}(Phantom{Float64}(x=[0.0]))
raw_ui = Observable{RawAcquisitionData}(setup_raw())
img_ui = Observable{Array{ComplexF64}}([0.0im 0.; 0. 0.])

macro unsafe_blink()
Core.eval(@__MODULE__, quote
function Blink.AtomShell.init(; debug = false)
Blink.AtomShell.electron() # Check path exists
p, dp = Blink.AtomShell.port(), Blink.AtomShell.port()
debug && Blink.AtomShell.inspector(dp)
dbg = debug ? "--debug=$dp" : []
println(dbg)
proc = (debug ? Blink.AtomShell.run_rdr : Blink.AtomShell.run)(
`$(Blink.AtomShell.electron()) --no-sandbox $dbg $(Blink.AtomShell.mainjs) port $p`; wait=false)
conn = Blink.AtomShell.try_connect(ip"127.0.0.1", p)
shell = Blink.AtomShell.Electron(proc, conn)
Blink.AtomShell.initcbs(shell)
return shell
end
end)
return nothing # Avoid returning an unevaluated expression
end

"""
out = KomaUI(; kwargs...)

Expand All @@ -31,7 +50,7 @@ julia> KomaUI()
```
"""
function KomaUI(; darkmode=true, frame=true, phantom_mode="2D", sim=Dict{String,Any}(), rec=Dict{Symbol,Any}(), return_window=false, show_window=true, dev_tools=false)

# To avoid generating multiple observables
Observables.clear(seq_ui)
Observables.clear(obj_ui)
Expand All @@ -44,8 +63,8 @@ function KomaUI(; darkmode=true, frame=true, phantom_mode="2D", sim=Dict{String,
widgets_button_obj = button.(string.(fieldnames_obj))

# Setup the Blink window
@unsafe_blink
w, index = setup_blink_window(; darkmode, frame, dev_tools, show_window)

# Setup default simulation inputs (they have observables)
@sync begin
@async sys_ui[] = setup_scanner()
Expand Down Expand Up @@ -326,3 +345,4 @@ function update_blink_window_progress!(w::Window, block, Nblocks)
document.getElementById("simul_progress").setAttribute("aria-valuenow", progress))
return nothing
end

6 changes: 2 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ end
@testitem "KomaUI" tags=[:koma] begin

using Blink

# Opens UI
w = KomaUI(return_window=true)

# Opens KomaUI
w = KomaUI(return_window=true, show_window=false)
@testset "Open UI" begin
@test "index" == @js w document.getElementById("content").dataset.content
end
Expand Down
Loading