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
7a4ff746
Commit
7a4ff746
authored
7 months ago
by
Frederik Hennig
Browse files
Options
Downloads
Patches
Plain Diff
Add CustomGenerator to docs. Fix bug in postprocessing.
parent
2edd363e
No related branches found
No related tags found
No related merge requests found
Pipeline
#69654
failed
7 months ago
Stage: Code Quality
Stage: Tests
Stage: Documentation
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/source/api/composer.rst
+9
-0
9 additions, 0 deletions
docs/source/api/composer.rst
src/pystencilssfg/composer/custom.py
+1
-1
1 addition, 1 deletion
src/pystencilssfg/composer/custom.py
src/pystencilssfg/ir/postprocessing.py
+18
-17
18 additions, 17 deletions
src/pystencilssfg/ir/postprocessing.py
with
28 additions
and
18 deletions
docs/source/api/composer.rst
+
9
−
0
View file @
7a4ff746
...
...
@@ -14,4 +14,13 @@ Composer API (`pystencilssfg.composer`)
.. autoclass:: pystencilssfg.composer.SfgClassComposer
:members:
Helper Methods
==============
.. autofunction:: pystencilssfg.composer.make_sequence
Custom Generators
=================
.. autoclass:: pystencilssfg.composer.custom.CustomGenerator
:members:
This diff is collapsed.
Click to expand it.
src/pystencilssfg/composer/custom.py
+
1
−
1
View file @
7a4ff746
...
...
@@ -4,7 +4,7 @@ from ..context import SfgContext
class
CustomGenerator
(
ABC
):
"""
Abstract base class for custom code generators that may be passed to
[SfgComposer.generate][pystencilssfg.
SfgComposer.generate
]
.
"""
`
SfgComposer.generate
`
.
"""
@abstractmethod
def
generate
(
self
,
ctx
:
SfgContext
)
->
None
:
...
This diff is collapsed.
Click to expand it.
src/pystencilssfg/ir/postprocessing.py
+
18
−
17
View file @
7a4ff746
...
...
@@ -106,23 +106,24 @@ class PostProcessingContext:
if
var
.
name
in
self
.
_live_variables
:
live_var
=
self
.
_live_variables
[
var
.
name
]
if
var
.
dtype
==
live_var
.
dtype
:
# This can only happen if the variables are SymbolLike,
# i.e. wrap a field-associated kernel parameter
# TODO: Once symbol properties are a thing, check and combine them here
warnings
.
warn
(
"
Encountered two non-identical variables with same name and data type:
\n
"
f
"
{
var
.
name_and_type
()
}
\n
"
"
and
\n
"
f
"
{
live_var
.
name_and_type
()
}
\n
"
)
else
:
raise
SfgException
(
"
Encountered two variables with same name but different data types:
\n
"
f
"
{
var
.
name_and_type
()
}
\n
"
"
and
\n
"
f
"
{
live_var
.
name_and_type
()
}
"
)
if
var
!=
live_var
:
if
var
.
dtype
==
live_var
.
dtype
:
# This can only happen if the variables are SymbolLike,
# i.e. wrap a field-associated kernel parameter
# TODO: Once symbol properties are a thing, check and combine them here
warnings
.
warn
(
"
Encountered two non-identical variables with same name and data type:
\n
"
f
"
{
var
.
name_and_type
()
}
\n
"
"
and
\n
"
f
"
{
live_var
.
name_and_type
()
}
\n
"
)
else
:
raise
SfgException
(
"
Encountered two variables with same name but different data types:
\n
"
f
"
{
var
.
name_and_type
()
}
\n
"
"
and
\n
"
f
"
{
live_var
.
name_and_type
()
}
"
)
else
:
self
.
_live_variables
[
var
.
name
]
=
var
...
...
This diff is collapsed.
Click to expand it.
Frederik Hennig
@da15siwa
mentioned in commit
cf2d5d53
·
7 months ago
mentioned in commit
cf2d5d53
mentioned in commit cf2d5d53451b87f6f049417877440fa61bafa0aa
Toggle commit list
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