Commit 6b158fd3 authored by dboe's avatar dboe
Browse files

also allow legacy

parent d9770c2d
Pipeline #107384 passed with stage
in 35 seconds
......@@ -40,12 +40,14 @@ class TensorGrid(TensorFields):
obj = super(TensorGrid, cls).__new__(cls, tensors, *fields, **kwargs)
if len(base_vectors) == 3:
base_vectors = tuple(tuple(bv) for bv in base_vectors)
base_vectors = grid.ensure_complex(*base_vectors)
if (
isinstance(base_vectors, tuple)
isinstance(base_vectors, (tuple, list))
and base_vectors
and len(base_vectors[0]) == 3
):
base_vectors = grid.ensure_complex(*base_vectors)
if num is None:
num = np.array([int(bv[2].imag) for bv in base_vectors], dtype=int)
base_vectors = np.transpose([[bv[0], bv[1]] for bv in base_vectors])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment