Skip to content

Commit

Permalink
Fix pretty printing in accordance with QEDprocesses.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonReinhard committed May 27, 2024
1 parent a394e86 commit b42d200
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/particles/particle_direction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ incoming
struct Incoming <: ParticleDirection end
is_incoming(::Incoming) = true
is_outgoing(::Incoming) = false
Base.show(io::IO, ::MIME"text/plain", ::Incoming) = print(io, "incoming")
Base.show(io::IO, ::Incoming) = print(io, "incoming")

"""
Outgoing <: ParticleDirection
Expand All @@ -52,4 +52,4 @@ outgoing
struct Outgoing <: ParticleDirection end
is_incoming(::Outgoing) = false
is_outgoing(::Outgoing) = true
Base.show(io::IO, ::MIME"text/plain", ::Outgoing) = print(io, "outgoing")
Base.show(io::IO, ::Outgoing) = print(io, "outgoing")
12 changes: 6 additions & 6 deletions src/particles/particle_spin_pol.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spin up
```
"""
struct SpinUp <: AbstractDefiniteSpin end
Base.show(io::IO, ::MIME"text/plain", ::SpinUp) = print(io, "spin up")
Base.show(io::IO, ::SpinUp) = print(io, "spin up")

"""
Concrete type indicating that a [`FermionLike`](@ref) has spin-down.
Expand All @@ -47,7 +47,7 @@ spin down
```
"""
struct SpinDown <: AbstractDefiniteSpin end
Base.show(io::IO, ::MIME"text/plain", ::SpinDown) = print(io, "spin down")
Base.show(io::IO, ::SpinDown) = print(io, "spin down")

"""
Concrete type indicating that a [`FermionLike`](@ref) has an indefinite spin and the differential cross section calculation should average or sum over all spins, depending on the direction ([`Incoming`](@ref) or [`Outgoing`](@ref)) of the particle in question.
Expand All @@ -60,7 +60,7 @@ all spins
```
"""
struct AllSpin <: AbstractIndefiniteSpin end
Base.show(io::IO, ::MIME"text/plain", ::AllSpin) = print(io, "all spins")
Base.show(io::IO, ::AllSpin) = print(io, "all spins")

"""
$(TYPEDSIGNATURES)
Expand Down Expand Up @@ -118,7 +118,7 @@ all polarizations
"""
struct AllPolarization <: AbstractIndefinitePolarization end
const AllPol = AllPolarization
Base.show(io::IO, ::MIME"text/plain", ::AllPol) = print(io, "all polarizations")
Base.show(io::IO, ::AllPol) = print(io, "all polarizations")

"""
Concrete type which indicates, that a [`BosonLike`](@ref) has polarization in ``x``-direction.
Expand Down Expand Up @@ -147,7 +147,7 @@ x-polarized
"""
struct PolarizationX <: AbstractDefinitePolarization end
const PolX = PolarizationX
Base.show(io::IO, ::MIME"text/plain", ::PolX) = print(io, "x-polarized")
Base.show(io::IO, ::PolX) = print(io, "x-polarized")

"""
Concrete type which indicates, that a [`BosonLike`](@ref) has polarization in ``y``-direction.
Expand Down Expand Up @@ -176,7 +176,7 @@ y-polarized
"""
struct PolarizationY <: AbstractDefinitePolarization end
const PolY = PolarizationY
Base.show(io::IO, ::MIME"text/plain", ::PolY) = print(io, "y-polarized")
Base.show(io::IO, ::PolY) = print(io, "y-polarized")

"""
multiplicity(spin_or_pol)
Expand Down
6 changes: 3 additions & 3 deletions src/particles/particle_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ electron
struct Electron <: Fermion end
mass(::Electron) = 1.0
charge(::Electron) = -1.0
Base.show(io::IO, ::MIME"text/plain", ::Electron) = print(io, "electron")
Base.show(io::IO, ::Electron) = print(io, "electron")

"""
Concrete type for *positrons* as a particle species. Mostly used for dispatch.
Expand All @@ -124,7 +124,7 @@ positron
struct Positron <: AntiFermion end
mass(::Positron) = 1.0
charge(::Positron) = 1.0
Base.show(io::IO, ::MIME"text/plain", ::Positron) = print(io, "positron")
Base.show(io::IO, ::Positron) = print(io, "positron")

"""
Abstract base types for particle species that act like bosons in the sense of particle statistics.
Expand Down Expand Up @@ -206,4 +206,4 @@ photon
struct Photon <: MajoranaBoson end
mass(::Photon) = 0.0
charge(::Photon) = 0.0
Base.show(io::IO, ::MIME"text/plain", ::Photon) = print(io, "photon")
Base.show(io::IO, ::Photon) = print(io, "photon")

0 comments on commit b42d200

Please sign in to comment.