Skip to content

Commit

Permalink
change h5py reading function
Browse files Browse the repository at this point in the history
  • Loading branch information
SasLeo committed Dec 1, 2021
1 parent edc3d7e commit dc1e07d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions filtering/model_filtering_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def print_income(self):
elif not path.isdir(dir_.rsplit('/', 1)[0]):
error = f'You need to choose a valid directory'
else:
data, summary = self.import_data()
self.data_signal.emit([data, summary])
data, summary, columns = self.import_data()
self.data_signal.emit([data, summary, columns])

if error:
self.error.emit(error)
Expand All @@ -65,10 +65,9 @@ def import_data(self):
with h5py.File(self.inputs, 'r') as f:
label_set = f['r_vs_thresh'].attrs['best'][0].decode()
labels = np.asarray(f['labels/' + label_set][()])
columns_data = f['data'].attrs['colnames'] - 1
columns_data = columns_data.tolist()
self.data_cols = f['data'].attrs['colnames'] - 1
self.dataset = pd.DataFrame(f['data'][()]).iloc[:, columns_data]
self.data_cols = f['data'].attrs['datacolumns'] - 1
self.data_cols.tolist()
self.dataset = pd.DataFrame(f['data'][()])
self.summary_table = pd.DataFrame(f['summarytable'][()])

labels = self.single_values(labels)
Expand Down

0 comments on commit dc1e07d

Please sign in to comment.