@@ -91,24 +91,30 @@ def inverse_transform(self, x):
9191
9292 def run (self , timeout = None , check = None ):
9393 if self .filename is not None :
94- data = subprocess .run ([self .cadet_path , self .filename ], timeout = timeout , check = check , stdout = subprocess . PIPE , stderr = subprocess . PIPE )
94+ data = subprocess .run ([self .cadet_path , self .filename ], timeout = timeout , check = check , capture_output = True )
9595 self .return_information = data
9696 return data
9797 else :
9898 print ("Filename must be set before run can be used" )
9999
100100def recursively_load ( h5file , path , func , paths ):
101-
102- ans = {}
103- for key_original in h5file [path ].keys ():
104- key = func (key_original )
105- local_path = path + key
106- if paths is None or (paths is not None and local_path in paths ):
101+ ans = Dict ()
102+ if paths is not None :
103+ for path in paths :
104+ item = h5file [path ]
105+ if isinstance (item , h5py ._hl .dataset .Dataset ):
106+ ans [path [1 :]] = item [()]
107+ elif isinstance (item , h5py ._hl .group .Group ):
108+ ans [path [1 :]] = recursively_load (h5file , path + '/' , func , None )
109+ else :
110+ for key_original in h5file [path ].keys ():
111+ key = func (key_original )
112+ local_path = path + key
107113 item = h5file [path ][key_original ]
108114 if isinstance (item , h5py ._hl .dataset .Dataset ):
109115 ans [key ] = item [()]
110116 elif isinstance (item , h5py ._hl .group .Group ):
111- ans [key ] = recursively_load (h5file , local_path + '/' , func , paths )
117+ ans [key ] = recursively_load (h5file , local_path + '/' , func , None )
112118 return ans
113119
114120def recursively_save ( h5file , path , dic , func ):
0 commit comments