From 0d324de7ab9c354d958fd93f6046d0111014d95a Mon Sep 17 00:00:00 2001 From: Vipin Karthic <143083087+vipinkarthic@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:18:15 +0530 Subject: [PATCH] Doctest Error Correction of mirror_formulae.py (#9782) * Python mirror_formulae.py is added to the repository * Changes done after reading readme.md * Changes for running doctest on all platforms * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Change 2 for Doctests * Changes for doctest 2 * updating DIRECTORY.md * Doctest whitespace error rectification to mirror_formulae.py * updating DIRECTORY.md --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss --- DIRECTORY.md | 1 + physics/mirror_formulae.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 5f23cbd6c..b0ba3c385 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -469,6 +469,7 @@ * [Djb2](hashes/djb2.py) * [Elf](hashes/elf.py) * [Enigma Machine](hashes/enigma_machine.py) + * [Fletcher16](hashes/fletcher16.py) * [Hamming Code](hashes/hamming_code.py) * [Luhn](hashes/luhn.py) * [Md5](hashes/md5.py) diff --git a/physics/mirror_formulae.py b/physics/mirror_formulae.py index f1b4ac2c7..7efc52438 100644 --- a/physics/mirror_formulae.py +++ b/physics/mirror_formulae.py @@ -66,7 +66,7 @@ def focal_length(distance_of_object: float, distance_of_image: float) -> float: >>> from math import isclose >>> isclose(focal_length(9.5, 6.7), 3.929012346) True - >>> focal_length(0, 20) + >>> focal_length(0, 20) # doctest: +NORMALIZE_WHITESPACE Traceback (most recent call last): ... ValueError: Invalid inputs. Enter non zero values with respect @@ -89,7 +89,7 @@ def object_distance(focal_length: float, distance_of_image: float) -> float: >>> from math import isclose >>> isclose(object_distance(10.5, 11.7), 102.375) True - >>> object_distance(90, 0) + >>> object_distance(90, 0) # doctest: +NORMALIZE_WHITESPACE Traceback (most recent call last): ... ValueError: Invalid inputs. Enter non zero values with respect @@ -112,7 +112,7 @@ def image_distance(focal_length: float, distance_of_object: float) -> float: >>> from math import isclose >>> isclose(image_distance(1.5, 6.7), 1.932692308) True - >>> image_distance(0, 0) + >>> image_distance(0, 0) # doctest: +NORMALIZE_WHITESPACE Traceback (most recent call last): ... ValueError: Invalid inputs. Enter non zero values with respect