Skip to content

Commit

Permalink
remove unnecessary definiton of K from update.py
Browse files Browse the repository at this point in the history
  • Loading branch information
godenymarta authored Nov 22, 2023
1 parent 55e5103 commit b0cca6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions protex/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit b0cca6f

Please sign in to comment.