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

Fix docstring in Job. #673

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/jobflow/core/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,20 +297,20 @@ class Job(MSONable):
--------
Builtin functions such as :obj:`print` can be specified.

>>> print_task = Job(function=print, args=("I am a job", ))
>>> print_task = Job(function=print, function_args=("I am a job", ))

Or other functions of the Python standard library.

>>> import os
>>> Job(function=os.path.join, args=("folder", "filename.txt"))
>>> Job(function=os.path.join, function_args=("folder", "filename.txt"))

To use custom functions, the functions should be importable (i.e. not
defined in another function). For example, if the following function is defined
in the ``my_package`` module.

>>> def add(a, b):
... return a + b
>>> add_job = Job(function=add, args=(1, 2))
>>> add_job = Job(function=add, function_args=(1, 2))

More details are given in the :obj:`job` decorator docstring.

Expand Down
Loading