Skip to content

Commit

Permalink
Revert import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
IAlibay committed Oct 26, 2024
1 parent 800b4b2 commit fd71560
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
8 changes: 8 additions & 0 deletions package/MDAnalysis/topology/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@
from ..core._get_readers import get_parser_for
from ..lib.util import cached

# Deprecated local imports
from MDAnalysis.guesser import tables
from .guessers import (
guess_atom_element, guess_atom_type,
get_atom_mass, guess_atom_mass, guess_atom_charge,
guess_bonds, guess_angles, guess_dihedrals, guess_improper_dihedrals,
)

#tumbleweed
24 changes: 18 additions & 6 deletions package/MDAnalysis/topology/guessers.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,17 @@

from ..lib import distances
from MDAnalysis.guesser import tables
from MDAnalysis.lib.util import deprecate


wmsg = (
"Deprecated in version 2.8.0\n"
deprecation_msg = (
"MDAnalysis.topology.guessers is deprecated in favour of "
"the new Guessers API and will be removed in MDAnalysis version 3.0.0. "
"the new Guessers API. "
"See MDAnalysis.guesser.default_guesser for more details."
)


warnings.warn(wmsg, category=DeprecationWarning)


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_masses(atom_types):
"""Guess the mass of many atoms based upon their type
Expand All @@ -137,6 +135,7 @@ def guess_masses(atom_types):
return masses


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def validate_atom_types(atom_types):
"""Vaildates the atom types based on whether they are available in our tables
Expand All @@ -162,6 +161,7 @@ def validate_atom_types(atom_types):
warnings.warn("Failed to guess the mass for the following atom types: {}".format(atom_type))


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_types(atom_names):
"""Guess the atom type of many atoms based on atom name
Expand All @@ -177,6 +177,7 @@ def guess_types(atom_names):
return np.array([guess_atom_element(name) for name in atom_names], dtype=object)


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_atom_type(atomname):
"""Guess atom type from the name.
Expand All @@ -197,6 +198,8 @@ def guess_atom_type(atomname):
NUMBERS = re.compile(r'[0-9]') # match numbers
SYMBOLS = re.compile(r'[*+-]') # match *, +, -


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_atom_element(atomname):
"""Guess the element of the atom from the name.
Expand Down Expand Up @@ -246,6 +249,7 @@ def guess_atom_element(atomname):
return no_symbols


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_bonds(atoms, coords, box=None, **kwargs):
r"""Guess if bonds exist between two atoms based on their distance.
Expand Down Expand Up @@ -354,6 +358,7 @@ def guess_bonds(atoms, coords, box=None, **kwargs):
return tuple(bonds)


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_angles(bonds):
"""Given a list of Bonds, find all angles that exist between atoms.
Expand Down Expand Up @@ -390,6 +395,7 @@ def guess_angles(bonds):
return tuple(angles_found)


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_dihedrals(angles):
"""Given a list of Angles, find all dihedrals that exist between atoms.
Expand Down Expand Up @@ -423,6 +429,7 @@ def guess_dihedrals(angles):
return tuple(dihedrals_found)


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_improper_dihedrals(angles):
"""Given a list of Angles, find all improper dihedrals that exist between
atoms.
Expand Down Expand Up @@ -459,6 +466,7 @@ def guess_improper_dihedrals(angles):
return tuple(dihedrals_found)


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def get_atom_mass(element):
"""Return the atomic mass in u for *element*.
Expand All @@ -478,6 +486,7 @@ def get_atom_mass(element):
return 0.0


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_atom_mass(atomname):
"""Guess a mass based on the atom name.
Expand All @@ -489,6 +498,7 @@ def guess_atom_mass(atomname):
return get_atom_mass(guess_atom_element(atomname))


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_atom_charge(atomname):
"""Guess atom charge from the name.
Expand All @@ -498,6 +508,7 @@ def guess_atom_charge(atomname):
return 0.0


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_aromaticities(atomgroup):
"""Guess aromaticity of atoms using RDKit
Expand All @@ -518,6 +529,7 @@ def guess_aromaticities(atomgroup):
return np.array([atom.GetIsAromatic() for atom in mol.GetAtoms()])


@deprecate(release="2.8.0", remove="3.0.0", message=deprecation_msg)
def guess_gasteiger_charges(atomgroup):
"""Guess Gasteiger partial charges using RDKit
Expand Down

0 comments on commit fd71560

Please sign in to comment.