Skip to content
Snippets Groups Projects
Commit d941ea9c authored by Carl Poelking's avatar Carl Poelking
Browse files

Backward compatibility fix.

parent ea6e13c7
No related branches found
No related tags found
No related merge requests found
...@@ -66,11 +66,12 @@ class Graph(object): ...@@ -66,11 +66,12 @@ class Graph(object):
data=self.P, data=self.P,
compression='gzip', compression='gzip',
dtype=dtype) dtype=dtype)
group.create_dataset( if type(self.P_avg) != type(None):
'feature_mat_avg', group.create_dataset(
data=self.P_avg, 'feature_mat_avg',
compression='gzip', data=self.P_avg,
dtype=dtype) compression='gzip',
dtype=dtype)
else: raise NotImplementedError(self.P_type_str) else: raise NotImplementedError(self.P_type_str)
group.create_dataset('position_mat', data=self.R) group.create_dataset('position_mat', data=self.R)
group.create_dataset('connectivity_mat', data=self.C) group.create_dataset('connectivity_mat', data=self.C)
...@@ -107,7 +108,9 @@ class Graph(object): ...@@ -107,7 +108,9 @@ class Graph(object):
self.P_avg[key] = g0_avg[key].value self.P_avg[key] = g0_avg[key].value
elif self.P_type_str == "<type 'numpy.ndarray'>": elif self.P_type_str == "<type 'numpy.ndarray'>":
self.P = h5f['feature_mat'].value self.P = h5f['feature_mat'].value
self.P_avg = h5f['feature_mat_avg'].value if 'feature_mat_avg' in h5f:
self.P_avg = h5f['feature_mat_avg'].value
else: self.P_avg = None
else: raise NotImplementedError(self.P_type_str) else: raise NotImplementedError(self.P_type_str)
self.R = h5f['position_mat'].value self.R = h5f['position_mat'].value
self.C = h5f['connectivity_mat'].value self.C = h5f['connectivity_mat'].value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment