Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
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
ift
NIFTy
Commits
12853ffe
Commit
12853ffe
authored
3 years ago
by
Philipp Arras
Browse files
Options
Downloads
Patches
Plain Diff
MultiField: Simplify
parent
61b24b7d
No related branches found
No related tags found
1 merge request
!695
MultiField: Simplify
Pipeline
#111945
passed
3 years ago
Stage: static_checks
Stage: build_docker
Stage: test
Stage: demo_runs
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/multi_field.py
+1
-6
1 addition, 6 deletions
src/multi_field.py
with
1 addition
and
6 deletions
src/multi_field.py
+
1
−
6
View file @
12853ffe
...
@@ -273,12 +273,7 @@ class MultiField(Operator):
...
@@ -273,12 +273,7 @@ class MultiField(Operator):
If a field is not present, it is assumed to have an uniform value
If a field is not present, it is assumed to have an uniform value
of zero.
of zero.
"""
"""
if
self
.
_domain
is
other
.
_domain
:
return
self
.
flexible_addsub
(
other
,
False
)
return
self
+
other
res
=
self
.
to_dict
()
for
key
,
val
in
other
.
items
():
res
[
key
]
=
res
[
key
]
+
val
if
key
in
res
else
val
return
MultiField
.
from_dict
(
res
)
@staticmethod
@staticmethod
def
union
(
fields
,
domain
=
None
):
def
union
(
fields
,
domain
=
None
):
...
...
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