From ed1cf137aa0780d5aeff94de21d12cb0150e0cc0 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Sun, 12 Mar 2023 13:30:44 +0000 Subject: [PATCH] Update raytrace benchmark to work with native floats Related to python/mypy#14880. --- benchmarks/bm_raytrace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/bm_raytrace.py b/benchmarks/bm_raytrace.py index 3569844..9a7c2d3 100644 --- a/benchmarks/bm_raytrace.py +++ b/benchmarks/bm_raytrace.py @@ -259,7 +259,7 @@ def __init__(self) -> None: self.lightPoints: list[Point] = [] self.position = Point(0, 1.8, 10) self.lookingAt = Point_ZERO - self.fieldOfView: float = 45 + self.fieldOfView: float = 45.0 self.recursionDepth = 0 def moveTo(self, p: Point) -> None: @@ -363,7 +363,7 @@ def colourAt(self, scene: Scene, ray: Ray, p: Point, normal: Vector) -> Colour: c = addColours(c, self.specularCoefficient, reflectedColour) if self.lambertCoefficient > 0: - lambertAmount: float = 0 + lambertAmount: float = 0.0 for lightPoint in scene.visibleLights(p): contribution = (lightPoint - p).normalized().dot(normal) if contribution > 0: