diff --git a/store/eval.py b/store/eval.py index 9ca42b3..505b589 100755 --- a/store/eval.py +++ b/store/eval.py @@ -34,7 +34,7 @@ def locate(fname, namespace=''): def open_sim(directory, maxcache=None): tr = None - if len(glob(os.path.join(directory, 'nojump.xtc'))) is 1: + if len(glob(os.path.join(directory, 'nojump.xtc'))) == 1: tr = md.open(directory, trajectory='nojump.xtc', cached=maxcache, reindex=True) else: tr = md.open(directory, trajectory='out/*.xtc', cached=maxcache, reindex=True, nojump=True) diff --git a/store/store.py b/store/store.py index b6cd8d6..b3a29f9 100755 --- a/store/store.py +++ b/store/store.py @@ -123,7 +123,7 @@ class Simulation(Base): def __repr__(self): attrs = [] for attr, val in self.__dict__.items(): - if attr[0] is not '_' and attr is not 'type': + if attr[0] != '_' and attr != 'type': attrs.append('{}={}'.format(attr, val)) return '<{classname}({attributes})>'.format(classname=self.__class__.__name__, attributes=', '.join(attrs)) @@ -208,7 +208,7 @@ class Evaluation(Base): def __repr__(self): attrs = [] for attr, val in self.__dict__.items(): - if attr[0] is not '_' and attr not in ['type', 'data']: + if attr[0] != '_' and attr not in ['type', 'data']: attrs.append('{}={}'.format(attr, val)) return '<{classname}({attributes})>'.format(classname=self.__class__.__name__, attributes=', '.join(attrs)) @@ -227,7 +227,7 @@ def float_query(value, dbattr): crit = dbattr == float(value) elif isinstance(value, str): limits = value.split('-') - if len(limits) is 2: + if len(limits) == 2: try: limits = [float(x) for x in limits] except: diff --git a/store/utils.py b/store/utils.py index 922cfac..0c8c854 100755 --- a/store/utils.py +++ b/store/utils.py @@ -30,7 +30,7 @@ def number_shorthand(x): return True elif isinstance(x, str): limits = x.split('-') - if len(limits) is 2: + if len(limits) == 2: try: limits = [float(a) for a in limits] except: