Skip to content

Commit

Permalink
push to stash changes before switching over to CI fix branch
Browse files Browse the repository at this point in the history
  • Loading branch information
lunamorrow committed Jul 24, 2024
1 parent 5f13117 commit 9bc9b74
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 3 additions & 2 deletions mda_openbabel_converter/OpenBabelParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
from openbabel import OBElementTable
HAS_OBABEL = True
except ImportError:
# import breaks with version 3.x
warnings.warn("Cannot find openbabel, install with `mamba install -c "
"conda-forge openbabel`")
"conda-forge openbabel==2.4.0`")


class StereoEnum(StrEnum):
Expand Down Expand Up @@ -168,7 +169,7 @@ def parse(self, **kwargs):

# Atom name set with element and id, as name not supported by OpenBabel
for atom in ob.OBMolAtomIter(mol):
name = "%s%d" % (OBElementTable().GetSymbol(atom.GetAtomicNum()),
name = "%s%d" % (OBElementTable().GetSymbol(atom.GetAtomicNum()),
atom.GetIdx())
names.append(name)
attrs.append(Atomnames(np.array(names, dtype=object)))
Expand Down
2 changes: 0 additions & 2 deletions mda_openbabel_converter/data/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@
]

from importlib.resources import files
# from . import data
# MDANALYSIS_LOGO = importlib.resources.files(__name__) / "mda.txt"
MDANALYSIS_LOGO = files("mda_openbabel_converter") / "data" / "mda.txt"

8 changes: 4 additions & 4 deletions mda_openbabel_converter/tests/test_openbabel_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import mda_openbabel_converter.OpenBabelParser # version 2.7.0

# *** can run with "python -m pytest" but not "pytest" (can't find
# *** can run with "python -m pytest" but not "pytest" (can't find
# MDAnalysis) - need to fix this! ***


Expand All @@ -27,7 +27,7 @@ class OpenBabelParserBase(ParserBase):
expected_attrs = ['ids', 'names', 'elements', 'masses', 'aromaticities',
'resids', 'resnums', 'chiralities',
'segids', 'bonds',
]
]

expected_n_atoms = 0
expected_n_residues = 0
Expand All @@ -53,7 +53,7 @@ def filename(self):

def test_mandatory_attributes(self, top):
for attr in self.mandatory_attrs:
assert (hasattr(top, attr),
assert (hasattr(top, attr),
'Missing required attribute: {}'.format(attr))

def test_attrs_total_counts(self, top):
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_aromaticities(self, top, filename):

def test_elements(self, top, filename):
expected = np.array([
OBElementTable().GetSymbol(atom.GetAtomicNum()) for atom in
OBElementTable().GetSymbol(atom.GetAtomicNum()) for atom in
ob.OBMolAtomIter(filename)])
assert_equal(expected, top.elements.values)

Expand Down

0 comments on commit 9bc9b74

Please sign in to comment.