GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: correct annotations and docstrings · fresh2dev/ppqueue@7a2470a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/ppqueue
    • job.py
    • plot.py
    • queue.py
    • utils.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/ppqueue/job.py‎

Copy file name to clipboardExpand all lines: src/ppqueue/job.py
+37-9Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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
Collapse file

‎src/ppqueue/plot.py‎

Copy file name to clipboardExpand all lines: src/ppqueue/plot.py
+11-7Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,19 @@ def plot_jobs(
222222
"""
223223
224224
Args:
225-
title:
226-
color_by:
227-
facet_by:
228-
facet_scale:
229-
theme:
230-
no_legend:
231-
bar_width:
225+
*args: Sequences of `Job` instances to plot.
226+
title: ...
227+
color_by: ...
228+
facet_by: ...
229+
facet_scale: ...
230+
theme: ...
231+
no_legend: ...
232+
bar_width: ...
232233
color_pal: a sequence of colors used to color each group of `color_by`.
233234
235+
Returns:
236+
...
237+
234238
Examples:
235239
>>> from ppqueue import Queue
236240
>>> from ppqueue.plot import plot_jobs

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.