Skip to content

ENH: Add a @pytask.mark.task decorator to mark functions as tasks irrespective of the name. #175

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

Closed
tobiasraabe opened this issue Dec 29, 2021 · 0 comments · Fixed by #200
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tobiasraabe
Copy link
Member

Is your feature request related to a problem?

Currently, task functions must be prefixed with task_ to be considered by pytask which is an unnecessary limitation as some user might prefer a different naming scheme.

For modules, the limitation is basically lifted since setting the configuration option task_files to * would basically collect all files.

Describe the solution you'd like

A decorator pytask.mark.task which optionally accepts a string which is the task id of the task.

@pytask.mark.task("real_task_id")
def do_this_and_only_this(depends_on, produces):
    ...
```

Then, there needs to be a small change in the collection module to also collect functions with the ``pytask.mark.task`` marker.
@tobiasraabe tobiasraabe added enhancement New feature or request good first issue Good for newcomers labels Dec 29, 2021
@tobiasraabe tobiasraabe changed the title ENH: Add a @task decorator to mark functions as tasks irrespective of the name. ENH: Add a @pytask.mark.task decorator to mark functions as tasks irrespective of the name. Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant