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: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ jobs:
# test_headless.py, so 13 of the 16 test files never executed in CI at
# all -- a regression in the language loader, the confidence scales,
# SessionPaths, the trigger registry or the tutorial table would have
# shipped green. test_reports.py is excluded because it needs papermill
# and reports is deprecated; it is excluded locally for the same reason.
# shipped green.
#
# A per-test timeout dumps the stack of whatever is stuck; thread
# method, because the signal method cannot interrupt a blocking call
Expand All @@ -117,4 +116,4 @@ jobs:
env:
PYTHONUNBUFFERED: "1"
run: |
xvfb-run -a pytest tests/ -v --ignore=tests/test_reports.py --timeout=180 --timeout-method=thread --durations=15 --cov=cardioception --cov-report=term-missing
xvfb-run -a pytest tests/ -v --timeout=180 --timeout-method=thread --durations=15 --cov=cardioception --cov-report=term-missing
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[settings]
known_third_party = numpy,pandas,papermill,pkg_resources,psychopy,serial,sphinx_bootstrap_theme,systole
known_third_party = numpy,pandas,pkg_resources,psychopy,serial,sphinx_bootstrap_theme,systole
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
Expand Down
4 changes: 1 addition & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ cardioception/
PAT/ the Phase Adjustment Task (beta)
HSD/ the Heartbeat Synchrony Discrimination task (beta)
devices/ recorders, and the beat source and tone player the PAT and HSD share
notebooks/ report templates executed by reports.report()
reports.py preprocessing and HTML reports (legacy, due to be rebuilt)
_resources.py locates bundled images and sounds
docs/source/ Sphinx documentation (MyST markdown, furo theme)
R_analysis/ legacy R scripts, maintained for existing pipelines
Expand All @@ -57,7 +55,7 @@ tests/
- Sentence case headings in documentation. No decorative emoji anywhere.
- No em dashes or en dashes in prose. Page ranges inside citations keep theirs.
- Spelling: US for the `-ize`/`-yze` family (`analyze`, `visualization`), British for
`-our` and `modelling`/`behavioural`. This matches the existing code and notebooks.
`-our` and `modelling`/`behavioural`. This matches the existing code.
`setup='behavioral'` is a code literal, not prose. Do not change it.
- Python is formatted with black, imports sorted with isort, and checked with flake8
and mypy, on **Python 3.11**. The package supports **3.10 and 3.11**: the upper
Expand Down
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ code it replaced rather than read over.
- `.RData` (50 MB), `.Rhistory` and `.coverage` are no longer tracked. They
remain in the history; only new clones of the working tree get smaller.

### Deprecated
### Removed

- `cardioception.reports`. To be rebuilt.
- `cardioception.reports`, with `report`, `preprocessing` and the two
notebook templates in `cardioception/notebooks/` that `report` ran. They read
only the file names 0.7 wrote, and mixed quality control with outdated
analysis choices. Reporting will be rebuilt from scratch; until then, the
[inspecting-data tutorial](https://www.the-ecg.org/Cardioception/tasks/hrd/tutorials/inspecting-data.html)
covers the same checks. The 0.7 reports remain in `v0.7.2`.
- `papermill` and `pingouin` are no longer dependencies, and
`environment_linux.yml` no longer installs PyMC and metadpy.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pytest tests/test_rng.py tests/test_stimuli.py tests/test_hsd_psi.py
The whole suite, as CI runs it:

```bash
pytest tests/ --ignore=tests/test_reports.py --timeout=180 --timeout-method=thread
pytest tests/ --timeout=180 --timeout-method=thread
```

CI also checks types, formatting and lint on Python 3.11:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ This is the official Cardioception, developed by Micah Allen and the Embodied Co

| Task | What participants do | Main measures | Reference | Status |
|---|---|---|---|---|
| Heart Rate Discrimination (HRD) | Judge whether a sequence of tones is faster or slower than their own heart rate | Bias and precision of heart rate judgements, with optional confidence ratings | [Legrand et al., 2022](https://doi.org/10.1016/j.biopsycho.2021.108239) | Established |
| Heartbeat Counting (HBC) | Count their heartbeats during intervals of different lengths | Reported heartbeat counts relative to recorded counts | [Schandry, 1981](https://doi.org/10.1111/j.1469-8986.1981.tb02486.x) | Established |
| Phase Adjustment Task (PAT) | Adjust the delay of tones until they match their perceived heartbeat | The delay chosen, and its consistency across trials | [Plans et al., 2021](https://doi.org/10.1016/j.biopsycho.2021.108171); ECG version after [Hodgetts et al., 2026](https://doi.org/10.1111/psyp.70415) | Beta |
| Heartbeat Synchrony Discrimination (HSD) | Judge whether tones played at different delays after each heartbeat are synchronous with it | Perceived timing of the heartbeat, and its temporal precision | New in Cardioception; see the [design page](https://www.the-ecg.org/Cardioception/dev/tasks/hsd/design.html) | Beta |
| Whitehead method | Judge which of two tone sequences, one at a short and one at a longer delay after each heartbeat, is simultaneous with it | Discrimination of synchronous from delayed tones | [Whitehead et al., 1977](https://doi.org/10.1007/BF00998623) | Coming soon |
| Method of constant stimuli (Brener) | Judge whether tones at one of several fixed delays, from 0 to 500 ms after each heartbeat, are simultaneous with it | Proportion of tones judged simultaneous at each delay | [Brener, Liu & Ring, 1993](https://doi.org/10.1111/j.1469-8986.1993.tb02091.x) | Coming soon |
| [Heart Rate Discrimination (HRD)](https://www.the-ecg.org/Cardioception/dev/tasks/hrd/index.html) | Judge whether a sequence of tones is faster or slower than their own heart rate | Bias and precision of heart rate judgements, with optional confidence ratings | [Legrand et al., 2022](https://doi.org/10.1016/j.biopsycho.2021.108239) | Established |
| [Heartbeat Counting (HBC)](https://www.the-ecg.org/Cardioception/dev/tasks/hbc.html) | Count their heartbeats during intervals of different lengths | Reported heartbeat counts relative to recorded counts | [Schandry, 1981](https://doi.org/10.1111/j.1469-8986.1981.tb02486.x) | Established |
| [Phase Adjustment Task (PAT)](https://www.the-ecg.org/Cardioception/dev/tasks/pat.html) | Adjust the delay of tones until they match their perceived heartbeat | The delay chosen, and its consistency across trials | [Plans et al., 2021](https://doi.org/10.1016/j.biopsycho.2021.108171); ECG version after [Hodgetts et al., 2026](https://doi.org/10.1111/psyp.70415) | Beta |
| [Heartbeat Synchrony Discrimination (HSD)](https://www.the-ecg.org/Cardioception/dev/tasks/hsd/index.html) | Judge whether tones played at different delays after each heartbeat are synchronous with it | Perceived timing of the heartbeat, and its temporal precision | New in Cardioception; see the [design page](https://www.the-ecg.org/Cardioception/dev/tasks/hsd/design.html) | Beta |
| [Whitehead method](https://www.the-ecg.org/Cardioception/dev/tasks/whitehead.html) | Judge which of two tone sequences, one at a short and one at a longer delay after each heartbeat, is simultaneous with it | Discrimination of synchronous from delayed tones | [Whitehead et al., 1977](https://doi.org/10.1007/BF00998623) | Coming soon |
| [Method of constant stimuli (Brener)](https://www.the-ecg.org/Cardioception/dev/tasks/constant-stimuli.html) | Judge whether tones at one of several fixed delays, from 0 to 500 ms after each heartbeat, are simultaneous with it | Proportion of tones judged simultaneous at each delay | [Brener, Liu & Ring, 1993](https://doi.org/10.1111/j.1469-8986.1993.tb02091.x) | Coming soon |

Tasks in beta are close to feature complete and are still being rigorously validated.

Expand Down Expand Up @@ -66,7 +66,7 @@ Every task writes to `data/sub-<participant>/ses-<session>/run-<timestamp>/`, wi

## Analysis

For hierarchical modelling and power analysis of HRD data, see the companion [Hierarchical Interoception toolbox](https://github.com/embodied-computation-group/Hierarchical-Interoception), described in [Courtin et al. (2026)](https://doi.org/10.3758/s13428-026-03137-3). It provides validated psychometric models and normative priors. The R scripts in [`R_analysis/`](R_analysis/) are kept working for existing pipelines, and the older Python report notebooks in `cardioception/notebooks/` remain for reference.
For hierarchical modelling and power analysis of HRD data, see the companion [Hierarchical Interoception toolbox](https://github.com/embodied-computation-group/Hierarchical-Interoception), described in [Courtin et al. (2026)](https://doi.org/10.3758/s13428-026-03137-3). It provides validated psychometric models and normative priors. The R scripts in [`R_analysis/`](R_analysis/) are kept working for existing pipelines.

## Documentation

Expand Down
7 changes: 0 additions & 7 deletions cardioception/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# Copyright (C) 2020-2026 Micah G Allen and the Embodied Computation Group, Aarhus University
from typing import TYPE_CHECKING

from .reports import preprocessing, report

if not TYPE_CHECKING:
from .HBC import * # noqa
from .HRD import * # noqa

__all__ = [
"preprocessing",
"report",
]

__version__ = "1.0.0"
Loading
Loading