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

job manager: rename start_job callable to create_job #647

Open
soxofaan opened this issue Oct 21, 2024 · 1 comment
Open

job manager: rename start_job callable to create_job #647

soxofaan opened this issue Oct 21, 2024 · 1 comment

Comments

@soxofaan
Copy link
Member

MultiBackendJobManager.run_jobs has a start_job callable to create a job and, as suggested by its name, to start it too.
However, blindly starting each job on creation is actually an anti-pattern with the job manager (which knows better when to start jobs, based on capacity).

We should rename start_job to create_job to make the better usage pattern more obvious

@soxofaan
Copy link
Member Author

FYI I think we can do this rename while keeping start_job support for some time. We're already doing that with output_file

if "output_file" in kwargs:
if job_db is not None:
raise ValueError("Only one of `output_file` and `job_db` should be provided")
warnings.warn(
"The `output_file` argument is deprecated. Use `job_db` instead.", DeprecationWarning, stacklevel=2
)
job_db = kwargs.pop("output_file")
assert not kwargs, f"Unexpected keyword arguments: {kwargs!r}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant