Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils-sfg
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
pycodegen
pystencils-sfg
Commits
6e26dbee
Commit
6e26dbee
authored
1 year ago
by
Frederik Hennig
Browse files
Options
Downloads
Patches
Plain Diff
minor bugfix in composer
parent
309c0a34
No related branches found
No related tags found
No related merge requests found
Pipeline
#58821
passed
1 year ago
Stage: pretest
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pystencilssfg/composer/basic_composer.py
+5
-5
5 additions, 5 deletions
src/pystencilssfg/composer/basic_composer.py
with
5 additions
and
5 deletions
src/pystencilssfg/composer/basic_composer.py
+
5
−
5
View file @
6e26dbee
...
...
@@ -70,7 +70,7 @@ class SfgBasicComposer:
self
.
_ctx
.
set_namespace
(
namespace
)
def
generate
(
self
,
generator
:
CustomGenerator
):
"""
Invoke
s
a custom code generator with the underlying context.
"""
"""
Invoke a custom code generator with the underlying context.
"""
generator
.
generate
(
self
.
_ctx
)
@property
...
...
@@ -83,7 +83,7 @@ class SfgBasicComposer:
return
self
.
_ctx
.
_default_kernel_namespace
def
kernel_namespace
(
self
,
name
:
str
)
->
SfgKernelNamespace
:
"""
Return
s
the kernel namespace of the given name, creating it if it does not exist yet.
"""
"""
Return the kernel namespace of the given name, creating it if it does not exist yet.
"""
kns
=
self
.
_ctx
.
get_kernel_namespace
(
name
)
if
kns
is
None
:
kns
=
SfgKernelNamespace
(
self
.
_ctx
,
name
)
...
...
@@ -119,7 +119,7 @@ class SfgBasicComposer:
def
kernel_function
(
self
,
name
:
str
,
ast_or_kernel_handle
:
KernelFunction
|
SfgKernelHandle
):
"""
Create
s
a function comprising just a single kernel call.
"""
Create a function comprising just a single kernel call.
Args:
ast_or_kernel_handle: Either a pystencils AST, or a kernel handle for an already registered AST.
...
...
@@ -130,8 +130,8 @@ class SfgBasicComposer:
if
isinstance
(
ast_or_kernel_handle
,
KernelFunction
):
khandle
=
self
.
_ctx
.
default_kernel_namespace
.
add
(
ast_or_kernel_handle
)
tree
=
SfgKernelCallNode
(
khandle
)
elif
isinstance
(
ast_or_kernel_handle
,
SfgKernel
CallNod
e
):
tree
=
ast_or_kernel_handle
elif
isinstance
(
ast_or_kernel_handle
,
SfgKernel
Handl
e
):
tree
=
SfgKernelCallNode
(
ast_or_kernel_handle
)
else
:
raise
TypeError
(
"
Invalid type of argument `ast_or_kernel_handle`!
"
)
...
...
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