Closed vaaaaanquish closed 3 years ago
@Hi-king @hirosassa Please review
@vaaaaanquish
[IMO] I believe this PR allows self.load()
without setting any parameter.
However, I thought we should select target name explicitly as in the following example. (I think this is possible in the current code)
If not, we have to add parameter to self.load()
as self.load('task1')
when we decided to add another gokart.TaskInstanceParameter()
afterward, which may be difficult to notice.
class A(gokart.TaskOnKart):
task = gokart.TaskInstanceParameter()
def run(self):
a = self.load('target')
@mski-iksm Thanks for the good point.
It would be good to add a condition to check if target is in data.
if isinstance(data, dict) and len(data) == 1 and target in data:
return list(data.values())[0]
or
check target.
if isinstance(data, dict) and len(data) == 1 and target is None:
return list(data.values())[0]
@vaaaaanquish LGTM
fix #189