Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 66-absolute-access-is-probably-not-copied-correctly-after-_eval_subs
  • const_fix
  • fhennig/v2.0-deprecations
  • fma
  • gpu_bufferfield_fix
  • gpu_liveness_opts
  • holzer-master-patch-46757
  • hyteg
  • improved_comm
  • master
  • target_dh_refactoring
  • v2.0-dev
  • vectorization_sqrt_fix
  • zikeliml/124-rework-tutorials
  • zikeliml/Task-96-dotExporterForAST
  • last/Kerncraft
  • last/LLVM
  • last/OpenCL
  • release/0.2.1
  • release/0.2.10
  • release/0.2.11
  • release/0.2.12
  • release/0.2.13
  • release/0.2.14
  • release/0.2.15
  • release/0.2.2
  • release/0.2.3
  • release/0.2.4
  • release/0.2.6
  • release/0.2.7
  • release/0.2.8
  • release/0.2.9
  • release/0.3.0
  • release/0.3.1
  • release/0.3.2
  • release/0.3.3
  • release/0.3.4
  • release/0.4.0
  • release/0.4.1
  • release/0.4.2
  • release/0.4.3
  • release/0.4.4
  • release/1.0
  • release/1.0.1
  • release/1.1
  • release/1.1.1
  • release/1.2
  • release/1.3
  • release/1.3.1
  • release/1.3.2
  • release/1.3.3
  • release/1.3.4
  • release/1.3.5
  • release/1.3.6
  • release/1.3.7
  • release/2.0.dev0
56 results

Target

Select target project
No results found
Select Git revision
  • 66-absolute-access-is-probably-not-copied-correctly-after-_eval_subs
  • const_fix
  • fhennig/v2.0-deprecations
  • fma
  • gpu_bufferfield_fix
  • gpu_liveness_opts
  • holzer-master-patch-46757
  • hyteg
  • improved_comm
  • master
  • target_dh_refactoring
  • v2.0-dev
  • vectorization_sqrt_fix
  • zikeliml/124-rework-tutorials
  • zikeliml/Task-96-dotExporterForAST
  • last/Kerncraft
  • last/LLVM
  • last/OpenCL
  • release/0.2.1
  • release/0.2.10
  • release/0.2.11
  • release/0.2.12
  • release/0.2.13
  • release/0.2.14
  • release/0.2.15
  • release/0.2.2
  • release/0.2.3
  • release/0.2.4
  • release/0.2.6
  • release/0.2.7
  • release/0.2.8
  • release/0.2.9
  • release/0.3.0
  • release/0.3.1
  • release/0.3.2
  • release/0.3.3
  • release/0.3.4
  • release/0.4.0
  • release/0.4.1
  • release/0.4.2
  • release/0.4.3
  • release/0.4.4
  • release/1.0
  • release/1.0.1
  • release/1.1
  • release/1.1.1
  • release/1.2
  • release/1.3
  • release/1.3.1
  • release/1.3.2
  • release/1.3.3
  • release/1.3.4
  • release/1.3.5
  • release/1.3.6
  • release/1.3.7
  • release/2.0.dev0
56 results
Show changes

Commits on Source 249

149 additional commits have been omitted to prevent performance issues.
385 files
+ 30610
13920
Compare changes
  • Side-by-side
  • Inline

Files

+2 −1
Original line number Original line Diff line number Diff line
@@ -3,4 +3,5 @@ max-line-length=120
exclude=src/pystencils/jupyter.py,
exclude=src/pystencils/jupyter.py,
        src/pystencils/plot.py
        src/pystencils/plot.py
        src/pystencils/session.py
        src/pystencils/session.py
ignore = W293 W503 W291 C901 E741
        src/pystencils/old
ignore = W293 W503 W291 C901 E741 E704
+1 −1
Original line number Original line Diff line number Diff line
pystencils/_version.py export-subst
src/pystencils/_version.py export-subst
+3 −0
Original line number Original line Diff line number Diff line
__pycache__
__pycache__
.ipynb_checkpoints
.ipynb_checkpoints

.coverage*
.coverage*
coverage.xml

*.pyc
*.pyc
*.vti
*.vti
/build
/build
+96 −63
Original line number Original line Diff line number Diff line
stages:
stages:
  - pretest
  - "Code Quality"
  - test
  - "Unit Tests"
  - legacy_test
  - docs
  - deploy
  - deploy




