diff --git a/.flake8 b/.flake8 index ec5b2da4..be3c8804 100644 --- a/.flake8 +++ b/.flake8 @@ -1,20 +1,17 @@ [flake8] -max_line_length = 120 ignore = - # allow empty line at end of file + # Allow block comments to start without a space after # + E265, + # Allow empty line at end of file W391, - # break before binary operator - allow either style - W503, - # break after binary operator - allow either style - W504, - # missing whitespace around arithmetic operator - E226, + # Allow breaks before and after binary operators + W503, W504, + # Allow assigning a lambda expression instead of using a def + E731, # Allow I, l and O as variable names E741, - - exclude= .git, venv, test_data, - test_output, + pcp1, diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3526af71..8ca53fdc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,10 +14,10 @@ jobs: if: github.event.pull_request.draft == false env: - python-latest: 3.14 + python-latest: '3.14' strategy: matrix: - python-version: ['3.10', 3.11, 3.12, 3.13, 3.14] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - name: Checkout repository @@ -31,12 +31,17 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install -e .[test] + python -m pip install -e .[dev] - name: Check code style with flake8 if: ${{ matrix.python-version == env.python-latest }} run: | - python -m flake8 pcpostprocess + python -m flake8 -j4 + + - name: Check typing with mypy + if: ${{ matrix.python-version == env.python-latest }} + run: | + python -m mypy - name: Extract test data run: | diff --git a/.gitignore b/.gitignore index 5624d80c..a6eb4b19 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,11 @@ -# Autogenerated by setuptools-wcm +# Autogenerated by setuptools-wcm during (developer) install pcpostprocess/_version.py # Tests and test data .coverage /test_data -/test_output -/output # Compiled python -*.pyc __pycache__ # Installation files @@ -19,10 +16,7 @@ __pycache__ # Virtual environments venv -env -# DS Store +# Annoyances .DS_Store - -# VS code config .vscode diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4d94ecc8..048eda48 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,7 +42,7 @@ When making changes, we try to follow the procedure below. **TODO: Once there is a "user" way to install, move the git clone etc. information here [#105](https://github.com/CardiacModelling/pcpostprocess/issues/105).** ``` -pip install -e .[test] +pip install -e .[dev] ``` ## Style guidelines @@ -62,6 +62,17 @@ In addition to the rules checked by flake8, we try to use single quotes (`'`) fo Class, method, and argument names are in UK english. +### Type hints + +We'll try to use [type hints](https://docs.python.org/3/library/typing.html), checked with [mypy](https://www.mypy-lang.org/). + +To run locally, use +``` +$ mypy +``` + +Mypy is configured in `pyproject.toml`. + ## Documentation Every method and every class should have a [docstring](https://www.python.org/dev/peps/pep-0257/) that describes in plain terms what it does, and what the expected input and output is. @@ -70,6 +81,48 @@ The only exception are unit test methods starting with `test_` - unit test class Each docstring should start with a one-line explanation. If more explanation is needed, this one-liner is followed by a blank line and more information in the following paragraphs. +Pcpostprocess uses the [Numpy docstring syntax](https://numpydoc.readthedocs.io/en/latest/format.html) for parameters and return values. +For example: + +``` +Single line explanation. + +Detailed, multi-line explanation. +Possibly with ``code`` examples or even latex :math:`\sqrt{x}`. + +Parameters +---------- +x : int + Description of parameter ``x``. +y : float, default=1 + Description of the optional parameter ``y``. If not set, the default value + 1 will be used +z : str, optional + Description of the optional parameter ``z``. If not given, ``z`` won't be + used. + +Returns +------- +float + Description of the returnved value +``` + +Return values can also be named, which is especially useful when there are multiple + +``` +Returns +------- +g: float + The estimated conductance, in nS. +E : float + The estimated reversal potential, in mV. +``` + +(Note that the numpy documentation currently suggests using single backticks ``` `x` ``` when describing parameters, but Sphinx doesn't fully support this yet. + Until this is fully supported, we will use double backticks as in the example above). + + + **TODO: READTHEDOCS [#60](https://github.com/CardiacModelling/pcpostprocess/issues/60)** **TODO: SYNTAX, RUNNING LOCALLY, ETC** diff --git a/LICENSE b/LICENSE index ae702ce7..59f891d7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2024-2025, University of Nottingham +Copyright (c) 2024-2026, University of Nottingham Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 0937ad28..f4055812 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This repository contains a python package and scripts for handling time-series d The package has been tested with data from a SyncroPatch 384, but may be adapted to work with data in other formats. It can also be used to perform quality control (QC) as described in [Lei et al. (2019)](https://doi.org/10.1016%2Fj.bpj.2019.07.029). -This package is tested on Ubuntu with Python 3.10, 3.11, 3.12, 3.13 and 3.14. +This package is tested on Ubuntu with Python 3.10 to 3.14. ## Getting Started @@ -27,7 +27,7 @@ Then install the package with `pip`. ```sh python3 -m pip install --upgrade pip -python3 -m pip install -e .'[test]' +python3 -m pip install -e .'[dev]' ``` To run the tests you must first download some test data. @@ -79,72 +79,6 @@ First, all four staircase protocols are checked in all wells using the Lei et al Any wells not rejected are then tested using a smaller set of (less protocol specific) criteria detailed in Shuttleworth et al. Only wells passing all tests on all protocols are retained. -### Writing an export_config.py - -Prior to performing QC and exporting, an `export_config.py` file should be added to the root of the data directory. -An example file is available [here](./example_config.py). -This should contain three entries: - -1. A `saveID` variable, providing a name to use in exported data. -2. A dictionary variable `Q2S_DC` indicating the name of the staircase protocol, and mapping it onto an more user-friendly name used in export. -3. A dictionary variable `D2S` indicating names of other protocols to export, again mapping onto names for export. - -For example, in the test data (see "Getting Started") above, we have six subdirectories: -- `staircaseramp (2)_2kHz_15.01.07`, staircase run as first protocol before E-4031 -- `StaircaseInStaircaseramp (2)_2kHz_15.01.51`, non-QC protocol -- `staircaseramp (2)_2kHz_15.06.53`, staircase run as last protocol before E-4031 -- `staircaseramp (2)_2kHz_15.11.33`, staircase run as first protocol after E-4031 addition -- `StaircaseInStaircaseramp (2)_2kHz_15.12.17`, non-QC protocol -- `staircaseramp (2)_2kHz_15.17.19`, staircase run as final protocol - -Here each directory name is a protocol name followed by a timestamp. -Corresponding dictionaries could be `Q2S_DC = {'staircaseramp (2)_2kHz': 'staircase'}` (indicating the staircase protocol) and `D2S = {'StaircaseInStaircaseramp (2)_2kHz': 'sis'}`. -The saveID could be any string, but in our example we use `saveID = '13112023_MW2'` - -### Running - -To run, we call `run_herg_qc` with: -```sh -pcpostprocess run_herg_qc test_data/13112023_MW2_FF -o output --output_traces -w A01 A02 A03 -``` -Here: -- `test_data/13112023_MW2_FF` is the path to the test data, -- `-o output` tells the script to store all results in the folder `output` -- `--output_traces` tells the script to export the data (instead of running QC only), and - -The last part, `-w A01 A02 A03`, tells the script to only check the first three wells. -This speeds things up for testing, but would be omitted in normal use. - -To see the full set of options, use - -```sh -$ pcpostprocess run_herg_qc --help -``` - -### Interpreting the output - -After running the command above on the test data provided, the directory `output` will contain the subdirectories: - -- `-120mV time constant` Plots illustrating the fits performed when estimating time constants. These are output but not used in QC. -- `leak_correction` Plots illustrating the _linear_ leak correction process in all wells passing staircase QC. -- `qc3-bookend` Plots illustrating the "QC3 bookend" criterion used in Shuttleworth et al. -- `reversal_plots` Plots illustrating the reversal potential estimation -- `subtraction_plots` Plots illustrating the drug subtracted trace leak removal. -- `traces` The exported traces (times, voltages, currents) - -and the files: - -- `chrono.txt` Lists the order in which protocols were run. For the staircase, the repeat at the end of the sequence is indicated by an added `_2`. -- `passed_wells.txt` Lists the wells that **passed all QC**. -- `pcpostprocess_info.txt` Information on the run that generated this output (date, time, command used etc.) -- `QC-13112023_MW2.csv` A CSV representation of the pass/fail results for each individual criterion -- `QC-13112023_MW2.json` A JSON representation of the same -- `qc_table.tex` A table in Tex format with the above. -- `qc_vals_df.csv` Numerical values used in the final QC. -- `selected-13112023_MW2.txt` **Preliminary QC selection** based on staircase protocol 1 (before other protocols) and 2 (after other protocols) -- `selected-13112023_MW2-staircaseramp.txt` Preliminary selection based on staircase 1 -- `selected-13112023_MW2-staircaseramp_2.txt` Preliminary selection based on staircase 2 -- `subtraction_qc.csv` Numerical values used in the final QC and leak subtraction. ## Contributing diff --git a/cases/proc-lei-2019.md b/cases/proc-lei-2019.md new file mode 100644 index 00000000..19f35b57 --- /dev/null +++ b/cases/proc-lei-2019.md @@ -0,0 +1,67 @@ +# Lei 2019 procedure + +## Per well + +1. `estimate_gE_leak_ramp` (staircase) or `estimate_gE_leak_step` (validation signals) + - linear regression + - **Figure S2B** in the publication (Rapid I) +2. `correct_gE_leak_ramp` + Having separate from estimation would allow estimate to be re-used on traces without ramps or suitable steps +3. E-4031 subtraction (0.5uM E-4031 vs dimethyl vehicle) + **Not sure where to implement** + - **Figure S2A** +4. `estimate_reversal_potential_ramp` + - Third order poylnomial + - **Figure S2C** or **Figure 10A** + - Output: EK + - In Chon's code `fit_EK_poly` in `qc/analyse-ek.py` +5. Correct leak correction (**validation protocols only (except act/inact?**) + - "These leak corrections can overcorrect or undercorrect." + - "IKr should only be negative when the voltage is below its reversal potential, approximately -85.2 mV (NERNST)" + - "If the leak-corrected current showed a negative current at voltages **substantially larger** than NERNST, we concluded we overestimated leak." + - Most noticeable during highest V in staircase (max I leak) + - **For each validation proto, we specified a time window during which we believe IKr should be almost zero (please refer to our GitHub repository for detail).** + - To rectify the over- or undercorrection, we re-estimated the leak correction by adding an extra linear leak current of the form `g * (V + 80)`, with `g` chosen to make `mean(I_window) = 0` + +## QC - before time series + +1. `QC No cell`: Not in paper: Well not listed, or `R_seal`, `C_m`, or `R_series` is `None` +2. `QC1.Rseal`: R_seal in [.1, 1000] GOhm + - Needs trace that provides R_seal, needs lower and upper bound +3. `QC1.Cm`: C_m in [1, 100] pF + - Needs trace that provides C_m, needs lower and upper bound +4. `QC1.Rseries`: R_series in [1, 25] MOhm + - Needs trace that provides R_series, needs lower and upper bound + +## QC - before subtraction + +1. `QC2.raw` as `snr = (np.std(c) / np.std(c[:200]))**2` and `snr < 25 or not np.isfinite(np.std(c))` + + + + + + + +## Aggregate + +1. EK histogram of 124 accepted wells + - **Figure 10B** + + + + + + +X. Bar plots of number filtered out on each QC crit + + + + + +## Maybe + +- `estimate_max_conductance` + In Supplement to Rapid 2, showing a single exp fit to a tail current and + using the max as max current +the max value diff --git a/example_export_config.py b/example_export_config.py deleted file mode 100644 index 39c97542..00000000 --- a/example_export_config.py +++ /dev/null @@ -1,18 +0,0 @@ -# -# Config for pcpostprocess.run_herg_qc -# - -# Copy this config file to the top-level data directory and modify fields. - -# Save name for this set of data -saveID = 'EXPERIMENT_NAME' - -# DataControl384 protocol output names to shorter names -# Protocols used for QC (usually the 'staircase' protocol) -D2S_QC = { - 'staircaseramp': 'staircaseramp' -} - -# Additional protocols to export -D2S = { -} diff --git a/pcpostprocess/scripts/__init__.py b/pcp1/__init__.py similarity index 100% rename from pcpostprocess/scripts/__init__.py rename to pcp1/__init__.py diff --git a/pcpostprocess/detect_ramp_bounds.py b/pcp1/detect_ramp_bounds.py similarity index 100% rename from pcpostprocess/detect_ramp_bounds.py rename to pcp1/detect_ramp_bounds.py diff --git a/pcpostprocess/hergQC.py b/pcp1/hergQC.py similarity index 100% rename from pcpostprocess/hergQC.py rename to pcp1/hergQC.py diff --git a/pcpostprocess/infer_reversal.py b/pcp1/infer_reversal.py similarity index 100% rename from pcpostprocess/infer_reversal.py rename to pcp1/infer_reversal.py diff --git a/pcpostprocess/leak_correct.py b/pcp1/leak_correct.py similarity index 100% rename from pcpostprocess/leak_correct.py rename to pcp1/leak_correct.py diff --git a/pcp1/scripts/__init__.py b/pcp1/scripts/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pcpostprocess/scripts/__main__.py b/pcp1/scripts/__main__.py similarity index 100% rename from pcpostprocess/scripts/__main__.py rename to pcp1/scripts/__main__.py diff --git a/pcpostprocess/scripts/run_herg_qc.py b/pcp1/scripts/run_herg_qc.py similarity index 100% rename from pcpostprocess/scripts/run_herg_qc.py rename to pcp1/scripts/run_herg_qc.py diff --git a/pcpostprocess/scripts/summarise_herg_export.py b/pcp1/scripts/summarise_herg_export.py similarity index 100% rename from pcpostprocess/scripts/summarise_herg_export.py rename to pcp1/scripts/summarise_herg_export.py diff --git a/pcpostprocess/subtraction_plots.py b/pcp1/subtraction_plots.py similarity index 100% rename from pcpostprocess/subtraction_plots.py rename to pcp1/subtraction_plots.py diff --git a/pcpostprocess/tests/__init__.py b/pcp1/tests/__init__.py similarity index 100% rename from pcpostprocess/tests/__init__.py rename to pcp1/tests/__init__.py diff --git a/pcpostprocess/tests/test_herg_qc.py b/pcp1/tests/test_herg_qc.py similarity index 100% rename from pcpostprocess/tests/test_herg_qc.py rename to pcp1/tests/test_herg_qc.py diff --git a/pcpostprocess/tests/test_infer_reversal.py b/pcp1/tests/test_infer_reversal.py similarity index 100% rename from pcpostprocess/tests/test_infer_reversal.py rename to pcp1/tests/test_infer_reversal.py diff --git a/pcpostprocess/tests/test_leak_correct.py b/pcp1/tests/test_leak_correct.py similarity index 100% rename from pcpostprocess/tests/test_leak_correct.py rename to pcp1/tests/test_leak_correct.py diff --git a/pcpostprocess/tests/test_scripts.py b/pcp1/tests/test_scripts.py similarity index 100% rename from pcpostprocess/tests/test_scripts.py rename to pcp1/tests/test_scripts.py diff --git a/pcpostprocess/tests/test_subtraction_plots.py b/pcp1/tests/test_subtraction_plots.py similarity index 100% rename from pcpostprocess/tests/test_subtraction_plots.py rename to pcp1/tests/test_subtraction_plots.py diff --git a/pcpostprocess/__init__.py b/pcpostprocess/__init__.py index e69de29b..b6c0e69d 100644 --- a/pcpostprocess/__init__.py +++ b/pcpostprocess/__init__.py @@ -0,0 +1,14 @@ +# +# This file is part of pcpostprocess. +# See https://github.com/CardiacModelling/pcpostprocess for copyright, sharing, +# and licensing details. +# + +from ._trace import ( + Trace, +) + +from ._leak import ( + estimate_gE_leak_ramp, + estimate_gE_leak_step, +) diff --git a/pcpostprocess/_erev.py b/pcpostprocess/_erev.py new file mode 100644 index 00000000..3b5c46ce --- /dev/null +++ b/pcpostprocess/_erev.py @@ -0,0 +1,51 @@ +# +# Reversal potential estimation +# +# This file is part of pcpostprocess. +# See https://github.com/CardiacModelling/pcpostprocess for copyright, sharing, +# and licensing details. +# +from . import Trace + + +def estimate_reversal_potential_ramp_poly( + trace: Trace, ramp: int) -> float: + """ + Estimates ``g * (V - E)`` leak using a "reversal ramp" in the voltage + protocol. + + An example reversal ramp for IKr would go from + + + + + Parameters + ---------- + trace : Trace + ramp : int + The index of the ramp in the voltage protocol: 0 for the first segment + that's a ramp, 1 for the second segment that's a ramp, etc. If neither + ``ramp_index`` or ``step_index`` is given, a ``ValueError`` will be + raised. + step : int, optional + An alternative way to specify the + order: int + The order of polynomial to fit (1, 3, or 4) + + + + + Returns + ------- + + """ + raise NotImplementedError + + + +def estimate_reversal_potential_ramp_smoothing( + trace: Trace, ramp: int) -> float: + """ + Similar but by smoothing first and then just finding the crossing. + + """ diff --git a/pcpostprocess/_leak.py b/pcpostprocess/_leak.py new file mode 100644 index 00000000..ffe7599e --- /dev/null +++ b/pcpostprocess/_leak.py @@ -0,0 +1,89 @@ +# +# Leak estimation and correction +# +# This file is part of pcpostprocess. +# See https://github.com/CardiacModelling/pcpostprocess for copyright, sharing, +# and licensing details. +# +from . import Trace + + +def estimate_gE_leak_ramp( + trace: Trace, ramp: int | None = None, step: int | None = None): + """ + Estimates ``g * (V - E)`` leak using a "leak ramp" in the voltage protocol. + + An example leak ramp for IKr would go from -120mV to -80mV in 400ms, after + holding at -80mV. + + Parameters + ---------- + trace : Trace + + ramp : int, optional + The index of the ramp in the voltage protocol: 0 for the first segment + that's a ramp, 1 for the second segment that's a ramp, etc. If neither + ``ramp_index`` or ``step_index`` is given, a ``ValueError`` will be + raised. + step : int, optional + An alternative way to specify the + + Returns + ------- + + """ + raise NotImplementedError + + +def estimate_gE_leak_step( + trace: Trace, step_1: int, step_2: int | None = None): + """ + Estimates ``g * (V - E)`` leak using two steps in a voltage protocol. + + An example sequence would be holding at -80mV (``step_1``), then performing + a 20ms step down to -100mV (``step_2``). + + Parameters + ---------- + trace : Trace + step_1 : int + The index (in the trace's voltage protocol) of the first step to use. + step_2 + The index of the second step to use. If not set, the step immediately + following ``step_1`` will be used (default). + + Returns + ------- + + + """ + #TODO: Some magic number parameter defining how many ms or which percentage + # of the first and second step to use + + #TODO: Modify Trace in place? Return new Trace (copying meta data?) + + raise NotImplementedError + + +def correct_gE_leak(trace: Trace, g : float, E : float): + """ + Corrects... + + """ + raise NotImplementedError + + +# Alternative: Have a class that contains the above method (so basically two +# constructors +class gELeak: + + def __init__(self, g, E): + pass + + @classmethod + def from_ramp(trace, ramp_index=None, step_index=None): + pass + + def from_steps(trace, step_1, step_2): + pass + diff --git a/pcpostprocess/_protocol.py b/pcpostprocess/_protocol.py new file mode 100644 index 00000000..69a5f1c4 --- /dev/null +++ b/pcpostprocess/_protocol.py @@ -0,0 +1,17 @@ +# +# Voltage protocol +# +# This file is part of pcpostprocess. +# See https://github.com/CardiacModelling/pcpostprocess for copyright, sharing, +# and licensing details. +# +#import numpy as np + + +class VoltageProtocol: + """ + Represents a voltage protocol consisting of a sequence of steps and/or + ramps. + """ + # Internal format: Sequence of (duration, v_start, v_end) objects. + diff --git a/pcpostprocess/_trace.py b/pcpostprocess/_trace.py new file mode 100644 index 00000000..299e79cd --- /dev/null +++ b/pcpostprocess/_trace.py @@ -0,0 +1,14 @@ +# +# Trace class and implementations +# +# This file is part of pcpostprocess. +# See https://github.com/CardiacModelling/pcpostprocess for copyright, sharing, +# and licensing details. +# +#import numpy as np + + +class Trace: + + def __init__(self, time, current): + pass diff --git a/pcpostprocess/directory_builder.py b/pcpostprocess/directory_builder.py deleted file mode 100644 index 290f1356..00000000 --- a/pcpostprocess/directory_builder.py +++ /dev/null @@ -1,47 +0,0 @@ -import datetime -import os -import sys - -from ._version import __commit_id__, __version__ - - -def get_git_revision_hash(): - """ - Get the hash for the git commit currently being used. - - @return The most recent commit hash or a suitable message - """ - return __commit_id__ - - -def get_build_type(): - return 'Develop' if 'dev' in __version__ else 'Release' - - -def setup_output_directory(dirname: str): - """ - Create an output directory if one doesn't already exist. Place an info - file in this directory which lists the date/time created, the version of - pcpostprocess, the command-line arguments provided, and the most recent git - commit. The two parameters allow for a user specified top-level directory and - a script-defined name for a subdirectory. - - @param Directory name - - @return The path to the created file directory (String) - """ - os.makedirs(dirname, exist_ok=True) - - with open(os.path.join(dirname, "pcpostprocess_info.txt"), "w") as description_fout: - git_hash = get_git_revision_hash() - datetimestr = str(datetime.datetime.now()) - description_fout.write("pcpostprocess output " - "https://github.com/CardiacModelling/pcpostprocess\n") - description_fout.write(f"Date: {datetimestr}\n") - description_fout.write(f"Version: {__version__}\n") - description_fout.write(f"Build type: {get_build_type()}\n") - description_fout.write(f"Commit: {git_hash}\n") - command = " ".join(sys.argv) - description_fout.write(f"Command: {command}\n") - return dirname - diff --git a/pcpostprocess/tests/test_directory_builder.py b/pcpostprocess/tests/test_directory_builder.py deleted file mode 100755 index 90ab0016..00000000 --- a/pcpostprocess/tests/test_directory_builder.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python3 -import os -import sys -import tempfile -import unittest - -from pcpostprocess import directory_builder - - -store_output = False - - -def read_info_dict(path): - """ Reads a pcpostproces_info.txt and returns it as a dict. """ - with open(path, 'r') as f: - items = [line.strip().split(': ') for line in f.readlines()] - return dict(line for line in items if len(line) == 2) - - -class TestDirectoryBuilder(unittest.TestCase): - """ Tests the DirectoryBuilder class. """ - - def test_directory_builder(self): - # Test that a pcpostprocess_info.txt is written, with a commit hash - - with tempfile.TemporaryDirectory() as d: - if store_output: # pragma: no cover - d = 'test_output' - path = directory_builder.setup_output_directory( - os.path.join(d, 'directory_builder')) - - # Check that git commit is written - info_dict = read_info_dict( - os.path.join(path, 'pcpostprocess_info.txt')) - self.assertRegex(info_dict['Commit'], r'^g[0-9a-fA-F]{9}$') - - -if __name__ == '__main__': # pragma: no cover - if '-store' in sys.argv: - store_output = True - sys.argv.remove('-store') - else: - print('Add -store to store output') - unittest.main() - diff --git a/pyproject.toml b/pyproject.toml index eb096bd6..8401302d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,11 @@ [build-system] +build-backend = 'setuptools.build_meta' requires = [ - 'setuptools>=61', - 'wheel', - 'setuptools_scm[toml]>=8.0', + 'setuptools>=80', + 'setuptools_scm>=8.0', + #'wheel', ] -build-backend = 'setuptools.build_meta' - [tool.setuptools_scm] local_scheme = 'dirty-tag' write_to = 'pcpostprocess/_version.py' @@ -17,12 +16,12 @@ dynamic = ['version'] readme = { file = 'README.md', content-type = 'text/markdown' } name = 'pcpostprocess' -description = 'Post-process patch clamp recordings with the staircase protocol' +description = 'Post-process patch clamp recordings' authors = [ + {name='Joseph Shuttleworth'}, {name='Frankie Patten-Elliot'}, - {name='Joseph Shuttleworth', email='joey.shuttleworth@nottingham.ac.uk'}, {name='Chon Lok Lei'}, - {name='Michael Clerx'} + {name='Michael Clerx', email='michael.clerx@nottingham.ac.uk'} ] classifiers = [ @@ -35,34 +34,40 @@ dependencies = [ 'scipy>=1.7', 'numpy>=1.21', 'matplotlib>=3.4', - 'pandas>=1.3', - 'seaborn>=0.12.2', - 'jinja2>=3.1.0', + #'pandas>=1.3', + #'seaborn>=0.12.2', + #'jinja2>=3.1.0', 'syncropatch_export @ git+https://github.com/CardiacModelling/syncropatch_export.git' ] [project.optional-dependencies] -test = [ +dev = [ 'coverage', # For coverage testing 'codecov>=2.1.3', # To upload coverage reports 'flake8>=3', # For code style checking + 'mypy>=1', # ] -[tools.setuptools.package-data] -include_package_data = true - [project.urls] Homepage = 'https://github.com/CardiacModelling/pcpostprocess' Source = 'https://github.com/CardiacModelling/pcpostprocess' -[project.scripts] -pcpostprocess = 'pcpostprocess.scripts.__main__:main' +#[project.scripts] +#pcpostprocess = 'pcpostprocess.scripts.__main__:main' + +[tools.setuptools.package-data] +include_package_data = true [tool.setuptools.packages.find] include = [ 'pcpostprocess', ] +[tool.mypy] +modules = [ + 'pcpostprocess', +] + [tool.coverage.run] source = [ 'pcpostprocess', diff --git a/setup.py b/setup.py deleted file mode 100644 index f0e2d5b9..00000000 --- a/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -from setuptools import setup - -setup( - setup_requires=["setuptools_scm"], -)