Skip to content

Commit 82e4265

Browse files
committed
Supress warnings from MDAnalysis
1 parent 07696e0 commit 82e4265

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

AtomPacker/core/io/mol2/file.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88

99
__all__ = ["load_mol2"]
1010

11-
11+
import warnings
1212
from string import digits
1313

14-
import numpy
1514
from MDAnalysis import Universe
1615

1716
from ..vdw import _lookup_radii
1817

18+
# Suppress MDAnalysis warnings
19+
warnings.filterwarnings("ignore", category=UserWarning)
20+
1921

2022
def load_mol2(filename: str) -> Universe:
2123
"""
@@ -46,9 +48,7 @@ def load_mol2(filename: str) -> Universe:
4648
elements = [
4749
atom.translate(str.maketrans("", "", digits))
4850
# Convert any hydrogens to H
49-
.replace("HA", "H")
50-
.replace("HB", "H")
51-
.replace("HC", "H")
51+
.replace("HA", "H").replace("HB", "H").replace("HC", "H")
5252
for atom in universe.atoms.names
5353
]
5454
# Add elements to topology

0 commit comments

Comments
 (0)