# --------------------------  Tests ------------------------------------------------------------------------------------
# --------------------------  Legacy Tests  ------------------------------------------------------------------------------------

# Normal test - runs on every commit all but "long run" tests
tests-and-coverage:
  stage: pretest
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  before_script:
    - pip install -e .
  script:
    - env
    - pip list
    - export NUM_CORES=$(nproc --all)
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
    - mkdir public
    - pytest -v -n $NUM_CORES --cov-report html --cov-report xml --cov-report term --cov=. -m "not longrun" --html test-report/index.html --junitxml=report.xml
    - python -m coverage xml
  tags:
    - docker
    - cuda11
    - AVX
  coverage: /Total coverage:\s\d+.\d+\%/
  artifacts:
    when: always
    paths:
      - coverage_report
      - test-report
    reports:
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml
      junit: report.xml


# Normal test with longruns
# Normal test with longruns
tests-and-coverage-with-longrun:
tests-and-coverage-with-longrun:
  stage: test
  stage: legacy_test
  when: manual
  when: manual
  allow_failure: true
  allow_failure: true
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
@@ -64,7 +32,9 @@ tests-and-coverage-with-longrun:


# pipeline with latest python version
# pipeline with latest python version
latest-python:
latest-python:
  stage: test
  stage: legacy_test
  allow_failure: true
  when: manual
  except:
  except:
    variables:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
      - $ENABLE_NIGHTLY_BUILDS
@@ -107,7 +77,9 @@ latest-python:
#    - py.test -v -m "not (notebook or longrun)"
#    - py.test -v -m "not (notebook or longrun)"


ubuntu:
ubuntu:
  stage: test
  stage: legacy_test
  allow_failure: true
  when: manual
  except:
  except:
    variables:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
      - $ENABLE_NIGHTLY_BUILDS
@@ -133,7 +105,9 @@ ubuntu:
      junit: report.xml
      junit: report.xml


.multiarch_template:
.multiarch_template:
  stage: test
  stage: legacy_test
  allow_failure: true
  when: manual
  except:
  except:
    variables:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
      - $ENABLE_NIGHTLY_BUILDS
@@ -200,7 +174,9 @@ riscv64:
    - sed -i 's/fopenmp/fopenmp=libgomp -I\/usr\/include\/riscv64-linux-gnu/g' ~/.config/pystencils/config.json
    - sed -i 's/fopenmp/fopenmp=libgomp -I\/usr\/include\/riscv64-linux-gnu/g' ~/.config/pystencils/config.json


minimal-conda:
minimal-conda:
  stage: pretest
  stage: legacy_test
  allow_failure: true
  when: manual
  except:
  except:
    variables:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
      - $ENABLE_NIGHTLY_BUILDS
@@ -215,7 +191,9 @@ minimal-conda:




minimal-sympy-master:
minimal-sympy-master:
  stage: test
  stage: legacy_test
  allow_failure: true
  when: manual
  except:
  except:
    variables:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
      - $ENABLE_NIGHTLY_BUILDS
@@ -225,7 +203,6 @@ minimal-sympy-master:
  script:
  script:
    - python -m pip install --upgrade git+https://github.com/sympy/sympy.git
    - python -m pip install --upgrade git+https://github.com/sympy/sympy.git
    - python quicktest.py
    - python quicktest.py
  allow_failure: true
  tags:
  tags:
    - docker
    - docker
    - cuda
    - cuda
@@ -233,7 +210,7 @@ minimal-sympy-master:


pycodegen-integration:
pycodegen-integration:
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  stage: test
  stage: legacy_test
  when: manual
  when: manual
  allow_failure: true
  allow_failure: true
  script:
  script:
@@ -275,44 +252,100 @@ pycodegen-integration:
    reports:
    reports:
      junit: pycodegen/*/report.xml
      junit: pycodegen/*/report.xml


# -------------------- Linter & Documentation --------------------------------------------------------------------------
# -------------------- Code Quality ---------------------------------------------------------------------



flake8-lint:
.qa-base:
  stage: pretest
  stage: "Code Quality"
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/nox:alpine
  needs: []
  except:
  except:
    variables:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  tags:
    - docker

lint:
  extends: .qa-base
  script:
    - nox --session lint

