Commit e1365592 authored by eric pellegrini's avatar eric pellegrini

Modified the Selector class hierarchy with a MMTK.Trajectory instead of a...

Modified the Selector class hierarchy with a MMTK.Trajectory instead of a MMTK.Universe when initializing the class
parent a020b9f4
......@@ -38,9 +38,9 @@ class AtomFullName(ISelector):
section = "atoms"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
self._choices.extend(sorted(set([at.fullName().strip().lower() for at in self._universe.atomList()])))
......
......@@ -38,9 +38,9 @@ class AtomIndex(ISelector):
section = "atoms"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
self._choices.extend(sorted([at.index for at in self._universe.atomList()]))
......
......@@ -38,9 +38,9 @@ class AtomName(ISelector):
section = "atoms"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
self._choices.extend(sorted(set([at.name.strip().lower() for at in self._universe.atomList()])))
......
......@@ -38,9 +38,9 @@ class AtomSymbol(ISelector):
section = "atoms"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
self._choices.extend(sorted(set([at.symbol.strip().lower() for at in self._universe.atomList()])))
......
......@@ -38,9 +38,9 @@ class AtomType(ISelector):
section = "atoms"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
self._choices.extend(sorted(set([at.type.name.lower() for at in self._universe.atomList()])))
......
......@@ -38,9 +38,9 @@ class CarboHydrogen(ISelector):
section = "hydrogens"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
for obj in self._universe.objectList():
......
......@@ -40,9 +40,9 @@ class ChainName(ISelector):
section = "proteins"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
for obj in self._universe.objectList():
if isinstance(obj, (PeptideChain, Protein)):
......
......@@ -38,9 +38,9 @@ class HeteroHydrogenBound(ISelector):
section = "hydrogens"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
for obj in self._universe.objectList():
......
......@@ -44,9 +44,9 @@ class ISelector(object):
type = "selector"
def __init__(self,universe):
def __init__(self,trajectory):
self._universe = universe
self._universe = trajectory.universe
self._choices = ["*"]
......
......@@ -43,9 +43,9 @@ class Macromolecule(ISelector):
lookup = {NucleotideChain:"nucleotide_chain",PeptideChain:"peptide_chain",Protein:"protein"}
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
self._choices.extend(["peptide_chain","protein","nucleotide_chain"])
......
......@@ -38,9 +38,9 @@ class MoleculeIndex(ISelector):
section = "molecules"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
self._choices.extend(range(len(self._universe.objectList())))
......
......@@ -38,9 +38,9 @@ class MoleculeName(ISelector):
section = "molecules"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
self._choices.extend(sorted(set([obj.name for obj in self._universe.objectList()])))
......
......@@ -38,9 +38,9 @@ class NitroHydrogen(ISelector):
section = "hydrogens"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
for obj in self._universe.objectList():
......
......@@ -40,9 +40,9 @@ class NuclName(ISelector):
section = "nucleic acids"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
for obj in self._universe.objectList():
if isinstance(obj, NucleotideChain):
......
......@@ -40,9 +40,9 @@ class NucleotideType(ISelector):
section = "nucleic acids"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
for obj in self._universe.objectList():
if isinstance(obj, NucleotideChain):
......
......@@ -38,9 +38,9 @@ class OxyHydrogen(ISelector):
section = "hydrogens"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
for obj in self._universe.objectList():
......
......@@ -33,7 +33,7 @@ Created on Mar 27, 2015
import glob
import os
from MDANSE import PREFERENCES
from MDANSE import PLATFORM
from MDANSE.Framework.Selectors.ISelector import ISelector
class PythonScript(ISelector):
......@@ -42,13 +42,13 @@ class PythonScript(ISelector):
section = 'miscellaneous'
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
self._choices.extend(glob.glob(os.path.join(PREFERENCES['working_directory'].get_value(),'*.py')))
self._choices.extend(glob.glob(os.path.dirname(PLATFORM.get_path(trajectory.filename)),'*.py'))
self._rindexes = dict([(at.index,at) for at in universe.atomList()])
self._rindexes = dict([(at.index,at) for at in self._universe.atomList()])
def select(self, scripts):
......
......@@ -50,9 +50,9 @@ class ResClass(ISelector):
section = "proteins"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
self._choices.extend(sorted(CHEMFAMILIES.keys()))
......
......@@ -40,9 +40,9 @@ class ResidueName(ISelector):
section = "proteins"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
for obj in self._universe.objectList():
if isinstance(obj, (PeptideChain, Protein)):
......
......@@ -40,9 +40,9 @@ class ResType(ISelector):
section = "proteins"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
for obj in self._universe.objectList():
if isinstance(obj, (PeptideChain, Protein)):
......
......@@ -38,9 +38,9 @@ class OxyHydrogen(ISelector):
section = "hydrogens"
def __init__(self, universe):
def __init__(self, trajectory):
ISelector.__init__(self,universe)
ISelector.__init__(self,trajectory)
for obj in self._universe.objectList():
......
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