Skip to content

Commit

Permalink
Add docstrings for num, dim, operations
Browse files Browse the repository at this point in the history
  • Loading branch information
thchr committed Sep 13, 2024
1 parent 7ea038e commit 4bd3377
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,27 @@ or, alternatively, fields with names `num` and `operations`, behaving accordingl
"""
abstract type AbstractGroup{D,O} <: AbstractVector{O} end # where O <: AbstractOperation{D}
# Interface: must have fields `operations`, `num` and dimensionality `D`.

"""
num(g::AbstractGroup) -> Int
Return the conventional number assigned to the group `g`.
"""
num(g::AbstractGroup) = g.num

"""
operations(g::AbstractGroup) -> Vector{<:AbstractOperation}
Return an `Vector` containing the operations of the group `g`.
"""
operations(g::AbstractGroup) = g.operations

"""
dim(g::AbstractGroup) -> Int
Return the dimensionality of the coordinate space of the group `g`.
This is a statically known number, either equaling 1, 2, or 3.
"""
dim(::AbstractGroup{D}) where D = D

# define the AbstractArray interface for AbstractGroup
Expand Down

0 comments on commit 4bd3377

Please sign in to comment.