typecheck:
  extends: .qa-base
  script:
    - nox --session typecheck

# -------------------- Unit Tests ---------------------------------------------------------------------

.testsuite-base:
  stage: "Unit Tests"
  needs: []
  coverage: /Total coverage:\s\d+.\d+\%/
  artifacts:
    when: always
    paths:
      - coverage_report
      - test-report
    reports:
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml
      junit: report.xml

"testsuite-gpu-py3.10":
  extends: .testsuite-base
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/nox:ubuntu24.04-cuda12.6
  script:
  script:
    - flake8 src/pystencils
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
    - mkdir public
    - nox --session "testsuite-3.10(cupy12)"
  tags:
    - docker
    - cuda11
    - AVX

"testsuite-cpu-py3.13":
  extends: .testsuite-base
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/nox:alpine
  script:
    - nox --session "testsuite-3.13(cpu)"
  tags:
    - docker
    - AVX

"testsuite-experimental-jit-py3.10":
  extends: .testsuite-base
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/nox:alpine
  script:
    - nox -s "testsuite-3.10(cpu)" -- --experimental-cpu-jit
  tags:
  tags:
    - docker
    - docker
    - AVX

# -------------------- Documentation ---------------------------------------------------------------------




build-documentation:
build-documentation:
  stage: test
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/nox:ubuntu24.04-cuda12.6
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/documentation
  stage: docs
  before_script:
  needs: []
    - pip install -e .
  script:
  script:
    - mkdir html_doc
    - nox --session docs -- --fail-on-warnings
    - sphinx-build -b html doc  html_doc
    - sphinx-build -W -b html doc  html_doc
  tags:
  tags:
    - docker
    - docker
    - cuda11
  artifacts:
  artifacts:
    paths:
    paths:
      - html_doc
      - docs/build/html




pages:
pages:
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  image: alpine:latest
  stage: deploy
  stage: deploy
  needs: ["testsuite-gpu-py3.10", "build-documentation"]
  script:
  script:
    - ls -l
    - mv docs/build/html public
    - mv coverage_report html_doc
    - mv coverage_report public/coverage_report
    - mv html_doc public  # folder has to be named "public" for gitlab to publish it
  artifacts:
  artifacts:
    paths:
    paths:
      - public
      - public
+32 −0
Original line number Original line Diff line number Diff line
# pystencils 2.0 Development Branch

You are currently viewing the development branch `v2.0-dev` for *pystencils 2.0*.
This version marks a complete redesign of pystencil's internal structure.
The type system, code generators, and just-in-time-compilers are being completely rebuilt here.

## Early Adoption

The development version of pystencils is now ready for early adoption by users.
Install the current pre-release version either directly through pip:

```
pip install "git+https://i10git.cs.fau.de/pycodegen/pystencils.git@v2.0-dev"
```

Or clone the repository locally and do an editable install:
```
git clone -b v2.0-dev https://i10git.cs.fau.de/pycodegen/pystencils.git
pip install -e pystencils
```

