diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 18fee45..01c1df8 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, '3.10', 3.11, 3.12, 3.13] + python-version: ['3.10', 3.11, 3.12, 3.13, 3.14] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -41,5 +41,5 @@ jobs: - uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - if: matrix.python-version == 3.13 + if: matrix.python-version == 3.14 diff --git a/setup.py b/setup.py index af05e42..71d356c 100644 --- a/setup.py +++ b/setup.py @@ -19,18 +19,18 @@ # Module name (lowercase) name='syncropatch_export', version=version, - description='Post-process high-throughput patch-clamp data', + description='Reads syncropatch data', long_description=readme, - long_description_content_type="text/markdown", - author='Frankie Patten-Elliot, Joseph Shuttleworth, Chon Lok Lei', + long_description_content_type='text/markdown', + author='Frankie Patten-Elliot, Joseph Shuttleworth, Chon Lok Lei, Michael Clerx', author_email='joseph.shuttleworth@nottingham.ac.uk', maintainer='Joseph Shuttleworth', maintainer_email='joseph.shuttleworth@nottingham.ac.uk', # url='https://github.com/CardiacModelling/markov-builder', classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: BSD License", - "Operating System :: OS Independent", + 'Programming Language :: Python :: 3', + 'License :: OSI Approved :: BSD License', + 'Operating System :: OS Independent', ], # Packages to include @@ -41,15 +41,11 @@ include_package_data=True, # Required Python version - python_requires='>=3.7', + python_requires='>=3.10', # List of dependencies install_requires=[ - 'scipy>=1.7', 'numpy>=1.21', - 'matplotlib>=3.4', - 'pandas>=1.3', - 'regex>=2023.12.25' ], extras_require={ 'test': [ @@ -57,7 +53,6 @@ 'pytest>=4.6', # For unit tests 'flake8>=3', # For code style checking 'isort', - 'mock>=3.0.5', # For mocking command line args etc. 'codecov>=2.1.3', ], 'docs': [ diff --git a/syncropatch_export/trace.py b/syncropatch_export/trace.py index 23b6ad3..2737fb5 100644 --- a/syncropatch_export/trace.py +++ b/syncropatch_export/trace.py @@ -3,7 +3,6 @@ import string import numpy as np -import pandas as pd from .voltage_protocols import VoltageProtocol @@ -319,32 +318,3 @@ def get_onboard_QC_values(self, sweeps=None): return out_dict - def get_onboard_QC_df(self, sweeps=None): - """ - Create a Pandas DataFrame containing the seal resistance, membrane - capacitance, and series resistance for each well and sweep. - - Returns: - A ``pandas.DataFrame`` with the onboard QC estimates. - - """ - - QC_dict = self.get_onboard_QC_values(sweeps) - - if sweeps is None: - sweeps = list(range(self.NofSweeps)) - - df_rows = [] - for sweep in sweeps: - for well in self.WELL_ID.flatten(): - Rseal, Capacitance, Rseries = QC_dict[well][sweep] - df_row = {'Rseal': Rseal, - 'Cm': Capacitance, - 'Rseries': Rseries, - 'well': well, - 'sweep': sweep - } - df_rows.append(df_row) - - return pd.DataFrame.from_records(df_rows) - diff --git a/tests/test_trace_class.py b/tests/test_trace_class.py index bee8289..1d2de6c 100755 --- a/tests/test_trace_class.py +++ b/tests/test_trace_class.py @@ -5,7 +5,6 @@ import unittest import numpy as np -import pandas as pd from syncropatch_export.trace import Trace from syncropatch_export.voltage_protocols import VoltageProtocol @@ -89,10 +88,6 @@ def test_protocol_get_ramps(self): def test_get_QC(self): QC_values = self.trace.get_onboard_QC_values() self.assertGreater(len(QC_values), 0) - df = self.trace.get_onboard_QC_df() - - self.assertGreater(df.shape[0], 0) - self.assertGreater(df.shape[1], 0) def test_get_traces(self): v = self.trace.get_voltage() @@ -119,47 +114,6 @@ def test_get_traces(self): self.assertRaisesRegex(ValueError, 'Invalid sweep selection', self.trace.get_trace_sweeps, [-3]) - ''' - # plot test output - if False: - d = 'test_output' - if not os.path.exists(d): - os.makedirs(d) - - import matplotlib.pyplot as plt - fig, (ax1, ax2) = plt.subplots(2, 1) - ax1.set_title('Example Sweeps') - some_sweeps = self.trace.get_trace_sweeps([0])['A01'] - - ax1.plot(ts, np.transpose(some_sweeps), color='grey', alpha=0.5) - ax1.set_ylabel('Current') - ax1.set_xlabel('Time') - ax2.set_title('Voltage Protocol') - ax2.plot(ts, v) - ax2.set_ylabel('Voltage') - ax2.set_xlabel('Time') - plt.tight_layout() - plt.savefig(os.path.join(d, 'example_trace')) - plt.close(fig) - ''' - - def test_qc_df(self): - dfs = [self.trace.get_onboard_QC_df(sweeps=[0]), - self.trace.get_onboard_QC_df(sweeps=None)] - for res in dfs: - # Check res is a pd.DataFrame - self.assertIsInstance(res, pd.DataFrame) - - # Check it contains data (number of rows>0) - self.assertGreater(res.shape[0], 0) - - # Check it contains all quality control parameters - for qcParam in ['Rseal', 'Cm', 'Rseries', 'well', 'sweep']: - self.assertIn(qcParam, res) - - # Check restricting number of sweeps returns less data - self.assertLess(dfs[0].shape[0], dfs[1].shape[0]) - if __name__ == '__main__': unittest.main() # pragma: no cover