From 059d335700af1cddab0f4a69517b469a6074ec28 Mon Sep 17 00:00:00 2001 From: Carlos Castillo Passi Date: Sun, 14 Jul 2024 00:27:53 -0400 Subject: [PATCH] Cleaned how pkg versions were used --- KomaMRIBase/Project.toml | 4 +--- KomaMRIBase/src/KomaMRIBase.jl | 6 ------ KomaMRICore/Project.toml | 6 ++---- KomaMRICore/src/KomaMRICore.jl | 4 ---- KomaMRICore/src/rawdata/ISMRMRD.jl | 3 +-- KomaMRICore/src/simulation/SimulatorCore.jl | 2 +- KomaMRICore/test/Project.toml | 1 - KomaMRICore/test/initialize.jl | 5 +---- KomaMRIFiles/Project.toml | 4 +--- KomaMRIFiles/src/KomaMRIFiles.jl | 4 ---- KomaMRIFiles/src/Phantom/Phantom.jl | 4 ++-- KomaMRIPlots/Project.toml | 4 +--- KomaMRIPlots/src/KomaMRIPlots.jl | 6 ------ Project.toml | 4 +--- src/KomaMRI.jl | 4 ---- src/KomaUI.jl | 14 +++++++------- 16 files changed, 18 insertions(+), 57 deletions(-) diff --git a/KomaMRIBase/Project.toml b/KomaMRIBase/Project.toml index 572e06d08..712cfc092 100644 --- a/KomaMRIBase/Project.toml +++ b/KomaMRIBase/Project.toml @@ -8,7 +8,6 @@ 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] @@ -16,9 +15,8 @@ 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"] \ No newline at end of file +projects = ["test"] diff --git a/KomaMRIBase/src/KomaMRIBase.jl b/KomaMRIBase/src/KomaMRIBase.jl index 2e15501e3..9d01d89a4 100644 --- a/KomaMRIBase/src/KomaMRIBase.jl +++ b/KomaMRIBase/src/KomaMRIBase.jl @@ -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 diff --git a/KomaMRICore/Project.toml b/KomaMRICore/Project.toml index 5992b99fa..577c46f71 100644 --- a/KomaMRICore/Project.toml +++ b/KomaMRICore/Project.toml @@ -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" @@ -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"] diff --git a/KomaMRICore/src/KomaMRICore.jl b/KomaMRICore/src/KomaMRICore.jl index d55896fc6..b31938e7d 100644 --- a/KomaMRICore/src/KomaMRICore.jl +++ b/KomaMRICore/src/KomaMRICore.jl @@ -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 diff --git a/KomaMRICore/src/rawdata/ISMRMRD.jl b/KomaMRICore/src/rawdata/ISMRMRD.jl index 4951f5477..feab4a6c8 100644 --- a/KomaMRICore/src/rawdata/ISMRMRD.jl +++ b/KomaMRICore/src/rawdata/ISMRMRD.jl @@ -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) @@ -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 diff --git a/KomaMRICore/src/simulation/SimulatorCore.jl b/KomaMRICore/src/simulation/SimulatorCore.jl index fabb828d1..7405d207c 100644 --- a/KomaMRICore/src/simulation/SimulatorCore.jl +++ b/KomaMRICore/src/simulation/SimulatorCore.jl @@ -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!( diff --git a/KomaMRICore/test/Project.toml b/KomaMRICore/test/Project.toml index e625b4a9b..5b409218d 100644 --- a/KomaMRICore/test/Project.toml +++ b/KomaMRICore/test/Project.toml @@ -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" diff --git a/KomaMRICore/test/initialize.jl b/KomaMRICore/test/initialize.jl index 8a8ffc979..98f0255b2 100644 --- a/KomaMRICore/test/initialize.jl +++ b/KomaMRICore/test/initialize.jl @@ -1,4 +1,3 @@ -using Pkg using Suppressor const USE_GPU = if "AMDGPU" in ARGS @@ -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 \ No newline at end of file +end \ No newline at end of file diff --git a/KomaMRIFiles/Project.toml b/KomaMRIFiles/Project.toml index 6808481a5..30a360e8f 100644 --- a/KomaMRIFiles/Project.toml +++ b/KomaMRIFiles/Project.toml @@ -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" @@ -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"] \ No newline at end of file +projects = ["test"] diff --git a/KomaMRIFiles/src/KomaMRIFiles.jl b/KomaMRIFiles/src/KomaMRIFiles.jl index 259639a62..cbefe4c0f 100644 --- a/KomaMRIFiles/src/KomaMRIFiles.jl +++ b/KomaMRIFiles/src/KomaMRIFiles.jl @@ -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 diff --git a/KomaMRIFiles/src/Phantom/Phantom.jl b/KomaMRIFiles/src/Phantom/Phantom.jl index 8409d792f..a5ebdf2cd 100644 --- a/KomaMRIFiles/src/Phantom/Phantom.jl +++ b/KomaMRIFiles/src/Phantom/Phantom.jl @@ -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), ".")) @@ -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) diff --git a/KomaMRIPlots/Project.toml b/KomaMRIPlots/Project.toml index bbc676894..ff8bdccee 100644 --- a/KomaMRIPlots/Project.toml +++ b/KomaMRIPlots/Project.toml @@ -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" @@ -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" @@ -33,4 +31,4 @@ julia = "1.9" PlutoPlotly = "8e989ff0-3d88-8e9f-f020-2b208a939ff0" [workspace] -projects = ["test"] \ No newline at end of file +projects = ["test"] diff --git a/KomaMRIPlots/src/KomaMRIPlots.jl b/KomaMRIPlots/src/KomaMRIPlots.jl index 8594482e9..ad46a4c24 100644 --- a/KomaMRIPlots/src/KomaMRIPlots.jl +++ b/KomaMRIPlots/src/KomaMRIPlots.jl @@ -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 diff --git a/Project.toml b/Project.toml index eef141ad8..bfb933857 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "KomaMRI" uuid = "6a340f8b-2cdf-4c04-99be-4953d9b66d0a" -version = "0.9.0-DEV" authors = ["Carlos Castillo Passi "] +version = "0.9.0-DEV" [deps] AssetRegistry = "bf4720bc-e11a-5d0c-854e-bdca1663c893" @@ -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] @@ -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" diff --git a/src/KomaMRI.jl b/src/KomaMRI.jl index b4412892e..4ffc87dc4 100644 --- a/src/KomaMRI.jl +++ b/src/KomaMRI.jl @@ -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 diff --git a/src/KomaUI.jl b/src/KomaUI.jl index 3fa163cc0..9c31463b1 100644 --- a/src/KomaUI.jl +++ b/src/KomaUI.jl @@ -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"+