From 82e4265bc01a6534f6a66e1589e38d697d6004cc Mon Sep 17 00:00:00 2001 From: jvsguerra Date: Thu, 27 Jun 2024 19:03:44 -0300 Subject: [PATCH] Supress warnings from MDAnalysis --- AtomPacker/core/io/mol2/file.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AtomPacker/core/io/mol2/file.py b/AtomPacker/core/io/mol2/file.py index 8f76e2c..d4185ce 100644 --- a/AtomPacker/core/io/mol2/file.py +++ b/AtomPacker/core/io/mol2/file.py @@ -8,14 +8,16 @@ __all__ = ["load_mol2"] - +import warnings from string import digits -import numpy from MDAnalysis import Universe from ..vdw import _lookup_radii +# Suppress MDAnalysis warnings +warnings.filterwarnings("ignore", category=UserWarning) + def load_mol2(filename: str) -> Universe: """ @@ -46,9 +48,7 @@ def load_mol2(filename: str) -> Universe: elements = [ atom.translate(str.maketrans("", "", digits)) # Convert any hydrogens to H - .replace("HA", "H") - .replace("HB", "H") - .replace("HC", "H") + .replace("HA", "H").replace("HB", "H").replace("HC", "H") for atom in universe.atoms.names ] # Add elements to topology