From 0c4a773b848f66838e82b5d730f3d2a72e734a6e Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 30 Sep 2019 23:34:49 -0700 Subject: [PATCH] Make .grids an ndarray instead of a list-of-ndarrays --- gridlock/grid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gridlock/grid.py b/gridlock/grid.py index bf69c11..0ba2f62 100644 --- a/gridlock/grid.py +++ b/gridlock/grid.py @@ -47,7 +47,7 @@ class Grid(object): exyz = [] # type: List[numpy.ndarray] # epsilon (or mu, or whatever) grids - grids = [] # type: List[numpy.ndarray] + grids = [] # type: numpy.ndarray # [[x0 y0 z0], [x1, y1, z1], ...] offsets for grid 0,1,... shifts = None # type: numpy.ndarray @@ -265,7 +265,7 @@ class Grid(object): if len(initial) < num_grids: raise GridError('Too few initial grids specified!') - self.grids = [None] * num_grids + self.grids = numpy.empty(grids_shape) for i in range(num_grids): if is_scalar(initial[i]): if initial[i] is not None: