mirror of
https://github.com/clearml/clearml
synced 2025-04-14 04:21:53 +00:00
Add TaskTypes to main namespace (#453)
* add tasktypes to main namespace * add tasktypes to pipe decorator example * minor linting Co-authored-by: Johnathan Alexander <jalexander86@gatech.edu>
This commit is contained in:
parent
fd83f8c2cb
commit
dd3d4cec94
@ -9,12 +9,15 @@ from .storage import StorageManager
|
|||||||
from .errors import UsageError
|
from .errors import UsageError
|
||||||
from .datasets import Dataset
|
from .datasets import Dataset
|
||||||
|
|
||||||
|
TaskTypes = Task.TaskTypes
|
||||||
|
|
||||||
if not PY2:
|
if not PY2:
|
||||||
from .automation.controller import PipelineController
|
from .automation.controller import PipelineController
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"__version__",
|
"__version__",
|
||||||
"Task",
|
"Task",
|
||||||
|
"TaskTypes",
|
||||||
"InputModel",
|
"InputModel",
|
||||||
"OutputModel",
|
"OutputModel",
|
||||||
"Model",
|
"Model",
|
||||||
@ -28,6 +31,7 @@ else:
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
"__version__",
|
"__version__",
|
||||||
"Task",
|
"Task",
|
||||||
|
"TaskTypes",
|
||||||
"InputModel",
|
"InputModel",
|
||||||
"OutputModel",
|
"OutputModel",
|
||||||
"Model",
|
"Model",
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
from clearml.automation.controller import PipelineDecorator
|
from clearml.automation.controller import PipelineDecorator
|
||||||
|
from clearml import TaskTypes
|
||||||
|
|
||||||
|
|
||||||
# Make the following function an independent pipeline component step
|
# Make the following function an independent pipeline component step
|
||||||
# notice all package imports inside the function will be automatically logged as
|
# notice all package imports inside the function will be automatically logged as
|
||||||
# required packages for the pipeline execution step
|
# required packages for the pipeline execution step
|
||||||
@PipelineDecorator.component(return_values=['data_frame'], cache=True)
|
@PipelineDecorator.component(return_values=['data_frame'], cache=True, task_type=TaskTypes.data_processing)
|
||||||
def step_one(pickle_data_url: str, extra: int = 43):
|
def step_one(pickle_data_url: str, extra: int = 43):
|
||||||
print('step_one')
|
print('step_one')
|
||||||
# make sure we have scikit-learn for this step, we need it to use to unpickle the object
|
# make sure we have scikit-learn for this step, we need it to use to unpickle the object
|
||||||
@ -26,7 +27,7 @@ def step_one(pickle_data_url: str, extra: int = 43):
|
|||||||
# required packages for the pipeline execution step.
|
# required packages for the pipeline execution step.
|
||||||
# Specifying `return_values` makes sure the function step can return an object to the pipeline logic
|
# Specifying `return_values` makes sure the function step can return an object to the pipeline logic
|
||||||
# In this case, the returned tuple will be stored as an artifact named "processed_data"
|
# In this case, the returned tuple will be stored as an artifact named "processed_data"
|
||||||
@PipelineDecorator.component(return_values=['processed_data'], cache=True,)
|
@PipelineDecorator.component(return_values=['processed_data'], cache=True, task_type=TaskTypes.data_processing)
|
||||||
def step_two(data_frame, test_size=0.2, random_state=42):
|
def step_two(data_frame, test_size=0.2, random_state=42):
|
||||||
print('step_two')
|
print('step_two')
|
||||||
# make sure we have pandas for this step, we need it to use the data_frame
|
# make sure we have pandas for this step, we need it to use the data_frame
|
||||||
@ -45,7 +46,7 @@ def step_two(data_frame, test_size=0.2, random_state=42):
|
|||||||
# required packages for the pipeline execution step
|
# required packages for the pipeline execution step
|
||||||
# Specifying `return_values` makes sure the function step can return an object to the pipeline logic
|
# Specifying `return_values` makes sure the function step can return an object to the pipeline logic
|
||||||
# In this case, the returned object will be stored as an artifact named "model"
|
# In this case, the returned object will be stored as an artifact named "model"
|
||||||
@PipelineDecorator.component(return_values=['model'], cache=True,)
|
@PipelineDecorator.component(return_values=['model'], cache=True, task_type=TaskTypes.training)
|
||||||
def step_three(data):
|
def step_three(data):
|
||||||
print('step_three')
|
print('step_three')
|
||||||
# make sure we have pandas for this step, we need it to use the data_frame
|
# make sure we have pandas for this step, we need it to use the data_frame
|
||||||
|
Loading…
Reference in New Issue
Block a user