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
hyteg
pystencils
Commits
4a4ea6c2
Commit
4a4ea6c2
authored
1 year ago
by
Michael Kuron
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/master' into arm64-win
parents
a052d129
fd1c1259
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
doc/conf.py
+1
-1
1 addition, 1 deletion
doc/conf.py
pystencils/stencil.py
+1
-1
1 addition, 1 deletion
pystencils/stencil.py
pystencils/typing/utilities.py
+9
-14
9 additions, 14 deletions
pystencils/typing/utilities.py
with
12 additions
and
17 deletions
.gitlab-ci.yml
+
1
−
1
View file @
4a4ea6c2
...
...
@@ -21,7 +21,7 @@ tests-and-coverage:
-
mkdir -p ~/.config/matplotlib
-
echo "backend:template" > ~/.config/matplotlib/matplotlibrc
-
mkdir public
-
py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun" --html test-report/index.html --junitxml=report.xml
-
py.test -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
-
python3 -m coverage xml
tags
:
-
docker
...
...
This diff is collapsed.
Click to expand it.
doc/conf.py
100644 → 100755
+
1
−
1
View file @
4a4ea6c2
...
...
@@ -33,7 +33,7 @@ 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
=
None
language
=
'
en
'
exclude_patterns
=
[
'
_build
'
,
'
Thumbs.db
'
,
'
.DS_Store
'
,
'
**.ipynb_checkpoints
'
]
default_role
=
'
any
'
pygments_style
=
'
sphinx
'
...
...
This diff is collapsed.
Click to expand it.
pystencils/stencil.py
+
1
−
1
View file @
4a4ea6c2
...
...
@@ -341,7 +341,7 @@ def plot_2d(stencil, axes=None, figure=None, data=None, textsize='12', **kwargs)
for
direction
,
annotation
in
zip
(
stencil
,
data
):
assert
len
(
direction
)
==
2
,
"
Works only for 2D stencils
"
direction
=
tuple
(
int
(
i
)
for
i
in
direction
)
if
not
(
direction
[
0
]
==
0
and
direction
[
1
]
==
0
):
if
not
(
direction
[
0
]
==
0
and
direction
[
1
]
==
0
):
axes
.
arrow
(
0
,
0
,
direction
[
0
],
direction
[
1
],
head_width
=
0.08
,
head_length
=
head_length
,
color
=
'
k
'
)
if
isinstance
(
annotation
,
sp
.
Basic
):
...
...
This diff is collapsed.
Click to expand it.
pystencils/typing/utilities.py
+
9
−
14
View file @
4a4ea6c2
...
...
@@ -187,18 +187,15 @@ def get_type_of_expression(expr,
# Fix for sympy versions from 1.9
sympy_version
=
sp
.
__version__
.
split
(
'
.
'
)
if
int
(
sympy_version
[
0
])
*
100
+
int
(
sympy_version
[
1
])
>=
109
:
sympy_version_int
=
int
(
sympy_version
[
0
])
*
100
+
int
(
sympy_version
[
1
])
if
sympy_version_int
>=
109
:
# __setstate__ would bypass the contructor, so we remove it
sp
.
Number
.
__getstate__
=
sp
.
Basic
.
__getstate__
del
sp
.
Basic
.
__getstate__
class
FunctorWithStoredKwargs
:
def
__init__
(
self
,
func
,
**
kwargs
):
self
.
func
=
func
self
.
kwargs
=
kwargs
def
__call__
(
self
,
*
args
):
return
self
.
func
(
*
args
,
**
self
.
kwargs
)
if
sympy_version_int
>=
111
:
del
sp
.
Basic
.
__setstate__
del
sp
.
Symbol
.
__setstate__
else
:
sp
.
Number
.
__getstate__
=
sp
.
Basic
.
__getstate__
del
sp
.
Basic
.
__getstate__
# __reduce_ex__ would strip kwargs, so we override it
def
basic_reduce_ex
(
self
,
protocol
):
...
...
@@ -210,9 +207,7 @@ if int(sympy_version[0]) * 100 + int(sympy_version[1]) >= 109:
state
=
self
.
__getstate__
()
else
:
state
=
None
return
FunctorWithStoredKwargs
(
type
(
self
),
**
kwargs
),
args
,
state
sp
.
Number
.
__reduce_ex__
=
sp
.
Basic
.
__reduce_ex__
return
partial
(
type
(
self
),
**
kwargs
),
args
,
state
sp
.
Basic
.
__reduce_ex__
=
basic_reduce_ex
...
...
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