Skip to content

Commit dee3dec

Browse files
authored
Merge pull request #40 from CardiacModelling/dependencies
Updated dependencies and removed get_onboard_QC_df
2 parents 7cf50fc + 5527ce9 commit dee3dec

4 files changed

Lines changed: 9 additions & 90 deletions

File tree

.github/workflows/pytest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
python-version: [3.8, 3.9, '3.10', 3.11, 3.12, 3.13]
9+
python-version: ['3.10', 3.11, 3.12, 3.13, 3.14]
1010
steps:
1111
- name: Checkout repository
1212
uses: actions/checkout@v4
@@ -41,5 +41,5 @@ jobs:
4141
- uses: codecov/codecov-action@v4
4242
with:
4343
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
44-
if: matrix.python-version == 3.13
44+
if: matrix.python-version == 3.14
4545

setup.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
# Module name (lowercase)
2020
name='syncropatch_export',
2121
version=version,
22-
description='Post-process high-throughput patch-clamp data',
22+
description='Reads syncropatch data',
2323
long_description=readme,
24-
long_description_content_type="text/markdown",
25-
author='Frankie Patten-Elliot, Joseph Shuttleworth, Chon Lok Lei',
24+
long_description_content_type='text/markdown',
25+
author='Frankie Patten-Elliot, Joseph Shuttleworth, Chon Lok Lei, Michael Clerx',
2626
author_email='joseph.shuttleworth@nottingham.ac.uk',
2727
maintainer='Joseph Shuttleworth',
2828
maintainer_email='joseph.shuttleworth@nottingham.ac.uk',
2929
# url='https://github.com/CardiacModelling/markov-builder',
3030
classifiers=[
31-
"Programming Language :: Python :: 3",
32-
"License :: OSI Approved :: BSD License",
33-
"Operating System :: OS Independent",
31+
'Programming Language :: Python :: 3',
32+
'License :: OSI Approved :: BSD License',
33+
'Operating System :: OS Independent',
3434
],
3535

3636
# Packages to include
@@ -41,23 +41,18 @@
4141
include_package_data=True,
4242

4343
# Required Python version
44-
python_requires='>=3.7',
44+
python_requires='>=3.10',
4545

4646
# List of dependencies
4747
install_requires=[
48-
'scipy>=1.7',
4948
'numpy>=1.21',
50-
'matplotlib>=3.4',
51-
'pandas>=1.3',
52-
'regex>=2023.12.25'
5349
],
5450
extras_require={
5551
'test': [
5652
'pytest-cov>=2.10', # For coverage checking
5753
'pytest>=4.6', # For unit tests
5854
'flake8>=3', # For code style checking
5955
'isort',
60-
'mock>=3.0.5', # For mocking command line args etc.
6156
'codecov>=2.1.3',
6257
],
6358
'docs': [

syncropatch_export/trace.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import string
44

55
import numpy as np
6-
import pandas as pd
76

87
from .voltage_protocols import VoltageProtocol
98

@@ -319,32 +318,3 @@ def get_onboard_QC_values(self, sweeps=None):
319318

320319
return out_dict
321320

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 & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import unittest
66

77
import numpy as np
8-
import pandas as pd
98

109
from syncropatch_export.trace import Trace
1110
from syncropatch_export.voltage_protocols import VoltageProtocol
@@ -89,10 +88,6 @@ def test_protocol_get_ramps(self):
8988
def test_get_QC(self):
9089
QC_values = self.trace.get_onboard_QC_values()
9190
self.assertGreater(len(QC_values), 0)
92-
df = self.trace.get_onboard_QC_df()
93-
94-
self.assertGreater(df.shape[0], 0)
95-
self.assertGreater(df.shape[1], 0)
9691

9792
def test_get_traces(self):
9893
v = self.trace.get_voltage()
@@ -119,47 +114,6 @@ def test_get_traces(self):
119114
self.assertRaisesRegex(ValueError, 'Invalid sweep selection',
120115
self.trace.get_trace_sweeps, [-3])
121116

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-
163117

164118
if __name__ == '__main__':
165119
unittest.main() # pragma: no cover

0 commit comments

Comments
 (0)