From bcc92b601f9fa324c04bddfed45e30d09709cc7a Mon Sep 17 00:00:00 2001
From: Martin Bauer <martin.bauer@fau.de>
Date: Mon, 9 Apr 2018 10:45:13 +0200
Subject: [PATCH] Added data handling tests for VTK output and reduction

---
 datahandling/serial_datahandling.py | 4 ++--
 transformations/transformations.py  | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/datahandling/serial_datahandling.py b/datahandling/serial_datahandling.py
index c53bf26ef..d803d13cb 100644
--- a/datahandling/serial_datahandling.py
+++ b/datahandling/serial_datahandling.py
@@ -318,7 +318,7 @@ class SerialDataHandling(DataHandling):
             for name in data_names:
                 field = self._get_field_with_given_number_of_ghost_layers(name, ghost_layers)
                 if self.dim == 2:
-                    cell_data[name] = field[:, :, np.newaxis]
+                    field = field[:, :, np.newaxis]
                 if len(field.shape) == 3:
                     cell_data[name] = np.ascontiguousarray(field)
                 elif len(field.shape) == 4:
@@ -344,7 +344,7 @@ class SerialDataHandling(DataHandling):
             field = self._get_field_with_given_number_of_ghost_layers(data_name, ghost_layers)
             if self.dim == 2:
                 field = field[:, :, np.newaxis]
-            cell_data = {name: np.ascontiguousarray(np.bitwise_and(field, mask) > 0, dtype=np.uint8)
+            cell_data = {name: np.ascontiguousarray(np.bitwise_and(field, field.dtype.type(mask)) > 0, dtype=np.uint8)
                          for mask, name in masks_to_name.items()}
             image_to_vtk(full_file_name, cell_data=cell_data)
 
diff --git a/transformations/transformations.py b/transformations/transformations.py
index b26e01970..bc7a4a742 100644
--- a/transformations/transformations.py
+++ b/transformations/transformations.py
@@ -1,7 +1,5 @@
 from collections import defaultdict, OrderedDict
-from operator import attrgetter
 from copy import deepcopy
-import functools
 
 import sympy as sp
 from sympy.logic.boolalg import Boolean
-- 
GitLab