You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Python API, all the tasks are currently an instance of the Task class with different types indicated by task_type. It would be more pythonic to implement them as a hierarchy of classes, one for each task_type (or even one for every Program or python Remote func. - TBD). This would have the advantages to allow using isinstance and better introspection (__repr__), access to parameters specific to the task type and allow subclassing.
Independently of this change, we can keep the task-creation operations as functions (and lower-cased), e.g. keep tasks.concat in additon to having tasks.ConcatTask.
This should be mostly non-disruptive change and needs a more detailed spec of Task interface.
The text was updated successfully, but these errors were encountered:
I agree with this change. For me, the main point is better __repr__ than what we have now.
The only potential problem that I see is now is persistent sessions; reconstructing a graph in different Python client will be more complicated than now.
Good point about reconstruction from in-server data. We can map known types to their classes and then fallback with CustomTask (or such) - for those it is no worse than just a Task instance now.
We need a representation for the task types. We have the following task kinds:
Built-in task, names prefixed with !, finite and relatively stable set
Python @remote tasks
Task type !py
Class: Either just PyTask, or one PyTask subclass per @remote. Possible drawback:
External programs
Task type !exec
Class: ExecTask
User-provided subworkers (possibly including Python)
Propose subworker_name/provided_task (where subworker_name is the name subworker was registered with at the worker, preferably the binary name, provided_task is the name the subworker function was registered with, preferably based on the function name)
Class: SubworkerTask and subclasses
Possibly let the client declare MyownSubworker classes?
In the Python API, all the tasks are currently an instance of the
Task
class with different types indicated bytask_type
. It would be more pythonic to implement them as a hierarchy of classes, one for eachtask_type
(or even one for everyProgram
or pythonRemote
func. - TBD). This would have the advantages to allow usingisinstance
and better introspection (__repr__
), access to parameters specific to the task type and allow subclassing.Independently of this change, we can keep the task-creation operations as functions (and lower-cased), e.g. keep
tasks.concat
in additon to havingtasks.ConcatTask
.This should be mostly non-disruptive change and needs a more detailed spec of Task interface.
The text was updated successfully, but these errors were encountered: