CodeEntropy.levels.dihedrals.kernels module¶
Numba kernels for dihedral conformational-state analysis.
This module contains numeric kernels used by the serial chunked conformational workflow. The kernels operate only on NumPy arrays and avoid MDAnalysis objects so they remain safe to JIT compile and reuse inside future distributed workers.
- CodeEntropy.levels.dihedrals.kernels.assign_peak_labels_and_count_flexible(angles: ndarray, padded_peaks: ndarray, peak_counts: ndarray) tuple[ndarray, int][source]¶
Assign nearest-peak labels and count flexible dihedrals.
- Parameters:
angles – Positive-angle array with shape
(n_frames, n_dihedrals).padded_peaks – Peak values with shape
(n_dihedrals, max_peaks).peak_counts – Number of valid peaks for each dihedral.
- Returns:
Tuple containing an integer label array with shape
(n_frames, n_dihedrals)and the number of flexible dihedrals.
- CodeEntropy.levels.dihedrals.kernels.histogram_counts_by_dihedral(angles: ndarray, number_bins: int) ndarray[source]¶
Build histogram counts for each dihedral angle series.
- Parameters:
angles – Positive-angle array with shape
(n_frames, n_dihedrals).number_bins – Number of histogram bins spanning 0 to 360 degrees.
- Returns:
Histogram counts with shape
(n_dihedrals, number_bins).
- CodeEntropy.levels.dihedrals.kernels.wrap_degrees_positive(angles: ndarray) ndarray[source]¶
Return dihedral angles wrapped into the positive degree range.
- Parameters:
angles – Angle array in degrees. The expected shape is
(n_frames, n_dihedrals).- Returns:
Copy of
angleswith negative values shifted by 360 degrees.