From b765a244af0020191134b4a4b538233d7c27b161 Mon Sep 17 00:00:00 2001 From: Anton Reinhard Date: Fri, 21 Jun 2024 12:29:20 +0200 Subject: [PATCH] Fix doc string --- docs/Project.toml | 2 ++ docs/make.jl | 11 ++++++++++- src/phase_spaces/create.jl | 4 ++-- src/phase_spaces/types.jl | 36 +++++++++++++++++++----------------- src/phase_spaces/utility.jl | 9 +++++---- 5 files changed, 38 insertions(+), 24 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index 2292a04..5ba0196 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,3 +1,5 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +QEDbase = "10e22c08-3ccb-4172-bfcf-7d7aa3d04d93" QEDcore = "35dc0263-cb5f-4c33-a114-1d7f54ab753e" +QEDprocesses = "46de9c38-1bb3-4547-a1ec-da24d767fdad" diff --git a/docs/make.jl b/docs/make.jl index 29867cd..979a5b0 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,7 +1,16 @@ +using Pkg + +# targeting the correct source code +# this asumes the make.jl script is located in QEDcore.jl/docs +project_path = Base.Filesystem.joinpath(Base.Filesystem.dirname(Base.source_path()), "..") +Pkg.develop(; path=project_path) + +Pkg.add(; url="https://github.com/QEDjl-project/QEDbase.jl/", rev="dev") + using QEDcore using Documenter -DocMeta.setdocmeta!(QEDcore, :DocTestSetup, :(using QEDcore); recursive=true) +# DocMeta.setdocmeta!(QEDcore, :DocTestSetup, :(using QEDcore); recursive=true) makedocs(; modules=[QEDcore], diff --git a/src/phase_spaces/create.jl b/src/phase_spaces/create.jl index 3bd69ad..5f8f701 100644 --- a/src/phase_spaces/create.jl +++ b/src/phase_spaces/create.jl @@ -121,7 +121,7 @@ end out_coords::NTuple{M,Real}, ) -Construct a [`PhaseSpacePoint`](@ref) from given coordinates by using the [`_generate_momenta`](@ref) interface. +Construct a [`PhaseSpacePoint`](@ref) from given coordinates by using the `QEDbase._generate_momenta` interface. """ function PhaseSpacePoint( proc::QEDbase.AbstractProcessDefinition, @@ -142,7 +142,7 @@ end in_coords::NTuple{N,Real}, ) -Construct a [`PhaseSpacePoint`](@ref) from given coordinates by using the [`_generate_momenta`](@ref) interface. The result will be `<: InPhaseSpacePoint` but **not** `<: OutPhaseSpacePoint`. +Construct a [`PhaseSpacePoint`](@ref) from given coordinates by using the `QEDbase._generate_momenta` interface. The result will be `<: InPhaseSpacePoint` but **not** `<: OutPhaseSpacePoint`. !!! note A similar function for [`OutPhaseSpacePoint`](@ref) does not exist from coordinates, only a full [`PhaseSpacePoint`](@ref). diff --git a/src/phase_spaces/types.jl b/src/phase_spaces/types.jl index 43d2178..9897064 100644 --- a/src/phase_spaces/types.jl +++ b/src/phase_spaces/types.jl @@ -39,16 +39,17 @@ Representation of a particle with a state. It has four fields: - `species::QEDbase.AbstractParticleType`: The species of the particle, `Electron()`, `Positron()` etc. - `mom::QEDbase.AbstractFourMomentum`: The momentum of the particle. -Overloads for [`is_fermion`](@ref), [`is_boson`](@ref), [`is_particle`](@ref), [`is_anti_particle`](@ref), [`is_incoming`](@ref), [`is_outgoing`](@ref), [`mass`](@ref), and [`charge`](@ref) are provided, delegating the call to the correct field and thus implementing the [`QEDbase.AbstractParticle`](@ref) interface. +Overloads for `QEDbase.is_fermion`, `QEDbase.is_boson`, `QEDbase.is_particle`, `QEDbase.is_anti_particle`, `QEDbase.is_incoming`, `QEDbase.is_outgoing`, `QEDbase.mass`, and `QEDbase.charge` are provided, delegating the call to the correct field and thus implementing the `QEDbase.AbstractParticle` interface. -```jldoctest -julia> import QEDbase; using QEDprocesses +TODO: Turn this back into a `jldoctest` once refactoring is done. +```Julia +julia> using QEDcore; using QEDbase -julia> ParticleStateful(QEDbase.Incoming(), Electron(), SFourMomentum(1, 0, 0, 0)) +julia> ParticleStateful(Incoming(), Electron(), SFourMomentum(1, 0, 0, 0)) ParticleStateful: incoming electron momentum: [1.0, 0.0, 0.0, 0.0] -julia> ParticleStateful(QEDbase.Outgoing(), Photon(), SFourMomentum(1, 0, 0, 0)) +julia> ParticleStateful(Outgoing(), Photon(), SFourMomentum(1, 0, 0, 0)) ParticleStateful: outgoing photon momentum: [1.0, 0.0, 0.0, 0.0] ``` @@ -76,24 +77,25 @@ end """ PhaseSpacePoint -Representation of a point in the phase space of a process. Contains the process ([`QEDbase.AbstractProcessDefinition`](@ref)), the model ([`QEDbase.AbstractModelDefinition`](@ref)), the phase space definition ([`QEDbase.AbstractPhasespaceDefinition`]), and stateful incoming and outgoing particles ([`ParticleStateful`](@ref)). +Representation of a point in the phase space of a process. Contains the process (`QEDbase.AbstractProcessDefinition`), the model (`QEDbase.AbstractModelDefinition`), the phase space definition (`QEDbase.AbstractPhasespaceDefinition`), and stateful incoming and outgoing particles ([`ParticleStateful`](@ref)). The legality of the combination of the given process and the incoming and outgoing particles is checked on construction. If the numbers of particles mismatch, the types of particles mismatch (note that order is important), or incoming particles have an `QEDbase.Outgoing` direction, an error is thrown. -```jldoctest -julia> using QEDprocesses; using QEDbase; using QEDcore +TODO: Turn this back into a `jldoctest` once refactoring is done. +```Julia +julia> using QEDcore; using QEDbase; using QEDprocesses julia> PhaseSpacePoint( - Compton(), - PerturbativeQED(), - PhasespaceDefinition(SphericalCoordinateSystem(), ElectronRestFrame()), + Compton(), + PerturbativeQED(), + PhasespaceDefinition(SphericalCoordinateSystem(), ElectronRestFrame()), ( - ParticleStateful(QEDbase.Incoming(), Electron(), SFourMomentum(1, 0, 0, 0)), - ParticleStateful(QEDbase.Incoming(), Photon(), SFourMomentum(1, 0, 0, 0)) - ), + ParticleStateful(Incoming(), Electron(), SFourMomentum(1, 0, 0, 0)), + ParticleStateful(Incoming(), Photon(), SFourMomentum(1, 0, 0, 0)) + ), ( - ParticleStateful(QEDbase.Outgoing(), Electron(), SFourMomentum(1, 0, 0, 0)), - ParticleStateful(QEDbase.Outgoing(), Photon(), SFourMomentum(1, 0, 0, 0)) + ParticleStateful(Outgoing(), Electron(), SFourMomentum(1, 0, 0, 0)), + ParticleStateful(Outgoing(), Photon(), SFourMomentum(1, 0, 0, 0)) ) ) PhaseSpacePoint: @@ -162,7 +164,7 @@ end """ InPhaseSpacePoint -A partial type specialization on [`PhaseSpacePoint`](@ref) which can be used for dispatch in functions requiring only the in channel of the phase space to exist, for example implementations of [`_incident_flux`](@ref). No restrictions are imposed on the out-channel, which may or may not exist. +A partial type specialization on [`PhaseSpacePoint`](@ref) which can be used for dispatch in functions requiring only the in channel of the phase space to exist, for example implementations of `QEDbase._incident_flux`. No restrictions are imposed on the out-channel, which may or may not exist. See also: [`OutPhaseSpacePoint`](@ref) """ diff --git a/src/phase_spaces/utility.jl b/src/phase_spaces/utility.jl index 8d0eea5..02fb4d3 100644 --- a/src/phase_spaces/utility.jl +++ b/src/phase_spaces/utility.jl @@ -109,15 +109,16 @@ end Returns the element type of the [`PhaseSpacePoint`](@ref) object or type, e.g. `SFourMomentum`. -```jldoctest -julia> using QEDprocesses; import QEDbase; +TODO: Turn this back into a `jldoctest` once refactoring is done. +```Julia +julia> using QEDcore; using QEDprocesses julia> psp = PhaseSpacePoint(Compton(), PerturbativeQED(), PhasespaceDefinition(SphericalCoordinateSystem(), ElectronRestFrame()), Tuple(rand(SFourMomentum) for _ in 1:2), Tuple(rand(SFourMomentum) for _ in 1:2)); -julia> QEDprocesses._momentum_type(psp) +julia> _momentum_type(psp) SFourMomentum -julia> QEDprocesses._momentum_type(typeof(psp)) +julia> _momentum_type(typeof(psp)) SFourMomentum ``` """