Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sumpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
sumpy
Commits
9ec3aabc
Commit
9ec3aabc
authored
5 years ago
by
Isuru Fernando
Browse files
Options
Downloads
Patches
Plain Diff
Check for same argument name when getting kernel arguments
parent
214fc5db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!119
Fix get_source_args for DirectionalTargetDerivative
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sumpy/tools.py
+8
-5
8 additions, 5 deletions
sumpy/tools.py
with
8 additions
and
5 deletions
sumpy/tools.py
+
8
−
5
View file @
9ec3aabc
...
...
@@ -209,9 +209,10 @@ def gather_arguments(kernel_likes):
result
=
{}
for
knl
in
kernel_likes
:
for
arg
in
knl
.
get_args
():
result
[
arg
.
name
]
=
arg
# FIXME: possibly check that arguments match before overwriting
# Check for strict equality until there's a usecase
if
result
.
setdefault
(
arg
.
name
,
arg
)
!=
arg
:
raise
ValueError
(
"
Merging two different kernel arguments with
"
"
the same name {}
"
.
format
(
arg
.
name
))
return
sorted
(
six
.
itervalues
(
result
),
key
=
lambda
arg
:
arg
.
name
)
...
...
@@ -219,8 +220,10 @@ def gather_source_arguments(kernel_likes):
result
=
{}
for
knl
in
kernel_likes
:
for
arg
in
knl
.
get_args
()
+
knl
.
get_source_args
():
result
[
arg
.
name
]
=
arg
# FIXME: possibly check that arguments match before overwriting
# Check for strict equality until there's a usecase
if
result
.
setdefault
(
arg
.
name
,
arg
)
!=
arg
:
raise
ValueError
(
"
Merging two different kernel arguments with
"
"
the same name {}
"
.
format
(
arg
.
name
))
return
sorted
(
six
.
itervalues
(
result
),
key
=
lambda
arg
:
arg
.
name
)
...
...
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