Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lueckem committed Apr 10, 2024
1 parent 2993338 commit 787c9f2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions sponet/collective_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions sponet/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 787c9f2

Please sign in to comment.