Skip to content

Commit

Permalink
Supress warnings from MDAnalysis
Browse files Browse the repository at this point in the history
  • Loading branch information
jvsguerra committed Jun 27, 2024
1 parent 07696e0 commit 82e4265
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions AtomPacker/core/io/mol2/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 82e4265

Please sign in to comment.