Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pycodegen
pystencils_autodiff
Commits
552ece73
Commit
552ece73
authored
Sep 15, 2020
by
Stephan Seitz
Browse files
Support dicts in ast_dict
parent
5d6b186c
Pipeline
#26657
failed with stage
in 6 minutes and 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/pystencils_autodiff/framework_integration/astnodes.py
View file @
552ece73
...
...
@@ -27,7 +27,7 @@ from pystencils_autodiff.framework_integration.texture_astnodes import NativeTex
class
JinjaCppFile
(
Node
):
TEMPLATE
:
jinja2
.
Template
=
None
NOT_PRINT_TYPES
=
(
pystencils
.
Field
,
pystencils
.
TypedSymbol
,
bool
)
NOT_PRINT_TYPES
=
(
pystencils
.
Field
,
pystencils
.
TypedSymbol
,
bool
,
dict
)
def
__init__
(
self
,
ast_dict
=
{}):
self
.
ast_dict
=
pystencils
.
utils
.
DotDict
(
ast_dict
)
...
...
@@ -85,7 +85,7 @@ class JinjaCppFile(Node):
render_dict
=
{
k
:
(
self
.
_print
(
v
)
if
not
isinstance
(
v
,
self
.
NOT_PRINT_TYPES
)
and
v
is
not
None
else
v
)
if
not
isinstance
(
v
,
Iterable
)
or
isinstance
(
v
,
str
)
if
not
isinstance
(
v
,
Iterable
)
or
isinstance
(
v
,
str
)
or
isinstance
(
v
,
dict
)
else
[(
self
.
_print
(
a
)
if
not
isinstance
(
a
,
self
.
NOT_PRINT_TYPES
)
and
a
is
not
None
else
a
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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