Skip to content
Snippets Groups Projects
Commit bbb7ab95 authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'kernel-wrapper-typeannotations' into 'master'

Add typeannotations and docstring for KernelWrapper

See merge request pycodegen/pystencils!136
parents f16225d5 2e7f2703
1 merge request!136Add typeannotations and docstring for KernelWrapper
Pipeline #21247 failed with stages
in 3 minutes and 24 seconds
import os import os
import runpy import runpy
import sys import sys
import warnings
import tempfile import tempfile
import warnings
import nbformat import nbformat
import pytest import pytest
...@@ -34,7 +34,7 @@ def add_path_to_ignore(path): ...@@ -34,7 +34,7 @@ def add_path_to_ignore(path):
collect_ignore = [os.path.join(SCRIPT_FOLDER, "doc", "conf.py"), collect_ignore = [os.path.join(SCRIPT_FOLDER, "doc", "conf.py"),
os.path.join(SCRIPT_FOLDER, "pystencils", "opencl", "opencl.autoinit")] os.path.join(SCRIPT_FOLDER, "pystencils", "opencl", "opencl.autoinit")]
add_path_to_ignore('pystencils_tests/benchmark') add_path_to_ignore('pystencils_tests/benchmark')
add_path_to_ignore('_local_tmp') add_path_to_ignore('_local_tmp')
...@@ -83,8 +83,6 @@ for root, sub_dirs, files in os.walk('.'): ...@@ -83,8 +83,6 @@ for root, sub_dirs, files in os.walk('.'):
collect_ignore.append(f) collect_ignore.append(f)
class IPythonMockup: class IPythonMockup:
def run_line_magic(self, *args, **kwargs): def run_line_magic(self, *args, **kwargs):
pass pass
......
"""
Light-weight wrapper around a compiled kernel
"""
import pystencils import pystencils
class KernelWrapper: class KernelWrapper:
def __init__(self, kernel, parameters, ast_node): """
Light-weight wrapper around a compiled kernel.
Can be called while still providing access to underlying AST.
"""
def __init__(self, kernel, parameters, ast_node: pystencils.astnodes.KernelFunction):
self.kernel = kernel self.kernel = kernel
self.parameters = parameters self.parameters = parameters
self.ast = ast_node self.ast = ast_node
......
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