Skip to content

Reproduction scripts for the paper, Jewett and Breslow model fixes, and testing across platforms - #15

Merged
djmarques merged 4 commits into
DiseaseTranscriptomicsLab:mainfrom
djmarques:main
Nov 19, 2026
Merged

djmarques merged 4 commits into
DiseaseTranscriptomicsLab:mainfrom
djmarques:main

Conversation

@djmarques

Copy link
Copy Markdown
Collaborator

Bug fixes

  • Jewett model: core body temperature minimum was 48 minutes early. Jewett.cbt() ignored the phi_ref offset (0.8 h) that Jewett et al. (1999) place between the minimum of x and the temperature minimum, so every predicted dim-light melatonin onset (DLMO) was 48 minutes early. Found by comparison with the circadian package; the two now agree exactly.
  • Breslow model: integration stopped silently. Under bright light, pineal melatonin can reach the guard threshold within a single sample, where the production term switches off abruptly. A single odeint call over the whole record then failed (after about 16 days of a regular schedule) and returned zeros for the rest of the record without raising an error. Breslow13 now integrates each interval between samples separately, with an explicit Runge-Kutta fallback, and keeps pineal melatonin non-negative.
  • No more silent failures. Model.integrate() now raises RuntimeError if the solver fails, instead of returning zeros, and rejects empty light or time input with a clear message.
  • Two docstrings containing LaTeX are now raw strings, so importing circStudio no longer emits SyntaxWarning.

Reproducibility (paper/)

  • Scripts for all four manuscript figures and for every agreement analysis, with the regenerated figures.
  • Comparison with pyActigraphy 1.2.2 on all five bundled recordings: rhythm metrics, sleep scoring, sleep profile, sleep midpoint and detrended fluctuation analysis. All results are identical, apart from differences at floating-point rounding level for detrended fluctuation analysis.
  • Comparison with the circadian package (1.0.3) for the Forger, Jewett, Hannay (one and two populations) and Breslow models: every predicted DLMO falls on the same sample in both packages.
  • Expected outputs as CSV files in paper/results, and a README with the exact commands and package versions.

Testing

  • GitHub Actions now runs the test suite on Linux, macOS and Windows with Python 3.12, 3.13 and 3.14.
  • New tests: the Jewett temperature-minimum offset, Breslow over 30 days (completes, melatonin stays non-negative, one DLMO per day), and the error raised on solver failure.
  • The import tests now inherit the parent environment, which they need on Windows.

Repository

  • CONTRIBUTING.md: how to get help, report a bug and propose a change.
  • CITATION.cff filled in; contact address added to CODE_OF_CONDUCT.md.
  • Version bumped to 1.1.3; Python 3.13 classifier added.

@djmarques
djmarques merged commit 259c0bd into DiseaseTranscriptomicsLab:main Nov 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant