Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sebastian Bindgen
pystencils
Commits
0238f763
Commit
0238f763
authored
Jun 14, 2020
by
Markus Holzer
Browse files
fixed sympy import numbers warning
parent
e685321c
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
0238f763
...
...
@@ -13,6 +13,7 @@ tests-and-coverage:
-
$ENABLE_NIGHTLY_BUILDS
image
:
i10git.cs.fau.de:5005/pycodegen/pycodegen/full
script
:
-
pip list
-
export NUM_CORES=$(nproc --all)
-
mkdir -p ~/.config/matplotlib
-
echo "backend:template" > ~/.config/matplotlib/matplotlibrc
...
...
pystencils/sympyextensions.py
View file @
0238f763
...
...
@@ -7,6 +7,7 @@ from typing import Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Ty
import
sympy
as
sp
from
sympy.functions
import
Abs
from
sympy.core.numbers
import
Zero
from
pystencils.assignment
import
Assignment
from
pystencils.data_types
import
cast_func
,
get_base_type
,
get_type_of_expression
...
...
@@ -260,8 +261,8 @@ def subs_additive(expr: sp.Expr, replacement: sp.Expr, subexpression: sp.Expr,
if
not
param_list
:
return
current_expr
else
:
if
current_expr
.
func
==
sp
.
Mul
and
sp
.
numbers
.
Zero
()
in
param_list
:
return
sp
.
numbers
.
Zero
()
if
current_expr
.
func
==
sp
.
Mul
and
Zero
()
in
param_list
:
return
Zero
()
else
:
return
current_expr
.
func
(
*
param_list
,
evaluate
=
False
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment