From ea943334f921f60b51f33d21d43907df1848ebbf Mon Sep 17 00:00:00 2001 From: Markus Holzer <markus.holzer@fau.de> Date: Wed, 11 May 2022 11:59:42 +0200 Subject: [PATCH] Fix flake8 --- pystencils/boundaries/createindexlist.py | 8 ++++---- pystencils/cpu/kernelcreation.py | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pystencils/boundaries/createindexlist.py b/pystencils/boundaries/createindexlist.py index afa2d5a9f..8619a31d6 100644 --- a/pystencils/boundaries/createindexlist.py +++ b/pystencils/boundaries/createindexlist.py @@ -46,8 +46,8 @@ def _create_index_list_python(flag_field_arr, boundary_mask, nr_of_ghost_layers = 0 coordinate_names = boundary_index_array_coordinate_names[:len(flag_field_arr.shape)] - index_arr_dtype = np.dtype([(name, default_index_array_dtype) for name in coordinate_names] + - [(direction_member_name, default_index_array_dtype)]) + index_arr_dtype = np.dtype([(name, default_index_array_dtype) for name in coordinate_names] + + [(direction_member_name, default_index_array_dtype)]) # boundary cells are extracted via np.where. To ensure continous memory access in the compute kernel these cells # have to be sorted. @@ -119,8 +119,8 @@ def create_boundary_index_list(flag_field, stencil, boundary_mask, fluid_mask, """ dim = len(flag_field.shape) coordinate_names = boundary_index_array_coordinate_names[:dim] - index_arr_dtype = np.dtype([(name, default_index_array_dtype) for name in coordinate_names] + - [(direction_member_name, default_index_array_dtype)]) + index_arr_dtype = np.dtype([(name, default_index_array_dtype) for name in coordinate_names] + + [(direction_member_name, default_index_array_dtype)]) stencil = np.array(stencil, dtype=default_index_array_dtype) args = (flag_field, nr_of_ghost_layers, boundary_mask, fluid_mask, stencil, single_link) diff --git a/pystencils/cpu/kernelcreation.py b/pystencils/cpu/kernelcreation.py index 746e7b191..4cf0955a5 100644 --- a/pystencils/cpu/kernelcreation.py +++ b/pystencils/cpu/kernelcreation.py @@ -1,7 +1,6 @@ from typing import Union import sympy as sp -import numpy as np import pystencils.astnodes as ast from pystencils.simp.assignment_collection import AssignmentCollection @@ -9,7 +8,7 @@ from pystencils.config import CreateKernelConfig from pystencils.enums import Target, Backend from pystencils.astnodes import Block, KernelFunction, LoopOverCoordinate, SympyAssignment from pystencils.cpu.cpujit import make_python_function -from pystencils.typing import StructType, TypedSymbol, create_type, get_type_of_expression +from pystencils.typing import StructType, TypedSymbol, create_type from pystencils.typing.transformations import add_types from pystencils.field import Field, FieldType from pystencils.node_collection import NodeCollection -- GitLab