Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
payno
workflow_concepts
Commits
a1fc1524
Commit
a1fc1524
authored
Jun 09, 2021
by
Wout De Nolf
Browse files
Refactor ppf tasks
parent
3e2eb975
Changes
1
Hide whitespace changes
Inline
Side-by-side
esrftaskgraph/esrftaskgraph/ppftasks.py
View file @
a1fc1524
...
...
@@ -12,31 +12,30 @@ class PpfMethodExecutorTask(
gets updates by each task.
"""
@
property
def
method
(
self
):
fullname
=
self
.
inputs
.
method
return
import_method
(
fullname
)
def
process
(
self
):
method_kwargs
=
self
.
input_values
method_kwargs
.
pop
(
"method"
)
ppfdict
=
method_kwargs
.
pop
(
"ppfdict"
,
None
)
if
ppfdict
:
method_kwargs
.
update
(
ppfdict
)
ppfdict
=
self
.
input_values
fullname
=
ppfdict
.
pop
(
"method"
)
method
=
import_method
(
fullname
)
ppfdict_unpack
=
ppfdict
.
pop
(
"ppfdict"
,
None
)
if
ppfdict_unpack
:
ppfdict
.
update
(
ppfdict_unpack
)
result
=
self
.
method
(
**
method_kwargs
)
result
=
method
(
**
ppfdict
)
ppfdict
=
dict
(
method_kwargs
)
ppfdict
.
update
(
result
)
self
.
outputs
.
ppfdict
=
ppfdict
class
PpfPortTask
(
Task
,
optional_input_names
=
[
"ppfdict"
],
output_names
=
[
"ppfdict"
]):
class
PpfPortTask
(
Task
,
optional_input_names
=
[
"ppfdict"
,
"ppfport"
],
output_names
=
[
"ppfdict"
]
):
"""A ppfmethod which represents the identity mapping"""
def
process
(
self
):
passthroughdata
=
self
.
inputs
.
ppfdict
if
passthroughdata
:
self
.
outputs
.
ppfdict
=
dict
(
passthroughdata
)
else
:
self
.
outputs
.
ppfdict
=
dict
()
ppfdict
=
self
.
input_values
ppfdict
.
pop
(
"ppfport"
)
# not used
ppfdict_unpack
=
ppfdict
.
pop
(
"ppfdict"
,
None
)
if
ppfdict_unpack
:
ppfdict
.
update
(
ppfdict_unpack
)
self
.
outputs
.
ppfdict
=
ppfdict
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