Skip to content

Commit

Permalink
Fix doc string
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonReinhard committed Jun 21, 2024
1 parent 552995c commit b765a24
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 24 deletions.
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -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"
11 changes: 10 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -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],
Expand Down
4 changes: 2 additions & 2 deletions src/phase_spaces/create.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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).
Expand Down
36 changes: 19 additions & 17 deletions src/phase_spaces/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
```
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
"""
Expand Down
9 changes: 5 additions & 4 deletions src/phase_spaces/utility.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
"""
Expand Down

0 comments on commit b765a24

Please sign in to comment.