Skip to content

Commit

Permalink
mkdocs string
Browse files Browse the repository at this point in the history
  • Loading branch information
emptymalei committed Feb 20, 2024
1 parent 39896d8 commit 9a50ed0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion hamiltonian_flow/models/harmonic_oscillator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ plugins:
- mkdocstrings:
handlers:
python:
selection:
options:
docstring_style: sphinx
watch:
- docs
Expand Down

0 comments on commit 9a50ed0

Please sign in to comment.