## Documentation

 - Documentation for the current development version can be found [here](https://pycodegen.pages.i10git.cs.fau.de/docs/pystencils/2.0dev/)
 - Progress toward the 2.0 release is being tracked [here](https://i10git.cs.fau.de/pycodegen/pystencils/-/milestones/3#tab-issues)

## Contributing

Please refer to [the contribution guide](https://pycodegen.pages.i10git.cs.fau.de/docs/pystencils/2.0dev/contributing/index.html).

---

pystencils
pystencils
==========
==========


+79 −43
Original line number Original line Diff line number Diff line
@@ -3,31 +3,32 @@ import runpy
import sys
import sys
import tempfile
import tempfile
import warnings
import warnings
import pathlib


import nbformat
import nbformat
import pytest
import pytest
from nbconvert import PythonExporter


from pystencils.boundaries.createindexlist import *  # NOQA
# Trigger config file reading / creation once - to avoid race conditions when multiple instances are creating it
# Trigger config file reading / creation once - to avoid race conditions when multiple instances are creating it
# at the same time
# at the same time
from pystencils.cpu import cpujit
# TODO: replace with new backend
# from pystencils.cpu import cpujit


# trigger cython imports - there seems to be a problem when multiple processes try to compile the same cython file
# trigger cython imports - there seems to be a problem when multiple processes try to compile the same cython file
# at the same time
# at the same time
try:
try:
    import pyximport
    import pyximport

    pyximport.install(language_level=3)
    pyximport.install(language_level=3)
    from pystencils.boundaries.createindexlistcython import *  # NOQA
except ImportError:
except ImportError:
    pass
    pass



SCRIPT_FOLDER = os.path.dirname(os.path.realpath(__file__))
SCRIPT_FOLDER = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.abspath('pystencils'))
sys.path.insert(0, os.path.abspath("pystencils"))


# the Ubuntu pipeline uses an older version of pytest which uses deprecated functionality.
# the Ubuntu pipeline uses an older version of pytest which uses deprecated functionality.
# This leads to many warinings in the test and coverage pipeline.
# This leads to many warinings in the test and coverage pipeline.
pytest_numeric_version = [int(x, 10) for x in pytest.__version__.split('.')]
pytest_numeric_version = [int(x, 10) for x in pytest.__version__.split(".")]
pytest_numeric_version.reverse()
pytest_numeric_version.reverse()
pytest_version = sum(x * (100**i) for i, x in enumerate(pytest_numeric_version))
pytest_version = sum(x * (100**i) for i, x in enumerate(pytest_numeric_version))


@@ -36,58 +37,79 @@ def add_path_to_ignore(path):
    if not os.path.exists(path):
    if not os.path.exists(path):
        return
        return
    global collect_ignore
    global collect_ignore
    collect_ignore += [os.path.join(SCRIPT_FOLDER, path, f) for f in os.listdir(os.path.join(SCRIPT_FOLDER, path))]
    collect_ignore += [
        os.path.join(SCRIPT_FOLDER, path, f)
        for f in os.listdir(os.path.join(SCRIPT_FOLDER, path))
    ]




collect_ignore = [os.path.join(SCRIPT_FOLDER, "doc", "conf.py"),
collect_ignore = [
                  os.path.join(SCRIPT_FOLDER, "src", "pystencils", "opencl", "opencl.autoinit")]
    os.path.join(SCRIPT_FOLDER, "doc", "conf.py"),
add_path_to_ignore('tests/benchmark')
    os.path.join(SCRIPT_FOLDER, "src", "pystencils", "opencl", "opencl.autoinit"),
add_path_to_ignore('_local_tmp')
]
add_path_to_ignore("tests/benchmark")
add_path_to_ignore("_local_tmp")




try:
try:
    import cupy
    import cupy
except ImportError:
except ImportError:
    collect_ignore += [os.path.join(SCRIPT_FOLDER, "tests/test_gpu.py")]
    collect_ignore += [
    add_path_to_ignore('src/pystencils/gpu')
        os.path.join(SCRIPT_FOLDER, "tests/kernelcreation/test_gpu.py"),
        os.path.join(SCRIPT_FOLDER, "src/pystencils/backend/jit/gpu_cupy.py"),
    ]
    add_path_to_ignore("src/pystencils/gpu")


try:
try:
    import waLBerla
    import waLBerla
except ImportError:
except ImportError:
    collect_ignore += [os.path.join(SCRIPT_FOLDER, "tests/test_aligned_array.py"),
    collect_ignore += [
                       os.path.join(SCRIPT_FOLDER, "tests/test_datahandling_parallel.py"),
        os.path.join(
                       os.path.join(SCRIPT_FOLDER, "doc/notebooks/03_tutorial_datahandling.ipynb"),
            SCRIPT_FOLDER, "docs/source/tutorials/03_tutorial_datahandling.ipynb"
                       os.path.join(SCRIPT_FOLDER, "src/pystencils/datahandling/parallel_datahandling.py"),
        ),
                       os.path.join(SCRIPT_FOLDER, "tests/test_small_block_benchmark.ipynb")]
        os.path.join(
            SCRIPT_FOLDER, "src/pystencils/datahandling/parallel_datahandling.py"
        ),
        os.path.join(SCRIPT_FOLDER, "tests/runtime/test_datahandling_parallel.py"),
        os.path.join(SCRIPT_FOLDER, "tests/runtime/test_small_block_benchmark.ipynb"),
    ]


try:
try:
    import blitzdb
    import blitzdb
except ImportError:
except ImportError:
    add_path_to_ignore('src/pystencils/runhelper')
    add_path_to_ignore("src/pystencils/runhelper")
    collect_ignore += [os.path.join(SCRIPT_FOLDER, "tests/test_parameterstudy.py")]
    collect_ignore += [os.path.join(SCRIPT_FOLDER, "tests/test_parameterstudy.py")]
    collect_ignore += [os.path.join(SCRIPT_FOLDER, "tests/test_json_serializer.py")]
    collect_ignore += [os.path.join(SCRIPT_FOLDER, "tests/test_json_serializer.py")]


try:
try:
    import islpy
    import islpy
except ImportError:
except ImportError:
    collect_ignore += [os.path.join(SCRIPT_FOLDER, "src/pystencils/integer_set_analysis.py")]
    collect_ignore += [
        os.path.join(SCRIPT_FOLDER, "src/pystencils/integer_set_analysis.py")
    ]


try:
try:
    import graphviz
    import graphviz
except ImportError:
except ImportError:
    collect_ignore += [os.path.join(SCRIPT_FOLDER, "src/pystencils/backends/dot.py")]
    collect_ignore += [os.path.join(SCRIPT_FOLDER, "src/pystencils/backends/dot.py")]
    collect_ignore += [os.path.join(SCRIPT_FOLDER, "doc/notebooks/01_tutorial_getting_started.ipynb")]
    collect_ignore += [
        os.path.join(SCRIPT_FOLDER, "doc/notebooks/01_tutorial_getting_started.ipynb")
    ]


try:
try:
    import pyevtk
    import pyevtk
except ImportError:
except ImportError:
    collect_ignore += [os.path.join(SCRIPT_FOLDER, "src/pystencils/datahandling/vtk.py")]
    collect_ignore += [
        os.path.join(SCRIPT_FOLDER, "src/pystencils/datahandling/vtk.py")
    ]


collect_ignore += [os.path.join(SCRIPT_FOLDER, 'setup.py')]
collect_ignore += [os.path.join(SCRIPT_FOLDER, "setup.py")]


for root, sub_dirs, files in os.walk('.'):
for root, sub_dirs, files in os.walk("."):
    for f in files:
    for f in files:
        if f.endswith(".ipynb") and not any(f.startswith(k) for k in ['demo', 'tutorial', 'test', 'doc']):
        if f.endswith(".ipynb") and not any(
            f.startswith(k) for k in ["demo", "tutorial", "test", "doc"]
        ):
            collect_ignore.append(f)
            collect_ignore.append(f)




@@ -109,38 +131,50 @@ class IPyNbTest(pytest.Item):
    def __init__(self, name, parent, code):
    def __init__(self, name, parent, code):
        super(IPyNbTest, self).__init__(name, parent)
        super(IPyNbTest, self).__init__(name, parent)
        self.code = code
        self.code = code
        self.add_marker('notebook')
        self.add_marker("notebook")


    @pytest.mark.filterwarnings("ignore:IPython.core.inputsplitter is deprecated")
    def runtest(self):
    def runtest(self):
        global_dict = {'get_ipython': lambda: IPythonMockup(),
        global_dict = {"get_ipython": lambda: IPythonMockup(), "is_test_run": True}
                       'is_test_run': True}


        # disable matplotlib output
        # disable matplotlib output
        exec("import matplotlib.pyplot as p; "
        exec(
             "p.switch_backend('Template')", global_dict)
            "import matplotlib.pyplot as p; "
            "p.close('all'); "
            "p.switch_backend('Template')",
            global_dict,
        )


        # in notebooks there is an implicit plt.show() - if this is not called a warning is shown when the next
        # in notebooks there is an implicit plt.show() - if this is not called a warning is shown when the next
        # plot is created. This warning is suppressed here
        # plot is created. This warning is suppressed here
        exec("import warnings;"
        exec(
             "warnings.filterwarnings('ignore', 'Adding an axes using the same arguments as a previous.*')",
            "import warnings;"
             global_dict)
            "warnings.filterwarnings('ignore', 'Adding an axes using the same arguments as a previous.*');"
            "warnings.filterwarnings('ignore', 'Animation was deleted without rendering anything.*');",
            global_dict,
        )
        with tempfile.NamedTemporaryFile() as f:
        with tempfile.NamedTemporaryFile() as f:
            f.write(self.code.encode())
            f.write(self.code.encode())
            f.flush()
            f.flush()
            runpy.run_path(f.name, init_globals=global_dict, run_name=self.name)
            runpy.run_path(f.name, init_globals=global_dict, run_name=self.name)


        #   Close any open figures
        exec("import matplotlib.pyplot as p; p.close('all')", global_dict)



class IPyNbFile(pytest.File):
class IPyNbFile(pytest.File):
    def collect(self):
    def collect(self):
        from nbconvert import PythonExporter

        exporter = PythonExporter()
        exporter = PythonExporter()
        exporter.exclude_markdown = True
        exporter.exclude_markdown = True
        exporter.exclude_input_prompt = True
        exporter.exclude_input_prompt = True


        notebook_contents = self.fspath.open(encoding='utf-8')
        notebook_contents = self.path.open(encoding="utf-8")


        with warnings.catch_warnings():
        with warnings.catch_warnings():
            warnings.filterwarnings("ignore", "IPython.core.inputsplitter is deprecated")
            warnings.filterwarnings(
                "ignore", "IPython.core.inputsplitter is deprecated"
            )
            notebook = nbformat.read(notebook_contents, 4)
            notebook = nbformat.read(notebook_contents, 4)
            code, _ = exporter.from_notebook_node(notebook)
            code, _ = exporter.from_notebook_node(notebook)
        if pytest_version >= 50403:
        if pytest_version >= 50403:
@@ -152,10 +186,12 @@ class IPyNbFile(pytest.File):
        pass
        pass




def pytest_collect_file(path, parent):
def pytest_collect_file(file_path: pathlib.Path, parent):
    glob_exprs = ["*demo*.ipynb", "*tutorial*.ipynb", "test_*.ipynb"]
    glob_exprs = ["*demo*.ipynb", "*tutorial*.ipynb", "test_*.ipynb"]
    if any(path.fnmatch(g) for g in glob_exprs):
    if any(file_path.match(g) for g in glob_exprs):
        if pytest_version >= 50403:
        return IPyNbFile.from_parent(path=file_path, parent=parent)
            return IPyNbFile.from_parent(fspath=path, parent=parent)

        else:

            return IPyNbFile(path, parent)
#   Fixtures

from tests.fixtures import *

doc/conf.py

deleted100755 → 0
+0 −64
Original line number Original line Diff line number Diff line
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import datetime
import sphinx_rtd_theme
import os
import re
import sys

sys.path.insert(0, os.path.abspath('.'))
import pystencils

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.doctest',
    'sphinx.ext.intersphinx',
    'sphinx.ext.mathjax',
    'sphinx.ext.napoleon',
    'nbsphinx',
    'sphinxcontrib.bibtex',
    'sphinx_autodoc_typehints',
]

add_module_names = False
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'

copyright = f'{datetime.datetime.now().year}, Martin Bauer, Markus Holzer, Frederik Hennig'
author = 'Martin Bauer, Markus Holzer, Frederik Hennig'
# The short X.Y version (including .devXXXX, rcX, b1 suffixes if present)
version = re.sub(r'(\d+\.\d+)\.\d+(.*)', r'\1\2', pystencils.__version__)
version = re.sub(r'(\.dev\d+).*?$', r'\1', version)
# The full version, including alpha/beta/rc tags.
release = pystencils.__version__
language = 'en'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints']
default_role = 'any'
pygments_style = 'sphinx'
todo_include_todos = False

# Options for HTML output

html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = 'sphinx_rtd_theme'
htmlhelp_basename = 'pystencilsdoc'
html_sidebars = {'**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html']}

