From ae4655dd84a638d48a934dd82d4697e02a3ee098 Mon Sep 17 00:00:00 2001 From: Geraint Palmer Date: Wed, 3 Apr 2024 10:34:19 +0100 Subject: [PATCH] update schedules docstring --- ciw/schedules.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/ciw/schedules.py b/ciw/schedules.py index 044af70..a72a52e 100644 --- a/ciw/schedules.py +++ b/ciw/schedules.py @@ -2,21 +2,24 @@ class Schedule: """ - A Schedule class for storing information about server schedules and generating the next shifts. + A Schedule class for storing information about server schedules and + generating the next shifts. Parameters ---------- schedule : List[Tuple[int, float]] - A list of tuples representing shifts, where each tuple contains the number of servers and the shift date. + A list of tuples representing shifts, where each tuple contains the + number of servers and the shift end date. preemption : Union[bool, str], optional - Pre-emption option, should be either 'resume', 'restart', 'resample', or False. Default is False. + Pre-emption option, should be either 'resume', 'restart', 'resample', + or False. Default is False. Attributes ---------- schedule_type : str Type of the schedule. schedule_dates : List[float] - List of shift dates. + List of shift end dates. schedule_servers : List[int] List of corresponding server numbers. preemption : Union[bool, str] @@ -29,7 +32,8 @@ class Schedule: initialise() Initializes the generator object at the beginning of a simulation. get_schedule_generator(boundaries, values) - A generator that yields the next time and number of servers according to a given schedule. + A generator that yields the next time and number of servers according + to a given schedule. get_next_shift() Updates the next shifts from the generator. """ @@ -43,7 +47,8 @@ def __init__(self, schedule: List[Tuple[int, float]], preemption: Union[bool, st A list of tuples representing shifts, where each tuple contains the number of servers and the shift date. preemption : Union[bool, str], optional - Pre-emption option, should be either 'resume', 'restart', 'resample', or False. + Pre-emption option, should be either 'resume', 'restart', + 'resample', or False. Default is False. """ if preemption not in [False, 'resume', 'restart', 'resample']: @@ -64,7 +69,8 @@ def initialise(self) -> NoReturn: def get_schedule_generator(self, boundaries: List[float], values:List[int]) -> Generator[Tuple[float, int], None, None]: """ - A generator that yields the next time and number of servers according to a given schedule. + A generator that yields the next time and number of servers according + to a given schedule. Parameters ----------