Skip to content

Commit

Permalink
Cleaned how pkg versions were used
Browse files Browse the repository at this point in the history
  • Loading branch information
cncastillo committed Jul 14, 2024
1 parent 2bf7fff commit 059d335
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 57 deletions.
4 changes: 1 addition & 3 deletions KomaMRIBase/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
MRIBase = "f7771a9a-6e57-4e71-863b-6e4b6a2f17df"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[compat]
Interpolations = "0.13, 0.14, 0.15"
MAT = "0.10"
MRIBase = "0.4"
Parameters = "0.12"
Pkg = "1.4"
Reexport = "1"
julia = "1.9"

[workspace]
projects = ["test"]
projects = ["test"]
6 changes: 0 additions & 6 deletions KomaMRIBase/src/KomaMRIBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,4 @@ export get_Mk, get_kspace, get_M0, get_M1, get_M2
include("sequences/PulseDesigner.jl")
export PulseDesigner

#Package version, KomaMRIBase.__VERSION__
using Pkg
__VERSION__ = VersionNumber(
Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))["version"]
)

end # module KomaMRIBase
6 changes: 2 additions & 4 deletions KomaMRICore/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
KomaMRIBase = "d0bc0b20-b151-4d03-b2a4-6ca51751cb9c"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
ThreadsX = "ac1d9e8a-700a-412c-b207-f0111f4b6c0d"
Expand All @@ -26,19 +25,18 @@ KomaMetalExt = "Metal"
KomaoneAPIExt = "oneAPI"

[compat]
Adapt = "3, 4"
AMDGPU = "0.9"
Adapt = "3, 4"
CUDA = "3, 4, 5"
Functors = "0.4"
KernelAbstractions = "0.9"
KomaMRIBase = "0.9"
Metal = "1"
oneAPI = "1"
Pkg = "1.4"
ProgressMeter = "1"
Reexport = "1"
ThreadsX = "0.1"
julia = "1.9"
oneAPI = "1"

[workspace]
projects = ["test"]
4 changes: 0 additions & 4 deletions KomaMRICore/src/KomaMRICore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,4 @@ export simulate, simulate_slice_profile
# Spinors
export Spinor, Rx, Ry, Rz, Q, Un

#Package version, KomaMRICore.__VERSION__
using Pkg
__VERSION__ = VersionNumber(Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))["version"])

