reset the attribute manager to default
This commit is contained in:
parent
85010a8d6d
commit
8bb193cc70
|
@ -83,6 +83,20 @@ class AttributeManagerNullterm(h5py.AttributeManager):
|
|||
else:
|
||||
super().create(name=name,data=data,shape=shape,dtype=dtype)
|
||||
|
||||
class ResetAttributeManager(h5py.AttributeManager):
|
||||
"""
|
||||
Reset the attribute management for DREAM.3D hdf5 files.
|
||||
|
||||
References
|
||||
----------
|
||||
https://stackoverflow.com/questions/38267076
|
||||
https://stackoverflow.com/questions/52750232
|
||||
|
||||
"""
|
||||
|
||||
def create(self, name, data, shape=None, dtype=None):
|
||||
super().create(name=name,data=data,shape=shape,dtype=dtype)
|
||||
|
||||
|
||||
class Result:
|
||||
"""
|
||||
|
@ -2076,6 +2090,9 @@ class Result:
|
|||
o[geom_label].attrs['SpatialDimensionality'] = np.array([3],np.uint32)
|
||||
o[geom_label].attrs['UnitDimensionality'] = np.array([3],np.uint32)
|
||||
|
||||
h5py._hl.attrs.AttributeManager = ResetAttributeManager # Reset the attribute manager to original
|
||||
|
||||
|
||||
def export_DADF5(self,
|
||||
fname,
|
||||
output: Union[str, List[str]] = '*',
|
||||
|
|
Loading…
Reference in New Issue