From 8d90fe5b96e90faacb47bc8c4277dc10c486acdc Mon Sep 17 00:00:00 2001 From: Rory Crean Date: Wed, 5 Apr 2023 09:45:25 +0200 Subject: [PATCH] Hide dcdreader warning Checked and validated the warning is not relevant for this code, see: https://github.com/MDAnalysis/mdanalysis/issues/3889 --- key_interactions_finder/contact_identification.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/key_interactions_finder/contact_identification.py b/key_interactions_finder/contact_identification.py index 3c699d6..1712c0c 100644 --- a/key_interactions_finder/contact_identification.py +++ b/key_interactions_finder/contact_identification.py @@ -16,6 +16,7 @@ "VdW" - Unspecified VdW interaction. """ from typing import Tuple, Optional, List +import warnings import pandas as pd import numpy as np @@ -32,6 +33,12 @@ HYDROPHOBIC_RESIDUES = ("ALA", "VAL", "LEU", "ILE", "PRO", "PHE", "Cys") +# From clarification on GitHub, this message can be safely ignored. +# https://github.com/MDAnalysis/mdanalysis/issues/3889 +warnings.filterwarnings( + "ignore", message="DCDReader currently makes independent timesteps") + + def calculate_contacts(parm_file: str, traj_file: str, out_file: str, @@ -106,8 +113,8 @@ def calculate_contacts(parm_file: str, contact_scores = [] for timestep in universe.trajectory: res_res_dists = contacts.distance_array( - res1_atoms.positions.copy(), - res2_atoms.positions.copy() + res1_atoms.positions, + res2_atoms.positions ) contact_score = _score_residue_contact( res_res_dists=res_res_dists)