Commit 725217b4 authored by Markus Scheidgen's avatar Markus Scheidgen

Optionalise the import of MDTraj and MDAnalysis.

parent c1aca042
import ase.io
import ase.io.formats
import mdtraj as md
import mdtraj.formats
import numpy as np
import logging
try:
import mdtraj as md
import mdtraj.formats
except ImportError:
logging.getLogger("nomad").warn('MDTraj is not installed.')
logger = logging.getLogger("nomad")
......
from builtins import next
from builtins import object
import numpy as np
import mdtraj as mdt
import mdtraj.formats as mdt_load
import mdtraj.formats
from mdtraj import FormatRegistry as mdt_FormatRegistry
from mdtraj.core.topology import Topology as mdt_Topology
from mdtraj.core.trajectory import Trajectory as mdt_Trajectory
from mdtraj.core.trajectory import _TOPOLOGY_EXTS as mdt_TOPOLOGY_EXTS
import ase
from ase import io as ase_io
import ase.io.formats
......@@ -18,12 +11,29 @@ import re
import math
import inspect
import warnings
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
import MDAnalysis as mda
# assert str(w[-1].message)
import MDAnalysis.core.universe as mda_u
import MDAnalysis.coordinates as mda_c
try:
import mdtraj as mdt
import mdtraj.formats as mdt_load
import mdtraj.formats
from mdtraj import FormatRegistry as mdt_FormatRegistry
from mdtraj.core.topology import Topology as mdt_Topology
from mdtraj.core.trajectory import Trajectory as mdt_Trajectory
from mdtraj.core.trajectory import _TOPOLOGY_EXTS as mdt_TOPOLOGY_EXTS
except ImportError:
logging.getLogger(__name__).warn('MDTraj is not installed.')
try:
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
import MDAnalysis as mda
# assert str(w[-1].message)
import MDAnalysis.core.universe as mda_u
import MDAnalysis.coordinates as mda_c
mda_coordinates_modules = tuple(x[1] for x in inspect.getmembers(mda_c,inspect.ismodule))
except ImportError:
logging.getLogger(__name__).warn('MDAnalysis is not installed.')
import panedr
import parmed as pmd
# this might not be available on all development systems, we still want to pass the import
......@@ -38,7 +48,6 @@ import io
import struct
import copy
mda_coordinates_modules = tuple(x[1] for x in inspect.getmembers(mda_c,inspect.ismodule))
logger = logging.getLogger(__name__)
# The info in the table below is taken from MDAnalysis and definitions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment