From 7fa920adfc92ea55db2feede56d01de152218703 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:32:29 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- physics/de_broglie | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/de_broglie b/physics/de_broglie index e3c0b8ebe..fa329e636 100644 --- a/physics/de_broglie +++ b/physics/de_broglie @@ -7,11 +7,11 @@ def de_broglie_wavelength(momentum: float, in_ev: bool = False) -> str: Parameters: momentum (float): Momentum of the particle. - in_ev (bool, optional): True if momentum is in eV·s. + in_ev (bool, optional): True if momentum is in eV·s. If False, momentum is in kg·m/s. Returns: - str: The calculated de Broglie wavelength of the particle in meters, + str: The calculated de Broglie wavelength of the particle in meters, formatted in scientific notation. Raises: @@ -37,7 +37,7 @@ def de_broglie_wavelength(momentum: float, in_ev: bool = False) -> str: if momentum <= 0: raise ValueError("Momentum can't be zero or negative.") - + wavelength = PLANCK_CONSTANT_EVS / momentum if in_ev else PLANCK_CONSTANT_JS / momentum return f"{wavelength:.8e}"