Skip to content

Commit 1b11ac5

Browse files
committed
Merge branch 'dev'
2 parents 0fba9b2 + 7319ae0 commit 1b11ac5

File tree

11 files changed

+229
-112
lines changed

11 files changed

+229
-112
lines changed

.bumpversion.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[bumpversion]
2-
current_version = 0.3.0
2+
current_version = 0.4.0
33
commit = False
44
message = bump: {current_version} --> {new_version}
55
tag = False
66
tag_name = {current_version}
7-
tag_message =
7+
tag_message =
88
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<rc_kind>[A-Za-z]*)(?P<rc>\d*)
9-
serialize =
9+
serialize =
1010
{major}.{minor}.{patch}{rc_kind}{rc}
1111
{major}.{minor}.{patch}
1212

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: a01a11e
2+
_commit: b7e79bf
33
_src_path: https://codeberg.org/Fresh2dev/copier-f2dv-project.git
44
author_email: [email protected]
55
author_name: Donald Mellenbruch

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Changelog
22

3-
## 0.3.0
3+
## 0.4.0 - 2023-08-04
4+
5+
### :point_right: Changes
6+
7+
- *Breaking:* Default engine changed from `threading.Thread` to `mp.Process` [a3dc1af]
8+
9+
### :metal: Other
10+
11+
- Correct annotations and docstrings [7a2470a]
12+
13+
## 0.3.0 - 2023-06-22
414

515
- rename from `ezpq` to `ppqueue`
616
- replaced `queue.get` with `queue.dequeue` / `queue.pop`

README.pypi.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[https://www.f2dv.com/r/ppqueue](https://www.f2dv.com/r/ppqueue)

config/overrides/main.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
{% block fonts %}
1010
<style>
11-
@import url("https://www.fresh2.dev/assets/css/fonts.css");
11+
@import url("https://www.fresh2.dev/css/fonts.css");
1212

1313
:root {
1414
--md-text-font: iAWriterQuattroS, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, roboto, noto, arial, sans-serif;

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = [
88
{name = "Donald Mellenbruch", email = "[email protected]"},
99
]
1010
description = "A Parallel Process Queue for Python."
11-
readme = "README.md"
11+
readme = "README.pypi.md"
1212
license = {file = "LICENSE"}
1313
requires-python = ">=3.8"
1414
classifiers = [

src/ppqueue/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.3.0"
1+
__version__ = "0.4.0"

src/ppqueue/job.py

Lines 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

src/ppqueue/plot.py

Lines 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)