From c95341c9b9945a96fb03d6a237ea0cb1e631cff3 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Wed, 31 Jul 2024 22:50:34 -0700 Subject: [PATCH] be clearer about floats --- gridlock/draw.py | 2 +- gridlock/examples/ex0.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gridlock/draw.py b/gridlock/draw.py index e10d4ff..52e02f5 100644 --- a/gridlock/draw.py +++ b/gridlock/draw.py @@ -297,7 +297,7 @@ class GridDrawMixin(GridPosMixin): p = numpy.array([[-dimensions[0], +dimensions[1]], [+dimensions[0], +dimensions[1]], [+dimensions[0], -dimensions[1]], - [-dimensions[0], -dimensions[1]]], dtype=float) / 2.0 + [-dimensions[0], -dimensions[1]]], dtype=float) * 0.5 thickness = dimensions[2] self.draw_polygon(cell_data, 2, center, p, thickness, foreground) diff --git a/gridlock/examples/ex0.py b/gridlock/examples/ex0.py index b96cdca..d13a8cf 100644 --- a/gridlock/examples/ex0.py +++ b/gridlock/examples/ex0.py @@ -29,9 +29,9 @@ if __name__ == '__main__': # numpy.linspace(-5.5, 5.5, 10)] half_x = [.25, .5, 0.75, 1, 1.25, 1.5, 2, 2.5, 3, 3.5] - xyz3 = [numpy.array([-x for x in half_x[::-1]] + [0] + half_x), - numpy.linspace(-5.5, 5.5, 10), - numpy.linspace(-5.5, 5.5, 10)] + xyz3 = [numpy.array([-x for x in half_x[::-1]] + [0] + half_x, dtype=float), + numpy.linspace(-5.5, 5.5, 10, dtype=float), + numpy.linspace(-5.5, 5.5, 10, dtype=float)] eg = Grid(xyz3) egc = eg.allocate(0) # eg.draw_slab(Direction.z, 0, 10, 2)