# NbSphinx configuration
nbsphinx_execute = 'never'
nbsphinx_codecell_lexer = 'python3'

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('https://docs.python.org/3.8', None),
                       'numpy': ('https://docs.scipy.org/doc/numpy/', None),
                       'matplotlib': ('https://matplotlib.org/', None),
                       'sympy': ('https://docs.sympy.org/latest/', None),
                       }

autodoc_member_order = 'bysource'
bibtex_bibfiles = ['sphinx/pystencils.bib']

project = 'pystencils'
html_logo = 'img/logo.png'

doc/index.rst

deleted100644 → 0
+0 −19
Original line number Original line Diff line number Diff line
pystencils
==========

Welcome to the documentation of the pystencils code generation tool for stencil codes.
pystencils can help you to generate blazingly fast code for image processing, numerical simulations or any other task involving numpy arrays.


.. toctree::
   :maxdepth: 2

   sphinx/tutorials.rst
   sphinx/api.rst


.. image:: /img/pystencils_arch_block_diagram.svg
    :height: 450px
    :align: center

doc/sphinx/api.rst

deleted100644 → 0
+0 −16
Original line number Original line Diff line number Diff line
API Reference
=============

.. toctree::
   :maxdepth: 3

   kernel_compile_and_call.rst
   enums.rst
   simplifications.rst
   datahandling.rst
   configuration.rst
   field.rst
   stencil.rst
   finite_differences.rst
   plot.rst
   ast.rst

doc/sphinx/ast.rst

deleted100644 → 0
+0 −19
Original line number Original line Diff line number Diff line
*********************************************
For developers: AST Nodes and Transformations
*********************************************


AST Nodes
=========

.. automodule:: pystencils.astnodes
   :members:



Transformations
===============


.. automodule:: pystencils.transformations
   :members:

doc/sphinx/configuration.rst

deleted100644 → 0
+0 −5
Original line number Original line Diff line number Diff line
*************
Configuration
*************

.. automodule:: pystencils.cpu.cpujit
 No newline at end of file

doc/sphinx/datahandling.rst

deleted100644 → 0
+0 −6
Original line number Original line Diff line number Diff line
************
DataHandling
************

.. autoclass:: pystencils.datahandling.DataHandling
   :members:
 No newline at end of file

doc/sphinx/enums.rst

deleted100644 → 0
+0 −6
Original line number Original line Diff line number Diff line
************
Enumerations
************

.. automodule:: pystencils.enums
   :members:

doc/sphinx/field.rst

deleted100644 → 0
+0 −6
Original line number Original line Diff line number Diff line
*****
Field
*****

.. automodule:: pystencils.field
   :members:
 No newline at end of file

doc/sphinx/finite_differences.rst

deleted100644 → 0
+0 −7
Original line number Original line Diff line number Diff line
******************
Finite Differences
******************

