Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Hammer
pystencils
Commits
4f41d979
Commit
4f41d979
authored
4 years ago
by
Jan Hönig
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into 'master'
Update conftest and readme See merge request
pycodegen/pystencils!167
parents
2d758462
458bff59
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+4
-4
4 additions, 4 deletions
.gitlab-ci.yml
README.md
+5
-8
5 additions, 8 deletions
README.md
conftest.py
+14
-4
14 additions, 4 deletions
conftest.py
with
23 additions
and
16 deletions
.gitlab-ci.yml
+
4
−
4
View file @
4f41d979
...
...
@@ -22,7 +22,7 @@ tests-and-coverage:
-
py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun" --html test-report/index.html
tags
:
-
docker
-
cuda
-
cuda
11
-
AVX
artifacts
:
when
:
always
...
...
@@ -44,7 +44,7 @@ test-longrun:
-
py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. --html test-report/index.html
tags
:
-
docker
-
cuda
-
cuda
11
-
AVX
artifacts
:
paths
:
...
...
@@ -80,7 +80,7 @@ ubuntu:
-
pytest-3 -v -m "not longrun"
tags
:
-
docker
-
cuda
-
cuda
11
-
AVX
minimal-conda
:
...
...
@@ -146,7 +146,7 @@ pycodegen-integration:
-
make -j $NUM_CORES
tags
:
-
docker
-
cuda
-
cuda
11
-
AVX
# -------------------- Linter & Documentation --------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
README.md
+
5
−
8
View file @
4f41d979
...
...
@@ -2,16 +2,16 @@ pystencils
==========
[

](https://mybinder.org/v2/gh/mabau/pystencils/master?filepath=doc%2Fnotebooks)
[

](http://pycodegen.pages.
walberla.net
/pystencils)
[

](http
s
://pycodegen.pages.
i10git.cs.fau.de
/pystencils)
[

](https://badge.fury.io/py/pystencils)
[

](https://i10git.cs.fau.de/pycodegen/pystencils/commits/master)
[

](http://pycodegen.pages.
walberla.net
/pystencils/coverage_report)
[

](http://pycodegen.pages.
i10git.cs.fau.de
/pystencils/coverage_report)
Run blazingly fast stencil codes on numpy arrays.
*pystencils*
uses sympy to define stencil operations, that can be executed on numpy arrays.
Exploiting the stencil structure makes
*pystencils*
run faster than normal numpy code and even as Cython and numba,
[
as demonstrated in this notebook
](
http://pycodegen.pages.
walberla.net
/pystencils/notebooks/demo_benchmark.html
)
.
[
as demonstrated in this notebook
](
http
s
://pycodegen.pages.
i10git.cs.fau.de
/pystencils/notebooks/demo_benchmark.html
)
.
Here is a code snippet that computes the average of neighboring cells:
...
...
@@ -21,7 +21,7 @@ import numpy as np
f
,
g
=
ps
.
fields
(
"
f, g : [2D]
"
)
stencil
=
ps
.
Assignment
(
g
[
0
,
0
],
(
f
[
1
,
0
]
+
f
[
-
1
,
0
]
+
f
[
0
,
1
]
+
f
[
0
,
-
1
])
/
4
)
(
f
[
1
,
0
]
+
f
[
-
1
,
0
]
+
f
[
0
,
1
]
+
f
[
0
,
-
1
])
/
4
)
kernel
=
ps
.
create_kernel
(
stencil
).
compile
()
f_arr
=
np
.
random
.
rand
(
1000
,
1000
)
...
...
@@ -39,9 +39,6 @@ discretize = ps.fd.Discretization2ndOrder(dx=1, dt=0.01)
discretization
=
discretize
(
adv_diff_pde
)
```
Look at the
[
documentation
](
http://pycodegen.pages.walberla.net/pystencils
)
to learn more.
Installation
------------
...
...
@@ -69,5 +66,5 @@ pip install pystencils[interactive,gpu,doc]
Documentation
-------------
Read the docs
[
here
](
http://pycodegen.pages.
walberla.net
/pystencils
)
and
Read the docs
[
here
](
http
s
://pycodegen.pages.
i10git.cs.fau.de
/pystencils
)
and
check out the Jupyter notebooks in
`doc/notebooks`
.
This diff is collapsed.
Click to expand it.
conftest.py
+
14
−
4
View file @
4f41d979
...
...
@@ -25,6 +25,12 @@ except ImportError:
SCRIPT_FOLDER
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
'
pystencils
'
))
# the Ubuntu pipeline uses an older version of pytest which uses deprecated functionality.
# 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
.
reverse
()
pytest_version
=
sum
(
x
*
(
100
**
i
)
for
i
,
x
in
enumerate
(
pytest_numeric_version
))
def
add_path_to_ignore
(
path
):
if
not
os
.
path
.
exists
(
path
):
...
...
@@ -152,8 +158,10 @@ class IPyNbFile(pytest.File):
warnings
.
filterwarnings
(
"
ignore
"
,
"
IPython.core.inputsplitter is deprecated
"
)
notebook
=
nbformat
.
read
(
notebook_contents
,
4
)
code
,
_
=
exporter
.
from_notebook_node
(
notebook
)
yield
IPyNbTest
(
self
.
name
,
self
,
code
)
# pytest v 2.4>: yield IPyNbTest.from_parent(name=self.name, parent=self, code=code)
if
pytest_version
>=
50403
:
yield
IPyNbTest
.
from_parent
(
name
=
self
.
name
,
parent
=
self
,
code
=
code
)
else
:
yield
IPyNbTest
(
self
.
name
,
self
,
code
)
def
teardown
(
self
):
pass
...
...
@@ -162,5 +170,7 @@ class IPyNbFile(pytest.File):
def
pytest_collect_file
(
path
,
parent
):
glob_exprs
=
[
"
*demo*.ipynb
"
,
"
*tutorial*.ipynb
"
,
"
test_*.ipynb
"
]
if
any
(
path
.
fnmatch
(
g
)
for
g
in
glob_exprs
):
return
IPyNbFile
(
path
,
parent
)
# pytest v 2.4 >: return IPyNbFile.from_parent(fspath=path, parent=parent)
if
pytest_version
>=
50403
:
return
IPyNbFile
.
from_parent
(
fspath
=
path
,
parent
=
parent
)
else
:
return
IPyNbFile
(
path
,
parent
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment