-
Notifications
You must be signed in to change notification settings - Fork 38
Experiment Can Stop Launched Jobs #677
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
Changes from all commits
2aee1b4
5a9433f
cce9005
415bff8
b55c582
ed4fe1b
f291919
2afa9f7
875596c
066b52e
ae4fc1e
24a170f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -420,6 +420,25 @@ def summary(self, style: str = "github") -> str: | |
| disable_numparse=True, | ||
| ) | ||
|
|
||
| def stop(self, *ids: LaunchedJobID) -> tuple[JobStatus | InvalidJobStatus, ...]: | ||
| """Cancel the execution of a previously launched job. | ||
|
|
||
| :param ids: The ids of the launched jobs to stop. | ||
| :raises ValueError: No job ids were provided. | ||
| :returns: A tuple of job statuses upon cancellation with order | ||
| respective of the order of the calling arguments. | ||
| """ | ||
| if not ids: | ||
| raise ValueError("No job ids provided") | ||
| by_launcher = self._launch_history.group_by_launcher(set(ids), unknown_ok=True) | ||
| id_to_stop_stat = ( | ||
| launcher.stop_jobs(*launched).items() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One thing I am thinking about here is stop_jobs may raise a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In theory this cannot happen if the I moved this to a new issue where it can be discussed further because I think this may be a problem with other methods (e.g. |
||
| for launcher, launched in by_launcher.items() | ||
| ) | ||
| stats_map = dict(itertools.chain.from_iterable(id_to_stop_stat)) | ||
| stats = (stats_map.get(id_, InvalidJobStatus.NEVER_STARTED) for id_ in ids) | ||
| return tuple(stats) | ||
|
|
||
| @property | ||
| def telemetry(self) -> TelemetryConfiguration: | ||
| """Return the telemetry configuration for this entity. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.