.. automodule:: pystencils.fd
   :members:
+0 −37
Original line number Original line Diff line number Diff line
*****************************************
Creating and calling kernels from Python
*****************************************


Creating kernels
----------------

.. autofunction:: pystencils.create_kernel

.. autoclass:: pystencils.CreateKernelConfig
    :members:

.. autofunction:: pystencils.kernelcreation.create_domain_kernel

.. autofunction:: pystencils.kernelcreation.create_indexed_kernel

.. autofunction:: pystencils.kernelcreation.create_staggered_kernel


Code printing
-------------

.. autofunction:: pystencils.show_code


GPU Indexing
-------------

.. autoclass:: pystencils.gpu.AbstractIndexing
   :members:

.. autoclass:: pystencils.gpu.BlockIndexing
   :members:

.. autoclass:: pystencils.gpu.LineIndexing
   :members:

doc/sphinx/plot.rst

deleted100644 → 0
+0 −8
Original line number Original line Diff line number Diff line
**********************
Plotting and Animation
**********************

.. automodule:: pystencils.plot
   :members:

doc/sphinx/simplifications.rst

deleted100644 → 0
+0 −38
Original line number Original line Diff line number Diff line
***************************************
Assignment Collection & Simplifications
***************************************


AssignmentCollection
====================

.. autoclass:: pystencils.AssignmentCollection
   :members:


SimplificationStrategy
======================

.. autoclass:: pystencils.simp.SimplificationStrategy
    :members:

Simplifications
===============

.. automodule:: pystencils.simp.simplifications
    :members:

Subexpression insertion
=======================

The subexpression insertions have the goal to insert subexpressions which will not reduce the number of FLOPs.
For example a constant value kept as subexpression will lead to a new variable in the code which will occupy
a register slot. On the other side a single variable could just be inserted in all assignments.

.. automodule:: pystencils.simp.subexpression_insertion
    :members:




doc/sphinx/stencil.rst

deleted100644 → 0
+0 −6
Original line number Original line Diff line number Diff line
*******
Stencil
*******

.. automodule:: pystencils.stencil
   :members:

docs/.gitignore

0 → 100644
+4 −0
Original line number Original line Diff line number Diff line
build

