| 124 | return max(min_value, d0) |
| 125 | |
| 126 | def calc_d0_array(L, pair_type): |
| 127 | # Convert L to a NumPy array if it isn't already one (enables flexibility in input types) |
| 128 | # fixed 01.03.2026: now returns 1.00 instead of 1.04 for minimum value |
| 129 | L = np.array(L, dtype=float) |
| 130 | L = np.maximum(26,L) |
| 131 | min_value=1.0 |
| 132 | |
| 133 | if pair_type=='nucleic_acid': min_value=2.0 |
| 134 | |
| 135 | # Calculate d0 using the vectorized operation |
| 136 | return np.maximum(min_value, 1.24 * (L - 15) ** (1.0/3.0) - 1.8) |
| 137 | |
| 138 | |
| 139 | # Define the parse_atom_line function for PDB lines (by column) and mmCIF lines (split by white_space) |