Skip to content

Commit

Permalink
creation seems to work
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen committed Aug 18, 2023
1 parent f75b85a commit 9c73507
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions fwdpy11/genetic_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,26 @@ def __eq__(self, other):

@attr.s(auto_attribs=True, frozen=True, repr_ns="fwdpy11")
class GaussianStabilizingSelection(_ll_GaussianStabilizingSelection):
classname: GeneticValueIsTrait
optima: list

def __attrs_post_init__(self):
inner = self.classname(self.optima)
super(GaussianStabilizingSelection, self).__init__(inner)

@classmethod
def single_trait(cls, optima):
raise NotImplementedError
new_optima = []
for o in optima:
if o.when is None:
new_optima.append(Optimum(o.optimum, o.VS, 0))
else:
new_optima.append(o)
return cls(classname=_ll_GSSmo, optima=new_optima)

@classmethod
def pleiotropy(cls, optima):
raise NotImplementedError
return cls(classname=_ll_MultivariateGSSmo, optima=optima)


@attr_add_asblack
Expand Down

0 comments on commit 9c73507

Please sign in to comment.