Skip to content

Commit

Permalink
rename enum variant
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen committed Aug 15, 2023
1 parent cfda831 commit 139ff15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions fwdpy11/conditional_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class NewMutationParameters:
class SimulationStatus(Enum):
Restart = 0
Continue = 1
Complete = 2
Success = 2


@attr.s(auto_attribs=True, kw_only=True)
Expand All @@ -237,7 +237,7 @@ def __call__(
if pop.mcounts[index] == 0:
return SimulationStatus.Restart
if pop.mcounts[index] == 2 * pop.N:
return SimulationStatus.Complete
return SimulationStatus.Success
return SimulationStatus.Continue


Expand Down Expand Up @@ -271,7 +271,7 @@ def __call__(self, pop, index, key) -> SimulationStatus:
if count == 0:
return SimulationStatus.Restart
if count == 2 * deme_sizes[self.deme]:
return SimulationStatus.Complete
return SimulationStatus.Success
return SimulationStatus.Continue


Expand Down
12 changes: 6 additions & 6 deletions fwdpy11/conditional_models/_track_added_mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class _ProgressMonitor:

def __call__(self, pop: fwdpy11.DiploidPopulation, _) -> bool:
if (
self.status == SimulationStatus.Complete
self.status == SimulationStatus.Success
and self.return_when_stopping_condition_met is True
):
return True
Expand Down Expand Up @@ -89,9 +89,9 @@ def __call__(self, pop, index: int, key: tuple) -> SimulationStatus:
if pop.mutations[index].key != key and self.is_fixed(pop, key) is False:
return SimulationStatus.Restart
if pop.mcounts[index] > 0:
return SimulationStatus.Complete
return SimulationStatus.Success
if self.is_fixed(pop, key):
return SimulationStatus.Complete
return SimulationStatus.Success
return SimulationStatus.Continue


Expand All @@ -114,7 +114,7 @@ def __attrs_post_init__(self):
)

def __call__(self, pop, sampler) -> None:
if self.monitor.status != SimulationStatus.Complete:
if self.monitor.status != SimulationStatus.Success:
self.monitor.status = self.criterion(
pop, self.monitor.index, self.monitor.key
)
Expand All @@ -129,7 +129,7 @@ def __call__(self, pop, sampler) -> None:

y = (
self.sampling_policy == AncientSamplePolicy.COMPLETION
and self.monitor.status == SimulationStatus.Complete
and self.monitor.status == SimulationStatus.Success
and (self.until is None or pop.generation == self.until)
)

Expand Down Expand Up @@ -409,7 +409,7 @@ def _track_added_mutation(

# The sim ended, so
# check if condition was satisfied or not
if recorder.monitor.status == SimulationStatus.Complete:
if recorder.monitor.status == SimulationStatus.Success:
pop_to_return = pcopy_loop
_evolvets_options = evolvets_options_copy
local_params = local_params_copy
Expand Down

0 comments on commit 139ff15

Please sign in to comment.