end
3 changes: 1 addition & 2 deletions KomaMRICore/src/rawdata/ISMRMRD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ function signal_to_raw_data(
signal, seq;
phantom_name="Phantom", sys=Scanner(), sim_params=Dict{String,Any}(), ndims=2
)
version = string(VersionNumber(Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "..", "Project.toml"))["version"]))
#Number of samples and FOV
_, ktraj = get_kspace(seq) #kspace information
mink = minimum(ktraj, dims=1)
Expand Down Expand Up @@ -113,7 +112,7 @@ function signal_to_raw_data(
params = Dict(
#AcquisitionSystemInformation
"systemVendor" => "KomaMRI.jl", #String
"systemModel" => "v"*version, #String
"systemModel" => string(pkgversion(@__MODULE__)), #String
"systemFieldStrength_T" => sys.B0, #Float
"institutionName" => "Pontificia Universidad Catolica de Chile", #String
#subjectInformation
Expand Down
2 changes: 1 addition & 1 deletion KomaMRICore/src/simulation/SimulatorCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ function simulate(

# Simulation
@info "Running simulation in the $(backend isa KA.GPU ? "GPU ($gpu_name)" : "CPU with $(sim_params["Nthreads"]) thread(s)")" koma_version =
__VERSION__ sim_method = sim_params["sim_method"] spins = length(obj) time_points = length(
pkgversion(@__MODULE__) sim_method = sim_params["sim_method"] spins = length(obj) time_points = length(
seqd.t
) adc_points = Ndims[1]
@time timed_tuple = @timed run_sim_time_iter!(
Expand Down
1 change: 0 additions & 1 deletion KomaMRICore/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
KomaMRIBase = "d0bc0b20-b151-4d03-b2a4-6ca51751cb9c"
KomaMRICore = "4baa4f4d-2ae9-40db-8331-a7d1080e3f4e"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
Expand Down
5 changes: 1 addition & 4 deletions KomaMRICore/test/initialize.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Pkg
using Suppressor

const USE_GPU = if "AMDGPU" in ARGS
Expand All @@ -20,6 +19,4 @@ elseif "oneAPI" in ARGS
else
@info "Testing on the CPU with $(Threads.nthreads()) thread(s)" maxlog=1
false
end

using KomaMRICore
end
4 changes: 1 addition & 3 deletions KomaMRIFiles/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
KomaMRIBase = "d0bc0b20-b151-4d03-b2a4-6ca51751cb9c"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
MRIFiles = "5a6f062f-bf45-497d-b654-ad17aae2a530"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Scanf = "6ef1bc8b-493b-44e1-8d40-549aa65c4b41"

Expand All @@ -21,10 +20,9 @@ InteractiveUtils = "1"
KomaMRIBase = "0.9"
MAT = "0.10"
MRIFiles = "0.1, 0.2, 0.3"
Pkg = "1.4"
Reexport = "1"
Scanf = "0.5"
julia = "1.9"

[workspace]
projects = ["test"]
projects = ["test"]
4 changes: 0 additions & 4 deletions KomaMRIFiles/src/KomaMRIFiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ include("Phantom/Phantom.jl")
export read_seq # Pulseq
export read_phantom_jemris, read_phantom_MRiLab, read_phantom, write_phantom # Phantom

# Package version: KomaMRIFiles.__VERSION__
using Pkg
__VERSION__ = VersionNumber(Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))["version"])

end # module KomaMRIFiles
4 changes: 2 additions & 2 deletions KomaMRIFiles/src/Phantom/Phantom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function import_motion!(
for key in keys(types_group)
type_group = types_group[key]
type_str = split(key, "_")[2]
@assert type_str in last.(split.(string.(subtypes(SimpleMotionType)), ".")) "Simple Motion Type: $(type_str) has not been implemented in KomaMRIBase $(KomaMRIBase.__VERSION__)"
@assert type_str in last.(split.(string.(subtypes(SimpleMotionType)), ".")) "Simple Motion Type: $(type_str) has not been implemented in KomaMRIBase $(pkgversion(KomaMRIBase))"
for SMT in subtypes(SimpleMotionType)
args = []
if type_str == last(split(string(SMT), "."))
Expand Down Expand Up @@ -111,7 +111,7 @@ function write_phantom(
# Create HDF5 phantom file
fid = h5open(filename, "w")
# Root attributes
HDF5.attributes(fid)["Version"] = string(KomaMRIFiles.__VERSION__)
HDF5.attributes(fid)["Version"] = string(pkgversion(KomaMRIFiles))
HDF5.attributes(fid)["Name"] = obj.name
HDF5.attributes(fid)["Ns"] = length(obj.x)
dims = KomaMRIBase.get_dims(obj)
Expand Down
4 changes: 1 addition & 3 deletions KomaMRIPlots/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
Kaleido_jll = "f7e6163d-2fa5-5f23-b69c-1db539e41963"
KomaMRIBase = "d0bc0b20-b151-4d03-b2a4-6ca51751cb9c"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

Expand All @@ -23,7 +22,6 @@ Interpolations = "0.13, 0.14, 0.15"
Kaleido_jll = "0.1"
KomaMRIBase = "0.9"
MAT = "0.10"
Pkg = "1.4"
PlotlyJS = "0.18"
PlutoPlotly = "0.4"
Reexport = "1"
Expand All @@ -33,4 +31,4 @@ julia = "1.9"
PlutoPlotly = "8e989ff0-3d88-8e9f-f020-2b208a939ff0"

[workspace]
projects = ["test"]
projects = ["test"]
6 changes: 0 additions & 6 deletions KomaMRIPlots/src/KomaMRIPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,4 @@ export plot_seq,
plot_image,
plot_dict

#Package version, KomaMRIPlots.__VERSION__
using Pkg
__VERSION__ = VersionNumber(
Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))["version"]
)

end
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KomaMRI"
uuid = "6a340f8b-2cdf-4c04-99be-4953d9b66d0a"
version = "0.9.0-DEV"
authors = ["Carlos Castillo Passi <cncastillo@uc.cl>"]
version = "0.9.0-DEV"

[deps]
AssetRegistry = "bf4720bc-e11a-5d0c-854e-bdca1663c893"
Expand All @@ -13,7 +13,6 @@ KomaMRIFiles = "fcf631a6-1c7e-4e88-9e64-b8888386d9dc"
KomaMRIPlots = "76db0263-63f3-4d26-bb9a-5dba378db904"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
MRIReco = "bdf86e05-2d2b-5731-a332-f3fe1f9e047f"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[compat]
Expand All @@ -26,7 +25,6 @@ KomaMRIFiles = "0.9"
KomaMRIPlots = "0.9"
MAT = "0.10"
MRIReco = "0.6, 0.7, 0.8"
Pkg = "1.4"
Reexport = "1"
julia = "1.9"

Expand Down
4 changes: 0 additions & 4 deletions src/KomaMRI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,4 @@ include("KomaUI.jl")
export KomaUI
export sys_ui, seq_ui, obj_ui, raw_ui, img_ui

#Package version, KomaMRI.__VERSION__
using Pkg
__VERSION__ = VersionNumber(Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))["version"])

end
14 changes: 7 additions & 7 deletions src/KomaUI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,14 @@ function KomaUI(; darkmode=true, frame=true, phantom_mode="2D", sim=Dict{String,
on((img) -> view_ui!(img, w; type="absi", darkmode), img_ui)

# Update Koma versions to tooltip
version_ui = string(KomaMRI.__VERSION__)
version_core = string(KomaMRICore.__VERSION__)
version_io = string(KomaMRIFiles.__VERSION__)
version_plots = string(KomaMRIPlots.__VERSION__)
version_ui = pkgversion(@__MODULE__)
version_core = pkgversion(KomaMRICore)
version_io = pkgversion(KomaMRIFiles)
version_plots = pkgversion(KomaMRIPlots)
@js_ w (
@var version_ui = $(version_ui);
@var version_core = $(version_core);
@var version_io = $(version_io);
@var version_ui = $(version_ui);
@var version_core = $(version_core);
@var version_io = $(version_io);
@var version_plots = $(version_plots);
document.getElementById("Github").setAttribute("data-bs-original-title",
"KomaMRI.jl v"+version_ui+"\n"+
Expand Down

0 comments on commit 059d335

Please sign in to comment.