Commit 6373c03a authored by Martin Bauer's avatar Martin Bauer
Browse files

Import sorting using isort

parent cd0949ab
import numpy as np
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import Optional, Callable, Sequence, Iterable, Tuple, Dict, Union from typing import Callable, Dict, Iterable, Optional, Sequence, Tuple, Union
import numpy as np
from pystencils.field import Field from pystencils.field import Field
......
import os import os
import numpy as np
import warnings import warnings
from pystencils import Field
import numpy as np
# noinspection PyPep8Naming
import waLBerla as wlb
from pystencils.datahandling.blockiteration import block_iteration, sliced_block_iteration
from pystencils.datahandling.datahandling_interface import DataHandling from pystencils.datahandling.datahandling_interface import DataHandling
from pystencils.datahandling.blockiteration import sliced_block_iteration, block_iteration from pystencils.field import Field
from pystencils.kernelparameters import FieldPointerSymbol from pystencils.kernelparameters import FieldPointerSymbol
from pystencils.utils import DotDict from pystencils.utils import DotDict
# noinspection PyPep8Naming
import waLBerla as wlb
class ParallelDataHandling(DataHandling): class ParallelDataHandling(DataHandling):
......
import itertools import itertools
import time
from typing import Sequence, Union from typing import Sequence, Union
import numpy as np import numpy as np
import time
from pystencils import Field
from pystencils.datahandling.datahandling_interface import DataHandling
from pystencils.field import layout_string_to_tuple, spatial_layout_string_to_tuple, create_numpy_array_with_layout
from pystencils.datahandling.blockiteration import SerialBlock from pystencils.datahandling.blockiteration import SerialBlock
from pystencils.datahandling.datahandling_interface import DataHandling
from pystencils.field import (
Field, create_numpy_array_with_layout, layout_string_to_tuple, spatial_layout_string_to_tuple)
from pystencils.slicing import normalize_slice, remove_ghost_layers from pystencils.slicing import normalize_slice, remove_ghost_layers
from pystencils.utils import DotDict from pystencils.utils import DotDict
......
from pyevtk.vtk import VtkFile, VtkImageData
from pyevtk.hl import _addDataToFile, _appendDataToFile from pyevtk.hl import _addDataToFile, _appendDataToFile
from pyevtk.vtk import VtkFile, VtkImageData
def image_to_vtk(path, cell_data, origin=(0.0, 0.0, 0.0), spacing=(1.0, 1.0, 1.0)): def image_to_vtk(path, cell_data, origin=(0.0, 0.0, 0.0), spacing=(1.0, 1.0, 1.0)):
......
import sympy as sp
from typing import Any, Dict, Optional from typing import Any, Dict, Optional
import sympy as sp
from pystencils.astnodes import KernelFunction from pystencils.astnodes import KernelFunction
......
import sympy as sp
from typing import List, Union from typing import List, Union
import sympy as sp
from pystencils.astnodes import Node from pystencils.astnodes import Node
from pystencils.simp import AssignmentCollection from pystencils.simp import AssignmentCollection
......
from .derivative import Diff, DiffOperator, \ from .derivative import (
diff_terms, collect_diffs, zero_diffs, evaluate_diffs, normalize_diff_order, \ Diff, DiffOperator, collect_diffs, combine_diff_products, diff, diff_terms, evaluate_diffs,
expand_diff_full, expand_diff_linear, expand_diff_products, combine_diff_products, \ expand_diff_full, expand_diff_linear, expand_diff_products, functional_derivative,
functional_derivative, diff normalize_diff_order, zero_diffs)
from .finitedifferences import advection, diffusion, transient, Discretization2ndOrder from .finitedifferences import Discretization2ndOrder, advection, diffusion, transient
from .spatial import discretize_spatial, discretize_spatial_staggered from .spatial import discretize_spatial, discretize_spatial_staggered
__all__ = ['Diff', 'diff', 'DiffOperator', 'diff_terms', 'collect_diffs', __all__ = ['Diff', 'diff', 'DiffOperator', 'diff_terms', 'collect_diffs',
......
import sympy as sp
from collections import defaultdict from collections import defaultdict
import sympy as sp
from pystencils.field import Field from pystencils.field import Field
from pystencils.sympyextensions import prod, multidimensional_sum from pystencils.sympyextensions import multidimensional_sum, prod
from pystencils.utils import fully_contains, LinearEquationSystem from pystencils.utils import LinearEquationSystem, fully_contains
class FiniteDifferenceStencilDerivation: class FiniteDifferenceStencilDerivation:
......
from collections import defaultdict, namedtuple
import sympy as sp import sympy as sp
from collections import namedtuple, defaultdict
from pystencils import Field from pystencils.field import Field
from pystencils.sympyextensions import normalize_product, prod from pystencils.sympyextensions import normalize_product, prod
......
from typing import Optional, Union
import numpy as np import numpy as np
import sympy as sp import sympy as sp
from typing import Union, Optional
from pystencils import Field, AssignmentCollection
from pystencils.fd import Diff from pystencils.fd import Diff
from pystencils.fd.derivative import diff_args from pystencils.fd.derivative import diff_args
from pystencils.fd.spatial import fd_stencils_standard from pystencils.fd.spatial import fd_stencils_standard
from pystencils.field import Field
from pystencils.simp.assignment_collection import AssignmentCollection
from pystencils.sympyextensions import fast_subs from pystencils.sympyextensions import fast_subs
FieldOrFieldAccess = Union[Field, Field.Access] FieldOrFieldAccess = Union[Field, Field.Access]
......
from typing import Tuple from typing import Tuple
import sympy as sp import sympy as sp
from pystencils.astnodes import LoopOverCoordinate from pystencils.astnodes import LoopOverCoordinate
from pystencils.cache import memorycache from pystencils.cache import memorycache
from pystencils import Field
from pystencils.fd import Diff from pystencils.fd import Diff
from pystencils.field import Field
from pystencils.transformations import generic_visit from pystencils.transformations import generic_visit
from .derivative import diff_args
from .derivation import FiniteDifferenceStencilDerivation from .derivation import FiniteDifferenceStencilDerivation
from .derivative import diff_args
def fd_stencils_standard(indices, dx, fa): def fd_stencils_standard(indices, dx, fa):
......
import hashlib
import pickle
import re
from enum import Enum from enum import Enum
from itertools import chain from itertools import chain
from typing import Tuple, Sequence, Optional, List, Set from typing import List, Optional, Sequence, Set, Tuple
import numpy as np import numpy as np
import sympy as sp import sympy as sp
import re
from sympy.core.cache import cacheit from sympy.core.cache import cacheit
from pystencils.alignedarray import aligned_empty from pystencils.alignedarray import aligned_empty
from pystencils.data_types import create_type, StructType from pystencils.data_types import StructType, create_type
from pystencils.kernelparameters import FieldShapeSymbol, FieldStrideSymbol from pystencils.kernelparameters import FieldShapeSymbol, FieldStrideSymbol
from pystencils.stencil import offset_to_direction_string, direction_string_to_offset from pystencils.stencil import direction_string_to_offset, offset_to_direction_string
from pystencils.sympyextensions import is_integer_sequence from pystencils.sympyextensions import is_integer_sequence
import pickle
import hashlib
__all__ = ['Field', 'fields', 'FieldType', 'AbstractField'] __all__ = ['Field', 'fields', 'FieldType', 'AbstractField']
......
from pystencils.gpucuda.kernelcreation import create_cuda_kernel, created_indexed_cuda_kernel
from pystencils.gpucuda.cudajit import make_python_function from pystencils.gpucuda.cudajit import make_python_function
from pystencils.gpucuda.kernelcreation import create_cuda_kernel, created_indexed_cuda_kernel
from .indexing import AbstractIndexing, BlockIndexing, LineIndexing from .indexing import AbstractIndexing, BlockIndexing, LineIndexing
__all__ = ['create_cuda_kernel', 'created_indexed_cuda_kernel', 'make_python_function', __all__ = ['create_cuda_kernel', 'created_indexed_cuda_kernel', 'make_python_function',
'AbstractIndexing', 'BlockIndexing', 'LineIndexing'] 'AbstractIndexing', 'BlockIndexing', 'LineIndexing']
import numpy as np import numpy as np
from pystencils.backends.cbackend import generate_c, get_headers from pystencils.backends.cbackend import generate_c, get_headers
from pystencils.kernelparameters import FieldPointerSymbol
from pystencils.data_types import StructType from pystencils.data_types import StructType
from pystencils.field import FieldType from pystencils.field import FieldType
from pystencils.include import get_pystencils_include_path from pystencils.include import get_pystencils_include_path
from pystencils.kernelparameters import FieldPointerSymbol
USE_FAST_MATH = True USE_FAST_MATH = True
......
import abc import abc
from functools import partial
from typing import Tuple # noqa from typing import Tuple # noqa
import sympy as sp import sympy as sp
from pystencils.astnodes import Conditional, Block
from pystencils.astnodes import Block, Conditional
from pystencils.data_types import TypedSymbol, create_type
from pystencils.integer_functions import div_ceil, div_floor from pystencils.integer_functions import div_ceil, div_floor
from pystencils.slicing import normalize_slice from pystencils.slicing import normalize_slice
from pystencils.data_types import TypedSymbol, create_type from pystencils.sympyextensions import is_integer_sequence, prod
from functools import partial
from pystencils.sympyextensions import prod, is_integer_sequence
BLOCK_IDX = [TypedSymbol("blockIdx." + coord, create_type("int")) for coord in ('x', 'y', 'z')] BLOCK_IDX = [TypedSymbol("blockIdx." + coord, create_type("int")) for coord in ('x', 'y', 'z')]
THREAD_IDX = [TypedSymbol("threadIdx." + coord, create_type("int")) for coord in ('x', 'y', 'z')] THREAD_IDX = [TypedSymbol("threadIdx." + coord, create_type("int")) for coord in ('x', 'y', 'z')]
......
from pystencils.gpucuda.indexing import BlockIndexing from pystencils.astnodes import Block, KernelFunction, LoopOverCoordinate, SympyAssignment
from pystencils.transformations import resolve_field_accesses, add_types, parse_base_pointer_info, \ from pystencils.data_types import BasicType, StructType, TypedSymbol
get_common_shape, resolve_buffer_accesses, unify_shape_symbols, get_base_buffer_index from pystencils.field import Field, FieldType
from pystencils.astnodes import Block, KernelFunction, SympyAssignment, LoopOverCoordinate
from pystencils.data_types import TypedSymbol, BasicType, StructType
from pystencils import Field, FieldType
from pystencils.gpucuda.cudajit import make_python_function from pystencils.gpucuda.cudajit import make_python_function
from pystencils.gpucuda.indexing import BlockIndexing
from pystencils.transformations import (
add_types, get_base_buffer_index, get_common_shape, parse_base_pointer_info,
resolve_buffer_accesses, resolve_field_accesses, unify_shape_symbols)
def create_cuda_kernel(assignments, function_name="kernel", type_info=None, indexing_creator=BlockIndexing, def create_cuda_kernel(assignments, function_name="kernel", type_info=None, indexing_creator=BlockIndexing,
......
import numpy as np import numpy as np
from pystencils import Field, Assignment
from pystencils.slicing import normalize_slice, get_periodic_boundary_src_dst_slices from pystencils import Assignment, Field
from pystencils.gpucuda import make_python_function from pystencils.gpucuda import make_python_function
from pystencils.gpucuda.kernelcreation import create_cuda_kernel from pystencils.gpucuda.kernelcreation import create_cuda_kernel
from pystencils.slicing import get_periodic_boundary_src_dst_slices, normalize_slice
def create_copy_kernel(domain_size, from_slice, to_slice, index_dimensions=0, index_dim_shape=1, dtype=np.float64): def create_copy_kernel(domain_size, from_slice, to_slice, index_dimensions=0, index_dim_shape=1, dtype=np.float64):
......
import sympy as sp import sympy as sp
from pystencils.data_types import get_type_of_expression, collate_types from pystencils.data_types import collate_types, get_type_of_expression
from pystencils.sympyextensions import is_integer_sequence from pystencils.sympyextensions import is_integer_sequence
bitwise_xor = sp.Function("bitwise_xor") bitwise_xor = sp.Function("bitwise_xor")
......
"""Transformations using integer sets based on ISL library""" """Transformations using integer sets based on ISL library"""
import sympy as sp
import islpy as isl import islpy as isl
import sympy as sp
import pystencils.astnodes as ast import pystencils.astnodes as ast
from pystencils.transformations import parents_of_type from pystencils.transformations import parents_of_type
......
import pystencils.plot as plt
import matplotlib.animation as animation
from IPython.display import HTML
from tempfile import NamedTemporaryFile
import base64 import base64
from tempfile import NamedTemporaryFile
import matplotlib.animation as animation
import sympy as sp import sympy as sp
from IPython.display import HTML
import pystencils.plot as plt
__all__ = ['log_progress', 'make_imshow_animation', 'display_animation', 'set_display_mode'] __all__ = ['log_progress', 'make_imshow_animation', 'display_animation', 'set_display_mode']
......
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