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
Jonas Plewinski
pystencils
Commits
18ab6246
Commit
18ab6246
authored
Aug 02, 2019
by
Stephan Seitz
Browse files
Implement TypedSymbol.is_integer
parent
b68e174e
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/data_types.py
View file @
18ab6246
...
...
@@ -127,6 +127,13 @@ class TypedSymbol(sp.Symbol):
def
__getnewargs__
(
self
):
return
self
.
name
,
self
.
dtype
@
property
def
is_integer
(
self
):
if
hasattr
(
self
.
dtype
,
'numpy_dtype'
):
return
np
.
issubdtype
(
self
.
dtype
.
numpy_dtype
,
np
.
integer
)
else
:
return
False
def
create_type
(
specification
):
"""Creates a subclass of Type according to a string or an object of subclass Type.
...
...
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