Skip to content

Add numpydoc References sections to model docstrings - #278

Draft
markbujehein wants to merge 2 commits into
easyscience:developfrom
markbujehein:docstring-refs
Draft

markbujehein wants to merge 2 commits into
easyscience:developfrom
markbujehein:docstring-refs

Conversation

@markbujehein

Copy link
Copy Markdown
Contributor

What

Adds a References section to the docstrings of these models, with full
citations:

  • BrownianTranslationalDiffusion: Vineyard (1958)
  • JumpTranslationalDiffusion: Singwi and Sjölander (1960)
  • DeltaLorentz: Bée (1988), Weinstock (1944), Dianoux, Volino and Hervet
    (1975), Volino and Dianoux (1980)
  • DampedHarmonicOscillator: Cochran (1960), Cowley (1963, 1968), Lovesey (1984)
  • StretchedExponential: Kohlrausch (1854), Williams and Watts (1970)

Why

  • Adding missing references (where I've been able to track down an origin)
  • The References is a standard numpydoc section. However, Griffe (mkdocs) ignores References, and indiscriminately renders this entry as an admonition.

Remarks

The first book (Bée) are not cited from the paper itself, but as far as I can tell, the DeltaLorentz model is historically synthesised from a number of sources. The second book (Lovesey) seems to be one of the original sources for DampedHarmonicOscillator formulation, but thats also not entirely clear.
For DeltaLorentz and
DampedHarmonicOscillator I'm not sure these are the best sources, so please
correct me if you know better ones.

Related issues:

Cite Vineyard (Brownian), Singwi and Sjölander (jump), Bée, Weinstock
and Dianoux, Volino and Hervet (DeltaLorentz), and move the Hassani
et al. citation of MittagLefflerDiffusion into References sections,
with DOIs. The Brownian and jump tutorial sections cite the same papers.
Cite Cochran and Cowley (DampedHarmonicOscillator), Kohlrausch and
Williams and Watts (StretchedExponential), and move the Hassani et al.
citation of DiffusionDampedMittagLeffler into a References section.
@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.23%. Comparing base (762b081) to head (cd087cc).
⚠️ Report is 14 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #278      +/-   ##
===========================================
+ Coverage    98.15%   98.23%   +0.08%     
===========================================
  Files           60       61       +1     
  Lines         6066     6228     +162     
  Branches      1022     1039      +17     
===========================================
+ Hits          5954     6118     +164     
+ Misses          58       57       -1     
+ Partials        54       53       -1     
Flag Coverage Δ
unittests 98.23% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ple_model/components/damped_harmonic_oscillator.py 100.00% <ø> (ø)
...odel/components/diffusion_damped_mittag_leffler.py 100.00% <ø> (ø)
...s/sample_model/components/stretched_exponential.py 100.00% <ø> (ø)
...iffusion_model/brownian_translational_diffusion.py 100.00% <ø> (ø)
...mics/sample_model/diffusion_model/delta_lorentz.py 97.60% <ø> (ø)
...el/diffusion_model/jump_translational_diffusion.py 100.00% <ø> (ø)
..._model/diffusion_model/mittag_leffler_diffusion.py 90.57% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@henrikjacobsenfys henrikjacobsenfys added [scope] documentation Documentation only changes (major.minor.patch.POST) [priority] medium Normal/default priority labels Oct 21, 2026
@henrikjacobsenfys

henrikjacobsenfys commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Good idea! We can also look at the references from qensmodels: https://github.com/QENSlibrary/QENSmodels/tree/main/QENSmodels

@markbujehein

Copy link
Copy Markdown
Contributor Author

Great to hear :) I actually started drafting this PR because I discovered that library!

Only thing is that Griffe renders some of the standard pydocs sections as admonitions by default, one is the "References".
Design choices might need to be agreed upon upstream? Or perhaps markdown can fix it unless they violates the ADR...

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] medium Normal/default priority [scope] documentation Documentation only changes (major.minor.patch.POST)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants