Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}

# Push core test coverage badge endpoint.json to the data branch so the
# README badge resolves on every branch, not only after merging to main.
- name: Remove .coverage database before Codecov upload
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
run: rm -f .coverage # prevent codecov CLI from regenerating coverage.xml with wrong paths

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v5
Expand Down
44 changes: 23 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Full documentation: [synaptipy.readthedocs.io](https://synaptipy.readthedocs.io/

## Installation

**WARNING: PySide6 must remain pinned to version 6.7.3 due to QTBUG-130070.**

### Prerequisites

- [Anaconda](https://www.anaconda.com/download) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
Expand Down Expand Up @@ -57,7 +59,7 @@ synaptipy
python -m Synaptipy
```

![Synaptipy Explorer multi-trial current-clamp recording with action potentials](https://raw.githubusercontent.com/anzalks/synaptipy/main/docs/tutorial/screenshots/explorer_tab.png)
![Synaptipy Explorer - multi-trial current-clamp recording with action potentials](https://raw.githubusercontent.com/anzalks/synaptipy/main/docs/tutorial/screenshots/explorer_tab.png)

Load a recording by dragging a file into the **Explorer** tab, then navigate to the **Analyser** tab to select a channel and run an analysis. Results are displayed in a table and can be exported to CSV.

Expand Down Expand Up @@ -259,42 +261,42 @@ are listed below; see the [full references page](https://synaptipy.readthedocs.i
in the documentation for a complete annotated bibliography.

**Action potential detection and kinetics:**
- Bean BP (2007). The action potential in mammalian central neurons. *Nat Rev Neurosci* 8:451-465. [doi:10.1038/nrn2148](https://doi.org/10.1038/nrn2148) dV/dt threshold default (20 V/s)
- Hodgkin AL & Huxley AF (1952). *J Physiol* 117:500-544. [doi:10.1113/jphysiol.1952.sp004764](https://doi.org/10.1113/jphysiol.1952.sp004764) foundational AP model
- Sekerli M et al. (2004). *IEEE Trans Biomed Eng* 51:1665-1672. [doi:10.1109/TBME.2004.827827](https://doi.org/10.1109/TBME.2004.827827) maximum-curvature threshold method
- Naundorf B et al. (2006). *Nature* 440:1060-1063. [doi:10.1038/nature04610](https://doi.org/10.1038/nature04610) artifact ceiling (300 V/s)
- Bean BP (2007). The action potential in mammalian central neurons. *Nat Rev Neurosci* 8:451-465. [doi:10.1038/nrn2148](https://doi.org/10.1038/nrn2148) - dV/dt threshold default (20 V/s)
- Hodgkin AL & Huxley AF (1952). *J Physiol* 117:500-544. [doi:10.1113/jphysiol.1952.sp004764](https://doi.org/10.1113/jphysiol.1952.sp004764) - foundational AP model
- Sekerli M et al. (2004). *IEEE Trans Biomed Eng* 51:1665-1672. [doi:10.1109/TBME.2004.827827](https://doi.org/10.1109/TBME.2004.827827) - maximum-curvature threshold method
- Naundorf B et al. (2006). *Nature* 440:1060-1063. [doi:10.1038/nature04610](https://doi.org/10.1038/nature04610) - artifact ceiling (300 V/s)

**Passive membrane properties:**
- Hamill OP et al. (1981). *Pflugers Arch* 391:85-100. [doi:10.1007/BF00656997](https://doi.org/10.1007/BF00656997) patch-clamp; series resistance and capacitance
- Robinson RB & Siegelbaum SA (2003). *Annu Rev Physiol* 65:453-480. [doi:10.1146/annurev.physiol.65.092101.142734](https://doi.org/10.1146/annurev.physiol.65.092101.142734) HCN / Ih current; peak vs. steady-state Rᵢₙ
- Hamill OP et al. (1981). *Pflugers Arch* 391:85-100. [doi:10.1007/BF00656997](https://doi.org/10.1007/BF00656997) - patch-clamp; series resistance and capacitance
- Robinson RB & Siegelbaum SA (2003). *Annu Rev Physiol* 65:453-480. [doi:10.1146/annurev.physiol.65.092101.142734](https://doi.org/10.1146/annurev.physiol.65.092101.142734) - HCN / Ih current; peak vs. steady-state Rᵢₙ

**After-hyperpolarisation:**
- Storm JF (1987). *J Physiol* 385:733-759. [doi:10.1113/jphysiol.1987.sp016517](https://doi.org/10.1113/jphysiol.1987.sp016517) fast AHP (BK, 1-5 ms)
- Sah P & Faber ESL (2002). *Prog Neurobiol* 66:345-353. [doi:10.1016/S0301-0082(02)00004-7](https://doi.org/10.1016/S0301-0082(02)00004-7) medium AHP (SK, 10-50 ms)
- Storm JF (1987). *J Physiol* 385:733-759. [doi:10.1113/jphysiol.1987.sp016517](https://doi.org/10.1113/jphysiol.1987.sp016517) - fast AHP (BK, 1-5 ms)
- Sah P & Faber ESL (2002). *Prog Neurobiol* 66:345-353. [doi:10.1016/S0301-0082(02)00004-7](https://doi.org/10.1016/S0301-0082(02)00004-7) - medium AHP (SK, 10-50 ms)

**Spike-train statistics:**
- Holt GR et al. (1996). *J Neurophysiol* 75:1806-1814. [doi:10.1152/jn.1996.75.5.1806](https://doi.org/10.1152/jn.1996.75.5.1806) CV and CV₂
- Shinomoto S et al. (2003). *Neural Comput* 15:2823-2842. [doi:10.1162/089976603322518759](https://doi.org/10.1162/089976603322518759) Local Variation (LV)
- Holt GR et al. (1996). *J Neurophysiol* 75:1806-1814. [doi:10.1152/jn.1996.75.5.1806](https://doi.org/10.1152/jn.1996.75.5.1806) - CV and CV₂
- Shinomoto S et al. (2003). *Neural Comput* 15:2823-2842. [doi:10.1162/089976603322518759](https://doi.org/10.1162/089976603322518759) - Local Variation (LV)

**Burst detection:**
- Grace AA & Bunney BS (1984). *J Neurosci* 4:2877-2890. [doi:10.1523/JNEUROSCI.04-11-02877.1984](https://doi.org/10.1523/JNEUROSCI.04-11-02877.1984) ISI burst criterion
- Harris KD et al. (2001). *Neuron* 32:141-149. [doi:10.1016/S0896-6273(01)00447-0](https://doi.org/10.1016/S0896-6273(01)00447-0) dynamic ISI fraction (30%)
- Grace AA & Bunney BS (1984). *J Neurosci* 4:2877-2890. [doi:10.1523/JNEUROSCI.04-11-02877.1984](https://doi.org/10.1523/JNEUROSCI.04-11-02877.1984) - ISI burst criterion
- Harris KD et al. (2001). *Neuron* 32:141-149. [doi:10.1016/S0896-6273(01)00447-0](https://doi.org/10.1016/S0896-6273(01)00447-0) - dynamic ISI fraction (30%)

**Synaptic event detection:**
- Rall W (1967). *J Neurophysiol* 30:1138-1168. [doi:10.1152/jn.1967.30.5.1138](https://doi.org/10.1152/jn.1967.30.5.1138) cable theory; dendritic filtering (2-3x tau)
- Hampel FR (1974). *J Am Stat Assoc* 69:383-393. [doi:10.1080/01621459.1974.10482962](https://doi.org/10.1080/01621459.1974.10482962) MAD noise estimator (1.4826 factor)
- Rall W (1967). *J Neurophysiol* 30:1138-1168. [doi:10.1152/jn.1967.30.5.1138](https://doi.org/10.1152/jn.1967.30.5.1138) - cable theory; dendritic filtering (2-3x tau)
- Hampel FR (1974). *J Am Stat Assoc* 69:383-393. [doi:10.1080/01621459.1974.10482962](https://doi.org/10.1080/01621459.1974.10482962) - MAD noise estimator (1.4826 factor)

**Paired-pulse ratio:**
- Zucker RS & Regehr WG (2002). *Annu Rev Physiol* 64:355-405. [doi:10.1146/annurev.physiol.64.092501.114547](https://doi.org/10.1146/annurev.physiol.64.092501.114547) short-term synaptic plasticity
- Regehr WG (2012). *Cold Spring Harb Perspect Biol* 4:a005702. [doi:10.1101/cshperspect.a005702](https://doi.org/10.1101/cshperspect.a005702) PPR facilitation/depression classification
- Zucker RS & Regehr WG (2002). *Annu Rev Physiol* 64:355-405. [doi:10.1146/annurev.physiol.64.092501.114547](https://doi.org/10.1146/annurev.physiol.64.092501.114547) - short-term synaptic plasticity
- Regehr WG (2012). *Cold Spring Harb Perspect Biol* 4:a005702. [doi:10.1101/cshperspect.a005702](https://doi.org/10.1101/cshperspect.a005702) - PPR facilitation/depression classification

**Signal filtering:**
- Savitzky A & Golay MJE (1964). *Anal Chem* 36:1627-1639. [doi:10.1021/ac60214a047](https://doi.org/10.1021/ac60214a047) Savitzky-Golay smoothing
- Welch PD (1967). *IEEE Trans Audio Electroacoust* 15:70-73. [doi:10.1109/TAU.1967.1161901](https://doi.org/10.1109/TAU.1967.1161901) Welch PSD / line noise detection
- Savitzky A & Golay MJE (1964). *Anal Chem* 36:1627-1639. [doi:10.1021/ac60214a047](https://doi.org/10.1021/ac60214a047) - Savitzky-Golay smoothing
- Welch PD (1967). *IEEE Trans Audio Electroacoust* 15:70-73. [doi:10.1109/TAU.1967.1161901](https://doi.org/10.1109/TAU.1967.1161901) - Welch PSD / line noise detection

**Electrode corrections:**
- Barry PH & Lynch JW (1991). *J Membr Biol* 121:101-117. [doi:10.1007/BF01870526](https://doi.org/10.1007/BF01870526) liquid junction potential correction
- Armstrong CM & Bezanilla F (1977). *J Gen Physiol* 70:567-590. [doi:10.1085/jgp.70.5.567](https://doi.org/10.1085/jgp.70.5.567) P/N leak subtraction protocol
- Barry PH & Lynch JW (1991). *J Membr Biol* 121:101-117. [doi:10.1007/BF01870526](https://doi.org/10.1007/BF01870526) - liquid junction potential correction
- Armstrong CM & Bezanilla F (1977). *J Gen Physiol* 70:567-590. [doi:10.1085/jgp.70.5.567](https://doi.org/10.1085/jgp.70.5.567) - P/N leak subtraction protocol

---

Expand Down
25 changes: 25 additions & 0 deletions check_docs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import ast
import os
import glob
from collections import defaultdict

def check_file(filepath):
with open(filepath, 'r') as f:
content = f.read()

tree = ast.parse(content)

for node in ast.walk(tree):
if isinstance(node, ast.FunctionDef):
args = [arg.arg for arg in node.args.args if arg.arg not in ('self', 'cls')]
args += [arg.arg for arg in node.args.kwonlyargs]

docstring = ast.get_docstring(node)
if docstring:
for arg in args:
# basic check: is the arg mentioned in the docstring?
# A more rigorous check parses the Google/Numpy style.
# We will just look for `arg:` or `arg ` or `*arg*` etc.
# Actually, if we use a regex:
pass

52 changes: 52 additions & 0 deletions clean_slop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import re
import os

FILES = [
"README.md",
"docs/user_guide.md",
"docs/developer_guide.md",
"docs/algorithmic_definitions.md"
]

def clean_slop(text):
# It is important to note that -> remove and capitalize
def repl_important(m):
next_char = m.group(1)
return next_char.upper()
text = re.sub(r'(?i)It is important to note that\s+([a-z])', repl_important, text)
text = re.sub(r'(?i)It is important to note that\s*', '', text)

# Seamlessly integrates -> Integrates
text = re.sub(r'(?i)Seamlessly integrates', 'Integrates', text)
text = re.sub(r'(?i)seamlessly integrates', 'integrates', text)

# Empowers users to -> Allows users to
text = re.sub(r'(?i)Empowers users to', 'Allows users to', text)
text = re.sub(r'(?i)empowers users to', 'allows users to', text)

# In conclusion, -> remove
def repl_conclusion(m):
next_char = m.group(1)
return next_char.upper()
text = re.sub(r'(?i)In conclusion,\s+([a-z])', repl_conclusion, text)
text = re.sub(r'(?i)In conclusion,\s*', '', text)

# Replace em-dashes
# usually surrounded by spaces: ` — ` -> ` - `
text = text.replace(' — ', ' - ')
# sometimes not: `word—word` -> `word - word`
text = text.replace('—', ' - ')

return text

for fpath in FILES:
if os.path.exists(fpath):
with open(fpath, "r") as f:
content = f.read()
new_content = clean_slop(content)
if content != new_content:
with open(fpath, "w") as f:
f.write(new_content)
print(f"Cleaned {fpath}")
else:
print(f"File not found: {fpath}")
Loading
Loading