From 9a50ed0e016dd5f859b21def7ea71e7bd3d926ee Mon Sep 17 00:00:00 2001 From: LM Date: Tue, 20 Feb 2024 11:24:38 +0100 Subject: [PATCH] mkdocs string --- hamiltonian_flow/models/harmonic_oscillator.py | 9 ++++++++- mkdocs.yml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hamiltonian_flow/models/harmonic_oscillator.py b/hamiltonian_flow/models/harmonic_oscillator.py index cf2ee74..a52fa1c 100644 --- a/hamiltonian_flow/models/harmonic_oscillator.py +++ b/hamiltonian_flow/models/harmonic_oscillator.py @@ -7,7 +7,12 @@ class HarmonicOscillatorParams(BaseModel): - """The params for the harmonic oscillator""" + """The params for the harmonic oscillator + + :param omega: angular frequency of the harmonic oscillator + :param amplitude: the amplitude of the oscillation + :param phi: initial phase + """ omega: float amplitude: float = 1.0 @@ -16,11 +21,13 @@ class HarmonicOscillatorParams(BaseModel): @computed_field # type: ignore[misc] @cached_property def period(self) -> float: + """period of the oscillator""" return 2 * np.pi / self.omega @computed_field # type: ignore[misc] @cached_property def frequency(self) -> float: + """frequency of the oscillator""" return 1 / self.period diff --git a/mkdocs.yml b/mkdocs.yml index 18b6989..680c310 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -62,7 +62,7 @@ plugins: - mkdocstrings: handlers: python: - selection: + options: docstring_style: sphinx watch: - docs