unvec to (3, *shape) rather than list-of-ndarrays

fdtd_extras
Jan Petykiewicz 5 years ago
parent 2acbda4764
commit d462ae9412

@ -45,5 +45,5 @@ def unvec(v: vfield_t, shape: numpy.ndarray) -> field_t:
"""
if numpy.any(numpy.equal(v, None)):
return None
return [vi.reshape(shape, order='C') for vi in numpy.split(v, 3)]
return vi.reshape((3, *shape), order='C')

Loading…
Cancel
Save