@@ -65,7 +65,10 @@ def _upsample(a: np.ndarray, window: int) -> np.ndarray:
6565
6666def _unfold (a : np .ndarray , window : int , axis : int ):
6767 "Helper function for 2D array upsampling"
68- idx = np .arange (window )[:, None ] + np .arange (a .shape [axis ] - window + 1 )[None , :]
68+ idx = (
69+ np .arange (window )[:, None ]
70+ + np .arange (a .shape [axis ] - window + 1 )[None , :]
71+ )
6972 unfolded = np .take (a , idx , axis = axis )
7073 return np .moveaxis (unfolded , axis - 1 , - 1 )
7174
@@ -166,7 +169,9 @@ def get_hbond_map(
166169 h_1 = coord [1 :, 4 ]
167170 coord = coord [:, :4 ]
168171 else : # pragma: no cover
169- raise ValueError ("Number of atoms should be 4 (N,CA,C,O) or 5 (N,CA,C,O,H)" )
172+ raise ValueError (
173+ "Number of atoms should be 4 (N,CA,C,O) or 5 (N,CA,C,O,H)"
174+ )
170175 # after this:
171176 # h.shape == (n_residues, 3)
172177 # coord.shape == (n_residues, 4, 3)
@@ -188,7 +193,9 @@ def get_hbond_map(
188193 # electrostatic interaction energy
189194 # e[i, j] = e(CO_i) - e(NH_j)
190195 e = np .pad (
191- CONST_Q1Q2 * (1.0 / d_on + 1.0 / d_ch - 1.0 / d_oh - 1.0 / d_cn ) * CONST_F ,
196+ CONST_Q1Q2
197+ * (1.0 / d_on + 1.0 / d_ch - 1.0 / d_oh - 1.0 / d_cn )
198+ * CONST_F ,
192199 [[1 , 0 ], [0 , 1 ]],
193200 )
194201
0 commit comments