@@ -68,16 +68,16 @@ def __post_init__(self) -> None:
6868 if self .kwargs is None :
6969 self .kwargs = {}
7070
71- def _compare (self , job : object ) -> int :
71+ def _compare (self , job : Job ) -> int :
7272 """compares two jobs by priority or index.
7373
7474 Arguments:
75- job {ppqueue.Job}
75+ job: ...
7676
7777 Returns:
78- int -- `1` if `self` is greater than comparison,
79- `-1` if `self` is less than,
80- `0` if equal.
78+ `1` if `self` is greater than comparison,
79+ `-1` if `self` is less than,
80+ `0` if equal.
8181 """
8282 return compare_by (self , job , by = ["priority" , "idx" ])
8383
@@ -117,7 +117,11 @@ def join(self, *args, **kwargs) -> None:
117117 self .inner_job .join (* args , ** kwargs )
118118
119119 def get_exit_code (self ) -> int | None :
120- """Exit code of the job."""
120+ """Exit code of the job.
121+
122+ Returns:
123+ ...
124+ """
121125 if (
122126 not self .inner_job
123127 or not hasattr (self .inner_job , "exitcode" )
@@ -146,6 +150,9 @@ def stop(self) -> None:
146150 def get_seconds_running (self ) -> float | None :
147151 """The number of seconds a job was running for.
148152
153+ Returns:
154+ ...
155+
149156 Examples:
150157 >>> from ppqueue import Queue
151158 >>> from time import sleep
@@ -164,6 +171,9 @@ def get_seconds_running(self) -> float | None:
164171 def get_seconds_waiting (self ) -> float | None :
165172 """The amount of time a data has spent in the waiting queue.
166173
174+ Returns:
175+ ...
176+
167177 Examples:
168178 >>> job.get_seconds_waiting() # doctest: +SKIP
169179 """
@@ -178,6 +188,9 @@ def get_seconds_waiting(self) -> float | None:
178188 def get_seconds_total (self ) -> float | None :
179189 """Returns the waiting + running duration of this job.
180190
191+ Returns:
192+ ...
193+
181194 Examples:
182195 >>> job.get_seconds_total() # doctest: +SKIP
183196 """
@@ -192,6 +205,9 @@ def get_seconds_total(self) -> float | None:
192205 def get_submit_timestamp (self ) -> datetime | None :
193206 """The time this job was submitted.
194207
208+ Returns:
209+ ...
210+
195211 Examples:
196212 >>> job.get_submit_timestamp() # doctest: +SKIP
197213 """
@@ -200,19 +216,31 @@ def get_submit_timestamp(self) -> datetime | None:
200216 return None
201217
202218 def get_start_timestamp (self ) -> datetime | None :
203- """Returns a datetime object of the time this data was started."""
219+ """Returns a datetime object of the time this data was started.
220+
221+ Returns:
222+ ...
223+ """
204224 if self .start_timestamp :
205225 return datetime .utcfromtimestamp (self .start_timestamp )
206226 return None
207227
208228 def get_finish_timestamp (self ) -> datetime | None :
209- """Returns a datetime object of the time this data finished."""
229+ """Returns a datetime object of the time this data finished.
230+
231+ Returns:
232+ ...
233+ """
210234 if self .finish_timestamp :
211235 return datetime .utcfromtimestamp (self .finish_timestamp )
212236 return None
213237
214238 def get_processed_timestamp (self ) -> datetime | None :
215- """Returns a datetime object of the time this data was processed."""
239+ """Returns a datetime object of the time this data was processed.
240+
241+ Returns:
242+ ...
243+ """
216244 if self .process_timestamp :
217245 return datetime .utcfromtimestamp (self .process_timestamp )
218246 return None
0 commit comments