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
Model registry
Operate
Environments
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
pycodegen
pystencils
Merge requests
!406
Fix typing of floor/ceil
代码
评审变更
检出分支
下载
补丁
文本差异
Merged
Fix typing of floor/ceil
da15siwa/pystencils:fix-rounding
into
master
Overview
0
Commits
1
Pipelines
2
Changes
2
Merged
Frederik Hennig
requested to merge
da15siwa/pystencils:fix-rounding
into
master
1 year ago
Overview
0
Commits
1
Pipelines
2
Changes
2
Expand
sp.floor
/
sp.ceil
were not recognized by the
TypeAdder
.
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
d93c549c
1 commit,
1 year ago
2 files
+
5
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/pystencils/typing/leaf_typing.py
+
2
−
1
Options
@@ -11,6 +11,7 @@ from sympy.core.relational import Relational
from
sympy.functions.elementary.piecewise
import
ExprCondPair
from
sympy.functions.elementary.trigonometric
import
TrigonometricFunction
,
InverseTrigonometricFunction
from
sympy.functions.elementary.hyperbolic
import
HyperbolicFunction
from
sympy.functions.elementary.integers
import
RoundFunction
from
sympy.logic.boolalg
import
BooleanFunction
from
sympy.logic.boolalg
import
BooleanAtom
@@ -213,7 +214,7 @@ class TypeAdder:
new_args
.
append
(
a
)
return
expr
.
func
(
*
new_args
)
if
new_args
else
expr
,
collated_type
elif
isinstance
(
expr
,
(
sp
.
Pow
,
sp
.
exp
,
InverseTrigonometricFunction
,
TrigonometricFunction
,
HyperbolicFunction
,
sp
.
log
)):
HyperbolicFunction
,
sp
.
log
,
RoundFunction
)):
args_types
=
[
self
.
figure_out_type
(
arg
)
for
arg
in
expr
.
args
]
collated_type
=
collate_types
([
t
for
_
,
t
in
args_types
])
new_args
=
[
a
if
t
.
dtype_eq
(
collated_type
)
else
CastFunc
(
a
,
collated_type
)
for
a
,
t
in
args_types
]
Loading