Skip to content
Snippets Groups Projects
Commit 3ddf218b authored by Frederik Hennig's avatar Frederik Hennig
Browse files

code style cleanup

parent 3a49e20e
No related branches found
No related tags found
No related merge requests found
Pipeline #57179 passed
...@@ -4,7 +4,6 @@ from typing import Sequence, Any ...@@ -4,7 +4,6 @@ from typing import Sequence, Any
from enum import Enum, auto from enum import Enum, auto
from dataclasses import dataclass, replace, asdict, InitVar from dataclasses import dataclass, replace, asdict, InitVar
from argparse import ArgumentParser from argparse import ArgumentParser
from os import path
from importlib import util as iutil from importlib import util as iutil
......
...@@ -10,7 +10,7 @@ from pystencils.astnodes import KernelFunction ...@@ -10,7 +10,7 @@ from pystencils.astnodes import KernelFunction
from .configuration import SfgConfiguration, config_from_commandline, merge_configurations, SfgCodeStyle from .configuration import SfgConfiguration, config_from_commandline, merge_configurations, SfgCodeStyle
from .kernel_namespace import SfgKernelNamespace, SfgKernelHandle from .kernel_namespace import SfgKernelNamespace, SfgKernelHandle
from .tree import SfgCallTreeNode, SfgSequence, SfgKernelCallNode, SfgStatements from .tree import SfgCallTreeNode, SfgKernelCallNode, SfgStatements
from .tree.deferred_nodes import SfgDeferredFieldMapping from .tree.deferred_nodes import SfgDeferredFieldMapping
from .tree.builders import SfgBranchBuilder, make_sequence from .tree.builders import SfgBranchBuilder, make_sequence
from .tree.visitors import CollectIncludes from .tree.visitors import CollectIncludes
......
...@@ -4,7 +4,7 @@ from pystencils.typing import FieldPointerSymbol, FieldStrideSymbol, FieldShapeS ...@@ -4,7 +4,7 @@ from pystencils.typing import FieldPointerSymbol, FieldStrideSymbol, FieldShapeS
from ...tree import SfgStatements from ...tree import SfgStatements
from ..source_objects import SrcField, SrcVector from ..source_objects import SrcField, SrcVector
from ..source_objects import SrcObject, TypedSymbolOrObject from ..source_objects import TypedSymbolOrObject
from ...types import SrcType, PsType, cpp_typename from ...types import SrcType, PsType, cpp_typename
from ...source_components.header_include import SfgHeaderInclude from ...source_components.header_include import SfgHeaderInclude
from ...exceptions import SfgException from ...exceptions import SfgException
......
from __future__ import annotations from __future__ import annotations
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from pystencilssfg.context import SfgContext
if TYPE_CHECKING:
from ..context import SfgContext
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from pystencils import Field, TypedSymbol from pystencils import Field
from pystencils.typing import FieldPointerSymbol, FieldShapeSymbol, FieldStrideSymbol from pystencils.typing import FieldPointerSymbol, FieldShapeSymbol, FieldStrideSymbol
from ..exceptions import SfgException from ..exceptions import SfgException
...@@ -19,6 +14,9 @@ from .builders import make_sequence ...@@ -19,6 +14,9 @@ from .builders import make_sequence
from ..source_concepts import SrcField from ..source_concepts import SrcField
from ..source_concepts.source_objects import TypedSymbolOrObject from ..source_concepts.source_objects import TypedSymbolOrObject
if TYPE_CHECKING:
from ..context import SfgContext
class SfgDeferredNode(SfgCallTreeNode, ABC): class SfgDeferredNode(SfgCallTreeNode, ABC):
"""Nodes of this type are inserted as placeholders into the kernel call tree """Nodes of this type are inserted as placeholders into the kernel call tree
......
from __future__ import annotations from __future__ import annotations
from typing import Callable, TypeVar, Generic, Any, ParamSpec, Concatenate from typing import Callable, TypeVar, Generic, ParamSpec
from types import MethodType from types import MethodType
from functools import wraps from functools import wraps
...@@ -10,6 +10,7 @@ V = TypeVar("V") ...@@ -10,6 +10,7 @@ V = TypeVar("V")
R = TypeVar("R") R = TypeVar("R")
P = ParamSpec("P") P = ParamSpec("P")
class VisitorDispatcher(Generic[V, R]): class VisitorDispatcher(Generic[V, R]):
def __init__(self, wrapped_method: Callable[..., R]): def __init__(self, wrapped_method: Callable[..., R]):
self._dispatch_dict: dict[type, Callable[..., R]] = {} self._dispatch_dict: dict[type, Callable[..., R]] = {}
......
...@@ -4,8 +4,6 @@ from typing import TYPE_CHECKING ...@@ -4,8 +4,6 @@ from typing import TYPE_CHECKING
from functools import reduce from functools import reduce
from pystencils.typing import TypedSymbol
from .basic_nodes import SfgCallTreeNode, SfgCallTreeLeaf, SfgSequence, SfgStatements from .basic_nodes import SfgCallTreeNode, SfgCallTreeLeaf, SfgSequence, SfgStatements
from .deferred_nodes import SfgParamCollectionDeferredNode from .deferred_nodes import SfgParamCollectionDeferredNode
from .dispatcher import visitor from .dispatcher import visitor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment