Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pretty printing #65

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
Loading