Skip to content

Commit 226ba06

Browse files
committed
Removed get_onboard_QC_df
1 parent 4892d06 commit 226ba06

2 files changed

Lines changed: 0 additions & 70 deletions

File tree

syncropatch_export/trace.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -319,32 +319,3 @@ def get_onboard_QC_values(self, sweeps=None):
319319

320320
return out_dict
321321

322-
def get_onboard_QC_df(self, sweeps=None):
323-
"""
324-
Create a Pandas DataFrame containing the seal resistance, membrane
325-
capacitance, and series resistance for each well and sweep.
326-
327-
Returns:
328-
A ``pandas.DataFrame`` with the onboard QC estimates.
329-
330-
"""
331-
332-
QC_dict = self.get_onboard_QC_values(sweeps)
333-
334-
if sweeps is None:
335-
sweeps = list(range(self.NofSweeps))
336-
337-
df_rows = []
338-
for sweep in sweeps:
339-
for well in self.WELL_ID.flatten():
340-
Rseal, Capacitance, Rseries = QC_dict[well][sweep]
341-
df_row = {'Rseal': Rseal,
342-
'Cm': Capacitance,
343-
'Rseries': Rseries,
344-
'well': well,
345-
'sweep': sweep
346-
}
347-
df_rows.append(df_row)
348-
349-
return pd.DataFrame.from_records(df_rows)
350-

tests/test_trace_class.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -119,47 +119,6 @@ def test_get_traces(self):
119119
self.assertRaisesRegex(ValueError, 'Invalid sweep selection',
120120
self.trace.get_trace_sweeps, [-3])
121121

122-
'''
123-
# plot test output
124-
if False:
125-
d = 'test_output'
126-
if not os.path.exists(d):
127-
os.makedirs(d)
128-
129-
import matplotlib.pyplot as plt
130-
fig, (ax1, ax2) = plt.subplots(2, 1)
131-
ax1.set_title('Example Sweeps')
132-
some_sweeps = self.trace.get_trace_sweeps([0])['A01']
133-
134-
ax1.plot(ts, np.transpose(some_sweeps), color='grey', alpha=0.5)
135-
ax1.set_ylabel('Current')
136-
ax1.set_xlabel('Time')
137-
ax2.set_title('Voltage Protocol')
138-
ax2.plot(ts, v)
139-
ax2.set_ylabel('Voltage')
140-
ax2.set_xlabel('Time')
141-
plt.tight_layout()
142-
plt.savefig(os.path.join(d, 'example_trace'))
143-
plt.close(fig)
144-
'''
145-
146-
def test_qc_df(self):
147-
dfs = [self.trace.get_onboard_QC_df(sweeps=[0]),
148-
self.trace.get_onboard_QC_df(sweeps=None)]
149-
for res in dfs:
150-
# Check res is a pd.DataFrame
151-
self.assertIsInstance(res, pd.DataFrame)
152-
153-
# Check it contains data (number of rows>0)
154-
self.assertGreater(res.shape[0], 0)
155-
156-
# Check it contains all quality control parameters
157-
for qcParam in ['Rseal', 'Cm', 'Rseries', 'well', 'sweep']:
158-
self.assertIn(qcParam, res)
159-
160-
# Check restricting number of sweeps returns less data
161-
self.assertLess(dfs[0].shape[0], dfs[1].shape[0])
162-
163122

164123
if __name__ == '__main__':
165124
unittest.main() # pragma: no cover

0 commit comments

Comments
 (0)