From 30ad7095881341acc9244f5540cc01800590d0cd Mon Sep 17 00:00:00 2001 From: Uwe Hernandez Acosta Date: Wed, 4 Dec 2024 12:50:11 +0100 Subject: [PATCH] removed QEDbase namespace usage (#91) Co-authored-by: Uwe Hernandez Acosta --- src/coordinate_map/cached.jl | 21 +++++++------------ src/coordinate_map/map.jl | 19 +++++++---------- .../in_channel/two_body/general.jl | 2 +- test/coordinates.jl | 2 +- .../test_phase_space_layout.jl | 4 ++-- 5 files changed, 19 insertions(+), 29 deletions(-) diff --git a/src/coordinate_map/cached.jl b/src/coordinate_map/cached.jl index 006bbca..0b5242c 100644 --- a/src/coordinate_map/cached.jl +++ b/src/coordinate_map/cached.jl @@ -66,10 +66,7 @@ out_coord_map(out_coords) """ struct CoordinateMapCached{ - P<:AbstractProcessDefinition, - M<:AbstractModelDefinition, - PSL<:QEDbase.AbstractPhaseSpaceLayout, - TM, + P<:AbstractProcessDefinition,M<:AbstractModelDefinition,PSL<:AbstractPhaseSpaceLayout,TM } <: AbstractCoordinateMap proc::P model::M @@ -80,38 +77,36 @@ end function CoordinateMapCached( proc::AbstractProcessDefinition, model::AbstractModelDefinition, - psl::QEDbase.AbstractInPhaseSpaceLayout, + psl::AbstractInPhaseSpaceLayout, in_coords::NTuple{N,T}, ) where {N,T<:Real} - in_moms = QEDbase.build_momenta(proc, model, psl, in_coords) + in_moms = build_momenta(proc, model, psl, in_coords) return CoordinateMapCached(proc, model, psl, in_moms) end function CoordinateMapCached( proc::AbstractProcessDefinition, model::AbstractModelDefinition, - psl::QEDbase.AbstractOutPhaseSpaceLayout, + psl::AbstractOutPhaseSpaceLayout, in_coords::NTuple{N,T}, ) where {N,T<:Real} - in_moms = QEDbase.build_momenta( - proc, model, QEDbase.in_phase_space_layout(psl), in_coords - ) + in_moms = build_momenta(proc, model, in_phase_space_layout(psl), in_coords) return CoordinateMapCached(proc, model, psl, in_moms) end # make the transform callable: for in_psl maps return the cached @inline function ( coord_map::CoordinateMapCached{P,M,PSL} -)() where {P,M,PSL<:QEDbase.AbstractInPhaseSpaceLayout} +)() where {P,M,PSL<:AbstractInPhaseSpaceLayout} return getfield(coord_map, :in_moms) end # make the transform callable: for out_psl maps @inline function (coord_map::CoordinateMapCached{P,M,PSL})( out_coords::Tuple -) where {P,M,PSL<:QEDbase.AbstractOutPhaseSpaceLayout} +) where {P,M,PSL<:AbstractOutPhaseSpaceLayout} in_moms = coord_map.in_moms - return QEDbase.build_momenta( + return build_momenta( coord_map.proc, coord_map.model, in_moms, coord_map.psl, out_coords ) end diff --git a/src/coordinate_map/map.jl b/src/coordinate_map/map.jl index 190ec5d..9de26b1 100644 --- a/src/coordinate_map/map.jl +++ b/src/coordinate_map/map.jl @@ -66,7 +66,7 @@ coord_map(in_coords, out_coords) and momentum conservation for the process. """ -struct CoordinateMap{P,M,PSL<:QEDbase.AbstractPhaseSpaceLayout} <: AbstractCoordinateMap +struct CoordinateMap{P,M,PSL<:AbstractPhaseSpaceLayout} <: AbstractCoordinateMap proc::P model::M psl::PSL @@ -75,22 +75,17 @@ end # make the transform callable @inline function (coord_map::CoordinateMap{P,M,PSL})( in_coords::Tuple -) where {P,M,PSL<:QEDbase.AbstractInPhaseSpaceLayout} - return QEDbase.build_momenta(coord_map.proc, coord_map.model, coord_map.psl, in_coords) +) where {P,M,PSL<:AbstractInPhaseSpaceLayout} + return build_momenta(coord_map.proc, coord_map.model, coord_map.psl, in_coords) end # make the transform callable @inline function (coord_map::CoordinateMap{P,M,PSL})( in_coords::Tuple, out_coords::Tuple -) where {P,M,PSL<:QEDbase.AbstractOutPhaseSpaceLayout} - in_moms = QEDbase.build_momenta( - coord_map.proc, - coord_map.model, - QEDbase.in_phase_space_layout(coord_map.psl), - in_coords, +) where {P,M,PSL<:AbstractOutPhaseSpaceLayout} + in_moms = build_momenta( + coord_map.proc, coord_map.model, in_phase_space_layout(coord_map.psl), in_coords ) return in_moms, - QEDbase.build_momenta( - coord_map.proc, coord_map.model, in_moms, coord_map.psl, out_coords - ) + build_momenta(coord_map.proc, coord_map.model, in_moms, coord_map.psl, out_coords) end diff --git a/src/phase_space_layouts/in_channel/two_body/general.jl b/src/phase_space_layouts/in_channel/two_body/general.jl index 793eead..8264007 100644 --- a/src/phase_space_layouts/in_channel/two_body/general.jl +++ b/src/phase_space_layouts/in_channel/two_body/general.jl @@ -22,4 +22,4 @@ processes can be modeled flexibly and accurately within phase space calculations - [`AbstractTwoBodyRestSystem`](@ref): A subtype representing two-body systems where one particle is at rest. """ -abstract type AbstractTwoBodyInPhaseSpaceLayout <: QEDbase.AbstractInPhaseSpaceLayout end +abstract type AbstractTwoBodyInPhaseSpaceLayout <: AbstractInPhaseSpaceLayout end diff --git a/test/coordinates.jl b/test/coordinates.jl index 3cb21ae..519afb2 100644 --- a/test/coordinates.jl +++ b/test/coordinates.jl @@ -62,7 +62,7 @@ end @testset "utility" begin @test coordinate_names(test_coord_set) == COORD_NAMES - @test QEDbase.phase_space_dimension(test_coord_set) == DIM + @test phase_space_dimension(test_coord_set) == DIM end @testset "error handling" begin diff --git a/test/test_implementation/test_phase_space_layout.jl b/test/test_implementation/test_phase_space_layout.jl index d3ea100..ca187b5 100644 --- a/test/test_implementation/test_phase_space_layout.jl +++ b/test/test_implementation/test_phase_space_layout.jl @@ -1,7 +1,7 @@ ### Trivial phase-space layouts # maps all components onto four momenta -struct TrivialInPSL <: QEDbase.AbstractInPhaseSpaceLayout end +struct TrivialInPSL <: AbstractInPhaseSpaceLayout end @inline QEDbase.phase_space_dimension( proc::AbstractProcessDefinition, ::AbstractModelDefinition, ::TrivialInPSL @@ -14,7 +14,7 @@ struct TrivialInPSL <: QEDbase.AbstractInPhaseSpaceLayout end end # maps componets of N-1 particles onto four-momenta and uses energy-momentum conservation -struct TrivialOutPSL <: QEDbase.AbstractOutPhaseSpaceLayout{TrivialInPSL} +struct TrivialOutPSL <: AbstractOutPhaseSpaceLayout{TrivialInPSL} in_psl::TrivialInPSL end