Skip to content

Commit 0bbd60e

Browse files
committed
Fix dataframe rendering on test
1 parent 776f12b commit 0bbd60e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

corems/mass_spectrum/input/coremsHDF5.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ def get_dataframe(self, scan_index=0, time_index=-1):
199199
data_dict = {}
200200
for data_index, data in enumerate(row):
201201
label = columnsLabels[data_index]
202+
# if data starts with a b' it is a byte string, so decode it
203+
if isinstance(data, bytes):
204+
data = data.decode("utf-8")
205+
if data == "nan":
206+
data = None
202207
data_dict[label] = data
203208

204209
list_dict.append(data_dict)

corems/mass_spectrum/input/massList.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def add_molecular_formula(self, mass_spec_obj, dataframe):
111111
else:
112112
adduct_atom = None
113113
mfobj = MolecularFormula(formula_list, int(ion_charge_df[df_index]), mspeak_parent=mass_spec_obj[ms_peak_index] , ion_type=ion_type, adduct_atom=adduct_atom)
114-
mfobj.is_isotopologue = bool(is_isotopologue_df[df_index])
114+
mfobj.is_isotopologue = bool(int(is_isotopologue_df[df_index]))
115115
mass_spec_obj[ms_peak_index].add_molecular_formula(mfobj)
116116

117117

0 commit comments

Comments
 (0)