From 139ff15012916d11f9eba8fcd7db9e1ae6bced36 Mon Sep 17 00:00:00 2001 From: "Kevin R. Thornton" Date: Tue, 15 Aug 2023 09:33:45 -0700 Subject: [PATCH] rename enum variant --- fwdpy11/conditional_models/__init__.py | 6 +++--- fwdpy11/conditional_models/_track_added_mutation.py | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fwdpy11/conditional_models/__init__.py b/fwdpy11/conditional_models/__init__.py index 192bd15ec..3eaa51af5 100644 --- a/fwdpy11/conditional_models/__init__.py +++ b/fwdpy11/conditional_models/__init__.py @@ -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) @@ -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 @@ -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 diff --git a/fwdpy11/conditional_models/_track_added_mutation.py b/fwdpy11/conditional_models/_track_added_mutation.py index 97112cc8d..05075fa03 100644 --- a/fwdpy11/conditional_models/_track_added_mutation.py +++ b/fwdpy11/conditional_models/_track_added_mutation.py @@ -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 @@ -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 @@ -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 ) @@ -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) ) @@ -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