#   sphinx.ext.autosummary generated files
**/generated

docs/Makefile

0 → 100644
+28 −0
Original line number Original line Diff line number Diff line
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS    ?=
SPHINXBUILD   ?= sphinx-build
SOURCEDIR     = source
BUILDDIR      = build

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help html clean

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
# %: Makefile

html:
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
	rm -rf source/api/generated
	rm -rf source/api/symbolic/generated
	rm -rf source/backend/generated
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
 No newline at end of file

docs/make.bat

0 → 100644
+35 −0
Original line number Original line Diff line number Diff line
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.https://www.sphinx-doc.org/
	exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Original line number Original line Diff line number Diff line
{% extends "!autosummary/class.rst" %}

   {% block methods %}

   {% if methods %}
   .. rubric:: {{ _('Methods') }}

   .. autosummary::
      :toctree:
   {% for item in methods %}
      ~{{ name }}.{{ item }}
   {%- endfor %}
   {% endif %}
   {% endblock %}

   {% block attributes %}
   {% if attributes %}
   .. rubric:: {{ _('Attributes') }}

   .. autosummary::
      :toctree:
   {% for item in attributes %}
      ~{{ name }}.{{ item }}
   {%- endfor %}
   {% endif %}
   {% endblock %}

docs/source/api/jit.md

0 → 100644
+102 −0

File added.

Preview size limit exceeded, changes collapsed.

+16 −0
Original line number Original line Diff line number Diff line
# Assignments and AssignmentCollection

```{eval-rst}

.. py:class:: pystencils.Assignment

    Monkeypatched variant of `sympy.codegen.ast.Assignment`.
    Represents an assignment of an expression to a symbol.

.. autosummary::
    :toctree: generated
    :nosignatures:
    :template: autosummary/recursive_class.rst

    pystencils.AssignmentCollection
```
+9 −0
Original line number Original line Diff line number Diff line
# Symbolic Toolbox

:::{toctree}
:maxdepth: 1

field
assignments
sympyextensions
:::
+6 −0
Original line number Original line Diff line number Diff line
*********************
Errors and Exceptions
*********************

.. automodule:: pystencils.backend.exceptions
    :members:
+5 −0
Original line number Original line Diff line number Diff line
************************************
Extensions and Experimental Features
************************************

.. automodule:: pystencils.backend.extensions
Original line number Original line Diff line number Diff line
****************
Iteration Spaces
****************

.. automodule:: pystencils.backend.kernelcreation.iteration_space
    :members:
 No newline at end of file

docs/source/conf.py

0 → 100644
+89 −0

File added.

Preview size limit exceeded, changes collapsed.

docs/source/index.rst

0 → 100644
+112 −0

File added.

Preview size limit exceeded, changes collapsed.

+88 −0

File added.

Preview size limit exceeded, changes collapsed.

mypy.ini

0 → 100644
+42 −0

File added.

Preview size limit exceeded, changes collapsed.

noxfile.py

0 → 100644
+141 −0

File added.

Preview size limit exceeded, changes collapsed.

+18 −6

File changed.

Preview size limit exceeded, changes collapsed.

+16 −3

File changed.

Preview size limit exceeded, changes collapsed.

src/pystencils/astnodes.py

deleted100644 → 0
+0 −867

File deleted.

Preview size limit exceeded, changes collapsed.

File changed.

Preview size limit exceeded, changes collapsed.

src/pystencils/symb.py

0 → 100644
+29 −0

File added.

Preview size limit exceeded, changes collapsed.

+11 −0

File added.

Preview size limit exceeded, changes collapsed.

tests/fixtures.py

0 → 100644
+84 −0

File added.

Preview size limit exceeded, changes collapsed.

+97 −0

File added.

Preview size limit exceeded, changes collapsed.

tests/test_astnodes.py

deleted100644 → 0
+0 −88

File deleted.

Preview size limit exceeded, changes collapsed.

tests/test_field.py

deleted100644 → 0
+0 −203

File deleted.

Preview size limit exceeded, changes collapsed.

tests/test_struct_types.py

deleted100644 → 0
+0 −44

File deleted.

Preview size limit exceeded, changes collapsed.

versioneer.py

deleted100644 → 0
+0 −1855

File deleted.

Preview size limit exceeded, changes collapsed.