Skip to content

Commit

Permalink
provide a few docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
mantepse committed Feb 25, 2025
1 parent 9cd292b commit 082b37e
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/sage/rings/lazy_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,9 @@ def coefficient(n):

class SumSpeciesElement(LazySpeciesElement):
def __init__(self, left, right):
r"""
Initialize the sum of two species.
"""
F = super(LazySpeciesElement, type(left))._add_(left, right)
super().__init__(F.parent(), F._coeff_stream)
self._left = left
Expand All @@ -703,6 +706,9 @@ def structures(self, *labels):

class ProductSpeciesElement(LazySpeciesElement):
def __init__(self, left, right):
r"""
Initialize the product of two species.
"""
F = super(LazySpeciesElement, type(left))._mul_(left, right)
super().__init__(F.parent(), F._coeff_stream)
self._left = left
Expand Down Expand Up @@ -741,7 +747,9 @@ def dissections(s):

class CompositionSpeciesElement(LazySpeciesElement):
def __init__(self, left, *args):
"""
r"""
Initialize the composition of species.
TESTS::
sage: from sage.rings.lazy_species import LazySpecies
Expand Down Expand Up @@ -929,7 +937,9 @@ def _first_ngens(self, n):
return tuple([self(g) for g in self._laurent_poly_ring._first_ngens(n)])

def __init__(self, base_ring, names, sparse):
"""
r"""
Initialize the ring of lazy species.
EXAMPLES::
sage: from sage.rings.lazy_species import LazySpecies
Expand Down Expand Up @@ -958,6 +968,9 @@ def __init__(self, base_ring, names, sparse):

class SetSpecies(LazySpeciesElement):
def __init__(self, parent):
r"""
Initialize the species of sets.
"""
S = parent(lambda n: SymmetricGroup(n))
super().__init__(parent, S._coeff_stream)

Expand All @@ -978,6 +991,9 @@ def structures(self, *labels):

class CycleSpecies(LazySpeciesElement):
def __init__(self, parent):
r"""
Initialize the species of cycles.
"""
S = parent(lambda n: CyclicPermutationGroup(n) if n else 0)
super().__init__(parent, S._coeff_stream)

Expand All @@ -1003,7 +1019,11 @@ def structures(self, *labels):


class GraphSpecies(LazySpeciesElement):

def __init__(self, parent):
r"""
Initialize the species of simple graphs.
"""
P = parent._laurent_poly_ring
S = parent(lambda n: sum(P(G.automorphism_group()) for G in graphs(n)))
super().__init__(parent, S._coeff_stream)
Expand All @@ -1015,6 +1035,9 @@ def isotypes(self, labels):

class SetPartitionSpecies(LazySpeciesElement):
def __init__(self, parent):
r"""
Initialize the species of set partitions.
"""
E = parent.Sets()
E1 = parent.Sets().restrict(1)
super().__init__(parent, E(E1)._coeff_stream)
Expand All @@ -1030,6 +1053,9 @@ def structures(self, labels):

class RestrictedSpeciesElement(LazySpeciesElement):
def __init__(self, F, min_degree, max_degree):
r"""
Initialize the restriction of a species to the given degrees.
"""
self._F = F
self._min = min_degree
self._max = max_degree
Expand Down

0 comments on commit 082b37e

Please sign in to comment.