Replaced is and is not
This commit is contained in:
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
Reference in New Issue
Block a user