Commit 6372a75d authored by jdurrant's avatar jdurrant

Removed # No MDAnalysis in Apache 2.0 version! # comments

parent 7a61f684
......@@ -1007,65 +1007,65 @@ class FileIO():
out.close()
return
# No MDAnalysis in Apache 2.0 version! #def load_MDAnalysis_into(self, *args):
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # Allows import of molecular structure with MDAnalysis.
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # Requires the :any:`MDAnalysis <MDAnalysis.core.AtomGroup>` library.
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # Should be called via the wrapper function
# No MDAnalysis in Apache 2.0 version! # :meth:`~scoria.Molecule.Molecule.load_MDAnalysis_into`
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # :params \*args: Filename, filenames, or list of file names. Used to
# No MDAnalysis in Apache 2.0 version! # inizalize a MDAnalysis.Universe object.
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # # Throwing an informative error for missing module.
# No MDAnalysis in Apache 2.0 version! # if "MDAnalysis" not in sys.modules:
# No MDAnalysis in Apache 2.0 version! # raise ImportError("The MDAnalysis Module is not available.")
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # # Initializing the MDAnalysis universe with the suppplied args
# No MDAnalysis in Apache 2.0 version! # universe = numpy.mda.Universe(*args)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.load_MDAnalysis_into_using_universe_object(universe)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.__parent_molecule.set_filename(args)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! #def load_MDAnalysis_into_using_universe_object(self, universe):
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # Allows import of molecular structure from an MDAnalysis object.
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # Requires the :any:`MDAnalysis <MDAnalysis.core.AtomGroup>` library.
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # Should be called via the wrapper function
# No MDAnalysis in Apache 2.0 version! # :meth:`~scoria.Molecule.Molecule.load_MDAnalysis_into`
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # :param mdanalysis.universe universe: An MDAnalysis universe object to
# No MDAnalysis in Apache 2.0 version! # import.
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # # Throwing an informative error for missing module.
# No MDAnalysis in Apache 2.0 version! # if not numpy.class_dependency("load MDAnalysis into", "MDANALYSIS"):
# No MDAnalysis in Apache 2.0 version! # return
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # # Initializing the MDAnalysis universe with the suppplied args
# No MDAnalysis in Apache 2.0 version! # self.__u = universe
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # # Writing to and reading from a temporary PDB file for atom information
# No MDAnalysis in Apache 2.0 version! # fileDescriptor, tempPDB = tempfile.mkstemp(".PDB")
# No MDAnalysis in Apache 2.0 version! # try:
# No MDAnalysis in Apache 2.0 version! # self.__u.atoms.write(tempPDB)
# No MDAnalysis in Apache 2.0 version! # self.load_pdb_into(tempPDB)
# No MDAnalysis in Apache 2.0 version! # finally:
# No MDAnalysis in Apache 2.0 version! # os.remove(tempPDB)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # # Converting the MDA.trajectory data structure to our structure
# No MDAnalysis in Apache 2.0 version! # trajectoryList = []
# No MDAnalysis in Apache 2.0 version! # for frame in self.__u.trajectory:
# No MDAnalysis in Apache 2.0 version! # frameList = []
# No MDAnalysis in Apache 2.0 version! # for coord in frame:
# No MDAnalysis in Apache 2.0 version! # coordList = numpy.vstack(coord).T
# No MDAnalysis in Apache 2.0 version! # frameList.append(coordList)
# No MDAnalysis in Apache 2.0 version! # trajectoryList.append(numpy.vstack(frameList))
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.__parent_molecule.set_trajectory_coordinates(trajectoryList)
def load_MDAnalysis_into(self, *args):
"""
Allows import of molecular structure with MDAnalysis.
Requires the :any:`MDAnalysis <MDAnalysis.core.AtomGroup>` library.
Should be called via the wrapper function
:meth:`~scoria.Molecule.Molecule.load_MDAnalysis_into`
:params \*args: Filename, filenames, or list of file names. Used to
inizalize a MDAnalysis.Universe object.
"""
# Throwing an informative error for missing module.
if "MDAnalysis" not in sys.modules:
raise ImportError("The MDAnalysis Module is not available.")
# Initializing the MDAnalysis universe with the suppplied args
universe = numpy.mda.Universe(*args)
self.load_MDAnalysis_into_using_universe_object(universe)
self.__parent_molecule.set_filename(args)
def load_MDAnalysis_into_using_universe_object(self, universe):
"""
Allows import of molecular structure from an MDAnalysis object.
Requires the :any:`MDAnalysis <MDAnalysis.core.AtomGroup>` library.
Should be called via the wrapper function
:meth:`~scoria.Molecule.Molecule.load_MDAnalysis_into`
:param mdanalysis.universe universe: An MDAnalysis universe object to
import.
"""
# Throwing an informative error for missing module.
if not numpy.class_dependency("load MDAnalysis into", "MDANALYSIS"):
return
# Initializing the MDAnalysis universe with the suppplied args
self.__u = universe
# Writing to and reading from a temporary PDB file for atom information
fileDescriptor, tempPDB = tempfile.mkstemp(".PDB")
try:
self.__u.atoms.write(tempPDB)
self.load_pdb_into(tempPDB)
finally:
os.remove(tempPDB)
# Converting the MDA.trajectory data structure to our structure
trajectoryList = []
for frame in self.__u.trajectory:
frameList = []
for coord in frame:
coordList = numpy.vstack(coord).T
frameList.append(coordList)
trajectoryList.append(numpy.vstack(frameList))
self.__parent_molecule.set_trajectory_coordinates(trajectoryList)
......@@ -67,10 +67,10 @@ class Molecule: # here's the actual Molecule class
self.load_pdbqt_trajectory_into(file)
elif file_type == 'PYM':
self.load_pym_into(file)
# No MDAnalysis in Apache 2.0 version! # else:
# No MDAnalysis in Apache 2.0 version! # self.load_MDAnalysis_into(file)
# No MDAnalysis in Apache 2.0 version! #else:
# No MDAnalysis in Apache 2.0 version! # self.load_MDAnalysis_into(*args)
else:
self.load_MDAnalysis_into(file)
else:
self.load_MDAnalysis_into(*args)
# Information methods
### Wrappers ###
......@@ -1048,35 +1048,35 @@ class Molecule: # here's the actual Molecule class
serial_reindex,
resseq_reindex)
# No MDAnalysis in Apache 2.0 version! #def load_MDAnalysis_into(self, *args):
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # Allows import of molecular structure with MDAnalysis
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # Requires the :any:`MDAnalysis <MDAnalysis.core.AtomGroup>` library.
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # Wrapper function for
# No MDAnalysis in Apache 2.0 version! # :meth:`~scoria.FileIO.FileIO.load_MDAnalysis_into`
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # :param \*args: Filename, filenames, or list of file names. Used to
# No MDAnalysis in Apache 2.0 version! # inizalize a MDAnalysis.Universe object.
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.fileio.load_MDAnalysis_into(*args)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! #def load_MDAnalysis_into_using_universe_object(self, universe):
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # Allows import of molecular structure with MDAnalysis
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # Requires the :any:`MDAnalysis <MDAnalysis.core.AtomGroup>` library.
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # Wrapper function for
# No MDAnalysis in Apache 2.0 version! # :meth:`~scoria.FileIO.FileIO.load_MDAnalysis_into_using_universe_object`
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # :param MDAnalysis.core.Universe universe: MDAnalysis Universe object.
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.fileio.load_MDAnalysis_into_using_universe_object(universe)
def load_MDAnalysis_into(self, *args):
"""
Allows import of molecular structure with MDAnalysis
Requires the :any:`MDAnalysis <MDAnalysis.core.AtomGroup>` library.
Wrapper function for
:meth:`~scoria.FileIO.FileIO.load_MDAnalysis_into`
:param \*args: Filename, filenames, or list of file names. Used to
inizalize a MDAnalysis.Universe object.
"""
self.fileio.load_MDAnalysis_into(*args)
def load_MDAnalysis_into_using_universe_object(self, universe):
"""
Allows import of molecular structure with MDAnalysis
Requires the :any:`MDAnalysis <MDAnalysis.core.AtomGroup>` library.
Wrapper function for
:meth:`~scoria.FileIO.FileIO.load_MDAnalysis_into_using_universe_object`
:param MDAnalysis.core.Universe universe: MDAnalysis Universe object.
"""
self.fileio.load_MDAnalysis_into_using_universe_object(universe)
# Atoms and Bonds class methods
......
......@@ -97,10 +97,10 @@ class Test:
True
)
# No MDAnalysis in Apache 2.0 version! #print(" load_MDAnalysis_into()")
# No MDAnalysis in Apache 2.0 version! #self.mol = Molecule()
# No MDAnalysis in Apache 2.0 version! #self.mol.load_MDAnalysis_into(sample_structures_dir + "M2_traj.psf",
# No MDAnalysis in Apache 2.0 version! # sample_structures_dir + "M2_traj.dcd")
print(" load_MDAnalysis_into()")
self.mol = Molecule()
self.mol.load_MDAnalysis_into(sample_structures_dir + "M2_traj.psf",
sample_structures_dir + "M2_traj.dcd")
# Temporarily commented out because no dumbpy implementation needed.
print(" load_pym_into()")
......@@ -511,13 +511,13 @@ class FileIOBenchmarks:
self.timeit(self.load_pym, self.reset_test_vars_standard, self.new_molecule)
print()
# No MDAnalysis in Apache 2.0 version! #print("Load DCD (single frame)")
# No MDAnalysis in Apache 2.0 version! #self.timeit(self.load_dcd, self.reset_test_vars_standard, self.new_molecule)
# No MDAnalysis in Apache 2.0 version! #print()
print("Load DCD (single frame)")
self.timeit(self.load_dcd, self.reset_test_vars_standard, self.new_molecule)
print()
# No MDAnalysis in Apache 2.0 version! #print("Load DCD (100 frames)")
# No MDAnalysis in Apache 2.0 version! #self.timeit(self.load_dcd_100_frames, self.reset_test_vars_standard, self.new_molecule)
# No MDAnalysis in Apache 2.0 version! #print()
print("Load DCD (100 frames)")
self.timeit(self.load_dcd_100_frames, self.reset_test_vars_standard, self.new_molecule)
print()
# Clean up
if os.path.exists("tmptmp.pdb"):
......@@ -585,11 +585,11 @@ class FileIOBenchmarks:
def load_pym(self):
self.molecule.load_pym_into(self.load_filename)
# No MDAnalysis in Apache 2.0 version! #def load_dcd(self):
# No MDAnalysis in Apache 2.0 version! # if "MDANALYSIS" in numpy.dependencies_available:
# No MDAnalysis in Apache 2.0 version! # self.molecule.load_MDAnalysis_into(self.sample_structures_dir + "single_frame.psf", self.sample_structures_dir + "single_frame.dcd")
def load_dcd(self):
if "MDANALYSIS" in numpy.dependencies_available:
self.molecule.load_MDAnalysis_into(self.sample_structures_dir + "single_frame.psf", self.sample_structures_dir + "single_frame.dcd")
# No MDAnalysis in Apache 2.0 version! #def load_dcd_100_frames(self):
# No MDAnalysis in Apache 2.0 version! # if "MDANALYSIS" in numpy.dependencies_available:
# No MDAnalysis in Apache 2.0 version! # self.molecule.load_MDAnalysis_into(self.sample_structures_dir + "single_frame.psf", self.sample_structures_dir + "single_frame.100.dcd")
def load_dcd_100_frames(self):
if "MDANALYSIS" in numpy.dependencies_available:
self.molecule.load_MDAnalysis_into(self.sample_structures_dir + "single_frame.psf", self.sample_structures_dir + "single_frame.100.dcd")
......@@ -175,8 +175,8 @@ except:
try:
if force_dumbpy: raise ValueError('Using dumbpy')
# No MDAnalysis in Apache 2.0 version! #import MDAnalysis as mda
# No MDAnalysis in Apache 2.0 version! #dependencies_available.append("MDANALYSIS")
import MDAnalysis as mda
dependencies_available.append("MDANALYSIS")
except:
pass
......
......@@ -21,8 +21,8 @@ import shutil
#import numpy as np
from scoria import dumbpy as np
# No MDAnalysis in Apache 2.0 version! #try: import MDAnalysis # pypy shouldn't be able to load this.
# No MDAnalysis in Apache 2.0 version! #except: pass
try: import MDAnalysis # pypy shouldn't be able to load this.
except: pass
import scoria
import shutil
......@@ -167,35 +167,35 @@ class FileIOTests(unittest.TestCase):
self.assertEqual(self.mol.get_total_number_of_atoms(), 401)
self.assertEqual(self.mol.get_remarks(), [" This is a remark."])
# No MDAnalysis in Apache 2.0 version! #def test_load_MDAnalysis_into(self):
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # Empty test.
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # test_dcd = self.info_path + 'single_frame.dcd'
# No MDAnalysis in Apache 2.0 version! # test_psf = self.info_path + 'single_frame.psf'
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.mol.load_MDAnalysis_into(test_psf, test_dcd)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.assertEqual(self.mol.get_total_number_of_atoms(), 401)
# No MDAnalysis in Apache 2.0 version! # self.assertEqual(self.mol.get_remarks()[0:2],
# No MDAnalysis in Apache 2.0 version! # [' Created by DCD plugin\x00',
# No MDAnalysis in Apache 2.0 version! # ' \x00\x00\x00REMARKS Created 03 January, 2017 at'])
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! #def test_load_MDAnalysis_into_using_universe_object(self):
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # Empty test.
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # test_dcd = self.info_path + 'single_frame.dcd'
# No MDAnalysis in Apache 2.0 version! # test_psf = self.info_path + 'single_frame.psf'
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # universe = MDAnalysis.Universe(test_psf, test_dcd)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.mol.load_MDAnalysis_into_using_universe_object(universe)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.assertEqual(self.mol.get_total_number_of_atoms(), 401)
# No MDAnalysis in Apache 2.0 version! # self.assertEqual(self.mol.get_remarks()[0:2],
# No MDAnalysis in Apache 2.0 version! # [' Created by DCD plugin\x00',
# No MDAnalysis in Apache 2.0 version! # ' \x00\x00\x00REMARKS Created 03 January, 2017 at'])
def test_load_MDAnalysis_into(self):
"""
Empty test.
"""
test_dcd = self.info_path + 'single_frame.dcd'
test_psf = self.info_path + 'single_frame.psf'
self.mol.load_MDAnalysis_into(test_psf, test_dcd)
self.assertEqual(self.mol.get_total_number_of_atoms(), 401)
self.assertEqual(self.mol.get_remarks()[0:2],
[' Created by DCD plugin\x00',
' \x00\x00\x00REMARKS Created 03 January, 2017 at'])
def test_load_MDAnalysis_into_using_universe_object(self):
"""
Empty test.
"""
test_dcd = self.info_path + 'single_frame.dcd'
test_psf = self.info_path + 'single_frame.psf'
universe = MDAnalysis.Universe(test_psf, test_dcd)
self.mol.load_MDAnalysis_into_using_universe_object(universe)
self.assertEqual(self.mol.get_total_number_of_atoms(), 401)
self.assertEqual(self.mol.get_remarks()[0:2],
[' Created by DCD plugin\x00',
' \x00\x00\x00REMARKS Created 03 January, 2017 at'])
# Test Save functions
......
......@@ -23,8 +23,8 @@ from scoria import dumbpy as np
import scoria
# No MDAnalysis in Apache 2.0 version! #try: import MDAnalysis as mda # pypy shouldn't be able to load this.
# No MDAnalysis in Apache 2.0 version! #except: pass
try: import MDAnalysis as mda # pypy shouldn't be able to load this.
except: pass
from ..six.moves import range
......@@ -45,8 +45,8 @@ class InformationTests(unittest.TestCase):
self.mol = scoria.Molecule(info_path + '3_mol_test.pdb')
self.mdaU = None
# No MDAnalysis in Apache 2.0 version! #try: self.mdaU = mda.Universe(info_path + '3_mol_test.pdb')
# No MDAnalysis in Apache 2.0 version! #except: self.mdaU = None # In case of pypy use
try: self.mdaU = mda.Universe(info_path + '3_mol_test.pdb')
except: self.mdaU = None # In case of pypy use
self.accuracy = 4
......@@ -89,8 +89,8 @@ class InformationTests(unittest.TestCase):
mda_center = center_of_mass # pypy case. Basically now just error
# checking for pypy, since below will
# always be true.
# No MDAnalysis in Apache 2.0 version! #if self.mdaU is not None:
# No MDAnalysis in Apache 2.0 version! # mda_center = self.mdaU.atoms.center_of_mass()
if self.mdaU is not None:
mda_center = self.mdaU.atoms.center_of_mass()
self.assertAlmostEqual(center_of_mass[0], mda_center[0], self.accuracy)
self.assertAlmostEqual(center_of_mass[1], mda_center[1], self.accuracy)
......@@ -167,8 +167,8 @@ class InformationTests(unittest.TestCase):
mda_center = geo_center # pypy case. Basically now just error
# checking for pypy, since below will
# always be true.
# No MDAnalysis in Apache 2.0 version! #if self.mdaU is not None:
# No MDAnalysis in Apache 2.0 version! # mda_center = self.mdaU.atoms.center_of_geometry()
if self.mdaU is not None:
mda_center = self.mdaU.atoms.center_of_geometry()
self.assertAlmostEqual(geo_center[0], mda_center[0], self.accuracy)
self.assertAlmostEqual(geo_center[1], mda_center[1], self.accuracy)
......@@ -190,8 +190,8 @@ class InformationTests(unittest.TestCase):
expected_mass = total_mass # pypy case. Basically now just error
# checking for pypy, since below will
# always be true.
# No MDAnalysis in Apache 2.0 version! #if self.mdaU is not None:
# No MDAnalysis in Apache 2.0 version! # expected_mass = self.mdaU.atoms.total_mass()
if self.mdaU is not None:
expected_mass = self.mdaU.atoms.total_mass()
self.assertAlmostEqual(total_mass, expected_mass, 1)
......@@ -269,35 +269,35 @@ class InformationTests(unittest.TestCase):
# The bounding box, having several parameters, should have some
# comprehensive tests written for it.
# No MDAnalysis in Apache 2.0 version! #def test_get_default_bounding_box(self):
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # Tests that the bounding box can be calculated.
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # test_box = self.mdaU.atoms.bbox()
# No MDAnalysis in Apache 2.0 version! # bounding_box = self.mol.get_bounding_box(None, 0.0, 0)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.assertAlmostEqual(bounding_box[0][0], test_box[0][0], self.accuracy)
# No MDAnalysis in Apache 2.0 version! # self.assertAlmostEqual(bounding_box[0][1], test_box[0][1], self.accuracy)
# No MDAnalysis in Apache 2.0 version! # self.assertAlmostEqual(bounding_box[0][2], test_box[0][2], self.accuracy)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.assertAlmostEqual(bounding_box[1][0], test_box[1][0], self.accuracy)
# No MDAnalysis in Apache 2.0 version! # self.assertAlmostEqual(bounding_box[1][1], test_box[1][1], self.accuracy)
# No MDAnalysis in Apache 2.0 version! # self.assertAlmostEqual(bounding_box[1][2], test_box[1][2], self.accuracy)
def test_get_default_bounding_box(self):
"""
Tests that the bounding box can be calculated.
"""
test_box = self.mdaU.atoms.bbox()
bounding_box = self.mol.get_bounding_box(None, 0.0, 0)
self.assertAlmostEqual(bounding_box[0][0], test_box[0][0], self.accuracy)
self.assertAlmostEqual(bounding_box[0][1], test_box[0][1], self.accuracy)
self.assertAlmostEqual(bounding_box[0][2], test_box[0][2], self.accuracy)
self.assertAlmostEqual(bounding_box[1][0], test_box[1][0], self.accuracy)
self.assertAlmostEqual(bounding_box[1][1], test_box[1][1], self.accuracy)
self.assertAlmostEqual(bounding_box[1][2], test_box[1][2], self.accuracy)
# Similar to the bounding box tests, we need to check that all
# parameters work properly.
# No MDAnalysis in Apache 2.0 version! #def test_get_bounding_sphere(self):
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # Tests that the bounding sphere can be calculated.
# No MDAnalysis in Apache 2.0 version! # """
# No MDAnalysis in Apache 2.0 version! # mda_sphere = self.mdaU.atoms.bsphere()
# No MDAnalysis in Apache 2.0 version! # bounding_sphere = self.mol.get_bounding_sphere(None, 0.0, 0)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.assertAlmostEqual(bounding_sphere[0][0], mda_sphere[1][0], self.accuracy)
# No MDAnalysis in Apache 2.0 version! # self.assertAlmostEqual(bounding_sphere[0][1], mda_sphere[1][1], self.accuracy)
# No MDAnalysis in Apache 2.0 version! # self.assertAlmostEqual(bounding_sphere[0][2], mda_sphere[1][2], self.accuracy)
# No MDAnalysis in Apache 2.0 version! #
# No MDAnalysis in Apache 2.0 version! # self.assertAlmostEqual(bounding_sphere[1], mda_sphere[0], self.accuracy)
def test_get_bounding_sphere(self):
"""
Tests that the bounding sphere can be calculated.
"""
mda_sphere = self.mdaU.atoms.bsphere()
bounding_sphere = self.mol.get_bounding_sphere(None, 0.0, 0)
self.assertAlmostEqual(bounding_sphere[0][0], mda_sphere[1][0], self.accuracy)
self.assertAlmostEqual(bounding_sphere[0][1], mda_sphere[1][1], self.accuracy)
self.assertAlmostEqual(bounding_sphere[0][2], mda_sphere[1][2], self.accuracy)
self.assertAlmostEqual(bounding_sphere[1], mda_sphere[0], self.accuracy)
@unittest.skip("Needs test written")
def test_get_constants(self):
......
This diff is collapsed.
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