From b0cca6f228dc8d7f62a491f7748472baaba19f87 Mon Sep 17 00:00:00 2001 From: godenymarta <66373505+godenymarta@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:01:25 +0100 Subject: [PATCH] remove unnecessary definiton of K from update.py --- protex/update.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protex/update.py b/protex/update.py index 4e7238b7..50d95cc3 100644 --- a/protex/update.py +++ b/protex/update.py @@ -104,7 +104,7 @@ def _update(self, candidates: list[tuple], nr_of_steps: int) -> None: pass def _adapt_probabilities( - self, to_adapt=list[tuple[str, int, frozenset[str]]], K=int + self, to_adapt=list[tuple[str, int, frozenset[str]]] ) -> None: """Adapt the probability for certain events depending on the current equilibrium, in order to stay close to a given reference i.e. prob_neu = prob_orig + K*( x(t) - x(eq) )^3 where x(t) is the current percentage in the system of one species. @@ -143,7 +143,7 @@ def _adapt_probabilities( f"{res_name=}, {initial_number=}, {current_number=}, {update_set=}" ) perc_change = current_number / initial_number - factor = K * (perc_change - 1) ** 3 + factor = self.K * (perc_change - 1) ** 3 logger.debug(f"{perc_change=}, {factor=}") new_prob = ( self.ionic_liquid.templates.get_update_value_for(update_set, "prob") @@ -744,7 +744,7 @@ def update(self, nr_of_steps: int = 2) -> list[tuple[Residue, Residue]]: self.update_trial += 1 if self.updateMethod.to_adapt is not None: - self.updateMethod._adapt_probabilities(self.updateMethod.to_adapt, self.updateMethod.K) + self.updateMethod._adapt_probabilities(self.updateMethod.to_adapt) self._print_stop()