@@ -38,7 +38,7 @@ def get_seed(seed, ID=0, EID=0):
3838 return seed + EID + 100 * ID
3939
4040
41- def hash_ (x ):
41+ def hashfunc (x ):
4242 return hashlib .sha1 (repr (x ).encode ()).hexdigest ()
4343
4444
@@ -166,7 +166,7 @@ def __init__(self, num_particles, D, box, rs=None, seed=1, particles=None):
166166 self ._plist = self ._generate (num_particles , D , box , rs )
167167 else :
168168 self ._plist = list (particles )
169- self .rs_hash = hash_ (self .init_random_state )[:3 ]
169+ self .rs_hash = hashfunc (self .init_random_state )[:3 ]
170170
171171 def add (self , num_particles , D ):
172172 """Add particles with diffusion coefficient `D` at random positions.
@@ -505,8 +505,8 @@ def _open_store(self, store, prefix='', path='./', chunksize=2**19,
505505 attr_params = dict (particles = self .particles .to_json (), box = self .box )
506506 kwargs = dict (path = path , nparams = nparams , attr_params = attr_params ,
507507 mode = mode )
508- store = store (store_fname , ** kwargs )
509- return store
508+ store_obj = store (store_fname , ** kwargs )
509+ return store_obj
510510
511511 def open_store_traj (self , path = './' , chunksize = 2 ** 19 , chunkslice = 'bytes' ,
512512 mode = 'w' , radial = False ):
@@ -711,7 +711,7 @@ def _get_ts_name_mix_core(self, max_rates, populations, bg_rate,
711711 def _get_ts_name_mix (self , max_rates , populations , bg_rate , rs ,
712712 hashsize = 6 ):
713713 s = self ._get_ts_name_mix_core (max_rates , populations , bg_rate )
714- return '%s_rs_%s' % (s , hash_ (rs .get_state ())[:hashsize ])
714+ return '%s_rs_%s' % (s , hashfunc (rs .get_state ())[:hashsize ])
715715
716716 def timestamps_match_pattern (self , pattern ):
717717 return [t for t in self .timestamp_names if pattern in t ]
0 commit comments