-
Notifications
You must be signed in to change notification settings - Fork 8
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
Define interface in QueueAdapterAbstractClass #343
Merged
+87
−2
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import List, Optional, Union | ||
|
||
import pandas | ||
from jinja2 import Template | ||
|
||
|
||
class QueueAdapterAbstractClass(ABC): | ||
@abstractmethod | ||
def submit_job( | ||
self, | ||
queue: Optional[str] = None, | ||
job_name: Optional[str] = None, | ||
working_directory: Optional[str] = None, | ||
cores: Optional[int] = None, | ||
memory_max: Optional[int] = None, | ||
run_time_max: Optional[int] = None, | ||
dependency_list: Optional[List[str]] = None, | ||
command: Optional[str] = None, | ||
submission_template: Optional[Union[str, Template]] = None, | ||
**kwargs, | ||
) -> Union[int, None]: | ||
pass | ||
|
||
@abstractmethod | ||
def enable_reservation(self, process_id: int): | ||
pass | ||
|
||
@abstractmethod | ||
def delete_job(self, process_id: int) -> Union[str, None]: | ||
pass | ||
|
||
@abstractmethod | ||
def get_queue_status(self, user: Optional[str] = None) -> pandas.DataFrame: | ||
""" | ||
Get the status of the queue. | ||
|
||
Args: | ||
user (str): The user to filter the queue status for. | ||
|
||
Returns: | ||
pandas.DataFrame: The queue status. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def get_status_of_my_jobs(self) -> pandas.DataFrame: | ||
""" | ||
Get the status of the user's jobs. | ||
|
||
Returns: | ||
pandas.DataFrame: The status of the user's jobs. | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def get_status_of_job(self, process_id: int) -> Union[str, None]: | ||
""" | ||
Get the status of a job. | ||
|
||
Args: | ||
process_id (int): The process ID. | ||
|
||
Returns: | ||
str: The status of the job.results_lst.append(df_selected.values[0]) | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def get_status_of_jobs(self, process_id_lst: List[int]) -> List[str]: | ||
""" | ||
Get the status of multiple jobs. | ||
|
||
Args: | ||
process_id_lst (list[int]): List of process IDs. | ||
|
||
Returns: | ||
list[str]: List of job statuses. | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the incorrect docstring in
get_status_of_job
method.The
Returns
section of the docstring includes an unintended code snippet. It currently reads:This should be corrected to:
📝 Committable suggestion