@@ -196,23 +196,26 @@ def full_version_record(self):
196196 dict
197197 Dictionary of package versions for dependencies
198198 """
199- versions = {'rex' : __version__ ,
199+ versions = {'python' : sys .version ,
200+ 'rex' : __version__ ,
201+ 'h5py' : h5py .__version__ ,
202+ 'h5pyd' : h5pyd .__version__ ,
200203 'pandas' : pd .__version__ ,
201204 'numpy' : np .__version__ ,
202- 'python ' : sys . version ,
205+ 'scipy ' : scipy . __version__ ,
203206 'click' : click .__version__ ,
204- 'h5py' : h5py .__version__ ,
205- 'h5pyd' : h5pyd .__version__ ,
206- 'scipy' : scipy .__version__
207207 }
208208 return versions
209209
210210 def set_version_attr (self ):
211211 """Set the version attribute to the h5 file."""
212- self .h5 .attrs ['version' ] = __version__
213- self .h5 .attrs ['full_version_record' ] = json .dumps (
214- self .full_version_record )
215- self .h5 .attrs ['package' ] = 'rex'
212+ new_attrs = {'version' : __version__ ,
213+ 'full_version_record' : json .dumps (
214+ self .full_version_record ),
215+ 'package' : 'rex' }
216+ for name , value in new_attrs .items ():
217+ if name not in self .h5 .attrs :
218+ self .h5 .attrs [name ] = value
216219
217220 @property
218221 def version (self ):
@@ -568,7 +571,7 @@ def _check_chunks(self, chunks, data=None):
568571 msg = ('Shape dimensions ({}) are not the same length as chunks '
569572 '({}). Please provide a single chunk value for each '
570573 'dimension!'
571- .format (shape , chunks ))
574+ .format (shape , chunks ))
572575 logger .error (msg )
573576 raise HandlerRuntimeError (msg )
574577
@@ -748,6 +751,7 @@ def update_dset(self, dset, dset_array, dset_slice=None):
748751
749752 keys = (dset , ) + dset_slice
750753
754+ # pylint: disable=unnecessary-dunder-call
751755 arr = self .__getitem__ (keys )
752756 if not np .array_equal (arr , dset_array ):
753757 self ._set_ds_array (dset , dset_array , dset_slice )
0 commit comments