Commit 5069715e authored by Daniel Boeckenhoff's avatar Daniel Boeckenhoff
Browse files

tfields.Mesh3D cutting works - except for templates on fields

parent 07604102
...@@ -388,6 +388,9 @@ class Tensors(AbstractNdarray): ...@@ -388,6 +388,9 @@ class Tensors(AbstractNdarray):
tensors = np.empty(tensors.shape, dtype=tensors.dtype) tensors = np.empty(tensors.shape, dtype=tensors.dtype)
elif dim is not None: elif dim is not None:
tensors = np.empty((0, dim)) tensors = np.empty((0, dim))
if issubclass(type(tensors), np.ndarray):
# np.empty
pass
else: else:
raise ValueError("Empty tensors need dimension " raise ValueError("Empty tensors need dimension "
"parameter 'dim'.") "parameter 'dim'.")
...@@ -1454,10 +1457,11 @@ class TensorMaps(TensorFields): ...@@ -1454,10 +1457,11 @@ class TensorMaps(TensorFields):
dims.append(map_field.dim) dims.append(map_field.dim)
else: else:
maps[mp_idx] = TensorFields.merged(maps[mp_idx], map_field) maps[mp_idx] = TensorFields.merged(maps[mp_idx], map_field)
kwargs['maps'] = maps # kwargs['maps'] = maps
obj = super(TensorMaps, cls).merged(*objects, **kwargs) inst = super(TensorMaps, cls).merged(*objects, **kwargs)
return cls.__new__(cls, obj, maps=maps) inst = cls.__new__(cls, inst, maps=maps)
return inst
def equal(self, other, **kwargs): def equal(self, other, **kwargs):
""" """
......
...@@ -108,3 +108,4 @@ else: ...@@ -108,3 +108,4 @@ else:
from .grid import igrid from .grid import igrid
from . import stats from . import stats
from .stats import mode, median, mean from .stats import mode, median, mean
from . import symbolics
This diff is collapsed.
Supports Markdown
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