From 787c9f235568743109637fc0a7c81d6359d11770 Mon Sep 17 00:00:00 2001 From: Marvin Date: Wed, 10 Apr 2024 22:11:17 +0200 Subject: [PATCH] formatting --- pyproject.toml | 2 +- sponet/collective_variables.py | 6 +++--- sponet/sampling.py | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 499f247..e77d111 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ optional = true [tool.poetry.group.test.dependencies] pytest = "^7.3.0" pytest-cov = "^4.0.0" -black = "^23.3.0" +black = "^24.3.0" [tool.poetry.group.notebooks] diff --git a/sponet/collective_variables.py b/sponet/collective_variables.py index 91789a5..bc6c696 100644 --- a/sponet/collective_variables.py +++ b/sponet/collective_variables.py @@ -147,9 +147,9 @@ def __call__(self, x_traj: np.ndarray) -> np.ndarray: x_agg = x_agg[:, self.idx_to_return] if self.normalize: x_agg /= np.sum(weights) - cv[ - :, i * len(self.idx_to_return) : (i + 1) * len(self.idx_to_return) - ] = np.copy(x_agg) + cv[:, i * len(self.idx_to_return) : (i + 1) * len(self.idx_to_return)] = ( + np.copy(x_agg) + ) return cv diff --git a/sponet/sampling.py b/sponet/sampling.py index 381ff5e..5bd04cf 100644 --- a/sponet/sampling.py +++ b/sponet/sampling.py @@ -54,8 +54,10 @@ def build_alias_table(weights: np.ndarray) -> tuple[np.ndarray, np.ndarray]: table_alias[small_id] = large_id table_prob[large_id] = table_prob[large_id] + table_prob[small_id] - 1 - small_ids.append(large_id) if table_prob[large_id] < 1 else large_ids.append( - large_id + ( + small_ids.append(large_id) + if table_prob[large_id] < 1 + else large_ids.append(large_id) ) while large_ids: