Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gokart build method #183

Merged
merged 16 commits into from
Apr 13, 2021
Merged

Add gokart build method #183

merged 16 commits into from
Apr 13, 2021

Conversation

vaaaaanquish
Copy link
Contributor

@vaaaaanquish vaaaaanquish commented Apr 2, 2021

example

import luigi
import gokart

gokart.add_config('./conf.ini')


class TaskA(gokart.TaskOnKart):
    x = luigi.Parameter()
    
    def run(self):
        self.dump(self.x)


class TaskB(gokart.TaskOnKart):
    t = gokart.TaskInstanceParameter()
    x = luigi.Parameter()
    
    def run(self):
        t = self.load('t')
        self.dump(','.join([t, self.x]))

task = TaskB(t=TaskA(x='hello'), x='world')
output = gokart.build(task)

print(output)    # hello, world

@vaaaaanquish vaaaaanquish changed the title [WIP] add gokart build method Add gokart build method Apr 2, 2021
@vaaaaanquish vaaaaanquish mentioned this pull request Apr 2, 2021
7 tasks
@vaaaaanquish vaaaaanquish changed the base branch from master to 1.0.0 April 8, 2021 19:54
Copy link
Collaborator

@hirosassa hirosassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vaaaaanquish
Copy link
Contributor Author

@hirosassa thx.

@Hi-king @mski-iksm plz review!

gokart/build.py Outdated Show resolved Hide resolved
gokart/build.py Outdated Show resolved Hide resolved
Copy link
Member

@Hi-king Hi-king left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main concerns are about overlappings between gokart.run and gokart.build

@vaaaaanquish
Copy link
Contributor Author

@Hi-king

My main concerns are about overlappings between gokart.run and gokart.build

I don't think there's usually a use case for that. So, I'll write some documentation.

gokart/build.py Outdated Show resolved Hide resolved
_reset_register()
_read_environ()
_check_config()
with HideLogger(verbose):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool way :)

@Hi-king
Copy link
Member

Hi-king commented Apr 12, 2021

I don't think there's usually a use case for that. So, I'll write some documentation.

My point is not for usage, but for developing from the point of view of the reusability.
Anyway current implementation is more reusable by importing functions from gokart.run :)

@vaaaaanquish vaaaaanquish mentioned this pull request Apr 13, 2021
@Hi-king
Copy link
Member

Hi-king commented Apr 13, 2021

@vaaaaanquish cool refactoring. Merged. Thx :)

@Hi-king Hi-king merged commit c616872 into 1.0.0 Apr 13, 2021
@Hi-king Hi-king deleted the add-gokart-runner branch April 13, 2021 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants