Skip to content

Commit dce78fe

Browse files
formatting
1 parent a029dcd commit dce78fe

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

package/MDAnalysis/analysis/dssp/pydssp_numpy.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ def _upsample(a: np.ndarray, window: int) -> np.ndarray:
6565

6666
def _unfold(a: np.ndarray, window: int, axis: int):
6767
"Helper function for 2D array upsampling"
68-
idx = (
69-
np.arange(window)[:, None]
70-
+ np.arange(a.shape[axis] - window + 1)[None, :]
71-
)
68+
idx = np.arange(window)[:, None] + np.arange(a.shape[axis] - window + 1)[None, :]
7269
unfolded = np.take(a, idx, axis=axis)
7370
return np.moveaxis(unfolded, axis - 1, -1)
7471

@@ -169,9 +166,7 @@ def get_hbond_map(
169166
h_1 = coord[1:, 4]
170167
coord = coord[:, :4]
171168
else: # pragma: no cover
172-
raise ValueError(
173-
"Number of atoms should be 4 (N,CA,C,O) or 5 (N,CA,C,O,H)"
174-
)
169+
raise ValueError("Number of atoms should be 4 (N,CA,C,O) or 5 (N,CA,C,O,H)")
175170
# after this:
176171
# h.shape == (n_residues, 3)
177172
# coord.shape == (n_residues, 4, 3)
@@ -193,9 +188,7 @@ def get_hbond_map(
193188
# electrostatic interaction energy
194189
# e[i, j] = e(CO_i) - e(NH_j)
195190
e = np.pad(
196-
CONST_Q1Q2
197-
* (1.0 / d_on + 1.0 / d_ch - 1.0 / d_oh - 1.0 / d_cn)
198-
* CONST_F,
191+
CONST_Q1Q2 * (1.0 / d_on + 1.0 / d_ch - 1.0 / d_oh - 1.0 / d_cn) * CONST_F,
199192
[[1, 0], [0, 1]],
200193
)
201194

0 commit comments

Comments
 (0)