diff --git a/.github/workflows/Test.yaml b/.github/workflows/Test.yaml index 99832859..e76e2b00 100644 --- a/.github/workflows/Test.yaml +++ b/.github/workflows/Test.yaml @@ -28,6 +28,8 @@ jobs: python-version: ${{ matrix.python-version }} environment-file: devtools/environment-dev.yaml activate-environment: parmed-dev + channels: conda-forge,bioconda + # mamba-version: "*" - name: Environment Information shell: bash -l {0} diff --git a/parmed/amber/_chamberparm.py b/parmed/amber/_chamberparm.py index 199b2451..1af391f5 100644 --- a/parmed/amber/_chamberparm.py +++ b/parmed/amber/_chamberparm.py @@ -579,10 +579,10 @@ def _set_nonbonded_tables(self, nbfixes=None): for i, fix in enumerate(nbfixes): for terms in fix: j, rmin, eps, rmin14, eps14 = terms - i, j = min(i, j-1), max(i, j-1) + k, l = min(i, j-1), max(i, j-1) eps = abs(eps) eps14 = abs(eps14) - idx = data['NONBONDED_PARM_INDEX'][ntypes*i+j] - 1 + idx = data['NONBONDED_PARM_INDEX'][ntypes*k+l] - 1 data['LENNARD_JONES_ACOEF'][idx] = eps * rmin**12 data['LENNARD_JONES_BCOEF'][idx] = 2 * eps * rmin**6 data['LENNARD_JONES_14_ACOEF'][idx] = eps14 * rmin14**12 diff --git a/test/test_parmed_visualization.py b/test/test_parmed_visualization.py deleted file mode 100644 index 54539a90..00000000 --- a/test/test_parmed_visualization.py +++ /dev/null @@ -1,55 +0,0 @@ -from __future__ import print_function -import sys -import parmed as pmd -import unittest - -from utils import get_fn - -try: - from ipywidgets import Widget - from ipykernel.comm import Comm - import nglview - has_nglview = True - - #------------------------------------------------------ - # Utility stuff from ipywidgets tests: create DummyComm - # we dont need Jupyter notebook for testing - #------------------------------------------------------ - class DummyComm(Comm): - comm_id = 'a-b-c-d' - - def open(self, *args, **kwargs): - pass - - def send(self, *args, **kwargs): - pass - - def close(self, *args, **kwargs): - pass - - _widget_attrs = {} - displayed = [] - undefined = object() - - _widget_attrs['_comm_default'] = getattr(Widget, '_comm_default', undefined) - Widget._comm_default = lambda self: DummyComm() - _widget_attrs['_ipython_display_'] = Widget._ipython_display_ - def raise_not_implemented(*args, **kwargs): - raise NotImplementedError() - Widget._ipython_display_ = raise_not_implemented -except ImportError: - has_nglview = False - nglview = Comm = DummyComm = _widget_attrs = displayed = undefined = Widget = None - -@unittest.skipUnless(has_nglview, "Only test if having nglview") -class TestVisualization(unittest.TestCase): - """ Test visualization """ - - def test_visualization(self): - """ Test visualization with nglview """ - parm = pmd.load_file(get_fn('2koc.pdb')) - view = parm.visualize() - self.assertIsInstance(view, nglview.NGLWidget) - # test None - parm.coordinates = None - self.assertRaises(ValueError, parm.visualize)