Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hainm committed Nov 22, 2024
1 parent eca9dfc commit ae12d15
Showing 1 changed file with 18 additions and 59 deletions.
77 changes: 18 additions & 59 deletions nglview/tests/test_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,65 +26,24 @@
from utils import get_fn
from utils import repr_dict as REPR_DICT

try:
import simpletraj
has_simpletraj = True
except ImportError:
has_simpletraj = False

try:
import pytraj as pt
has_pytraj = True
except ImportError:
pt = None
has_pytraj = False

try:
import mdtraj as md
has_mdtraj = True
except ImportError:
has_mdtraj = False
try:
import parmed as pmd
has_parmed = True
except ImportError:
has_parmed = False

try:
import MDAnalysis
has_MDAnalysis = True
except ImportError:
has_MDAnalysis = False

try:
import htmd
has_HTMD = True
except ImportError:
has_HTMD = False

try:
import ase
has_ase = True
except ImportError:
has_ase = False

try:
import pymatgen
has_pymatgen = True
except ImportError:
has_pymatgen = False

try:
import Bio.PDB
has_bio = True
except ImportError:
has_bio = False

try:
import qcelemental
has_qcelemental = True
except ImportError:
has_qcelemental = False
modules = {
'simpletraj': 'has_simpletraj',
'pytraj': 'has_pytraj',
'mdtraj': 'has_mdtraj',
'parmed': 'has_parmed',
'MDAnalysis': 'has_MDAnalysis',
'htmd': 'has_HTMD',
'ase': 'has_ase',
'pymatgen': 'has_pymatgen',
'Bio.PDB': 'has_bio',
'qcelemental': 'has_qcelemental'
}

for module, var in modules.items():
try:
globals()[var] = __import__(module)
except ImportError:
globals()[var] = False


def get_mocked_traj():
Expand Down

0 comments on commit ae12d15

Please sign in to comment.