Skip to content

fix: Invalid concurrent-processing return type #137

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

Merged
merged 2 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ identifiers:
value: 10.5281/zenodo.10799219
description: This is the collection of archived snapshots of all versions of thread.
- type: url
value: https://github.com/python-thread/thread/releases/tag/v2.0.3
description: The GitHub release URL of tag v2.0.3.
value: https://github.com/python-thread/thread/releases/tag/v2.0.4
description: The GitHub release URL of tag v2.0.4.
- type: url
value: https://pypi.org/project/thread/2.0.3
description: The PyPI release URL of tag v2.0.3.
value: https://pypi.org/project/thread/2.0.4
description: The PyPI release URL of tag v2.0.4.
cff-version: 1.2.0
date-released: 2024-03-07
keywords:
Expand All @@ -32,5 +32,5 @@ repository-code: https://github.com/python-thread/thread
repository-artifact: https://pypi.org/project/thread
title: thread
type: software
version: 2.0.3
version: 2.0.4
url: https://thread.ngjx.org
2 changes: 1 addition & 1 deletion docs/src/pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "menu",
"items": {
"latest-release": {
"title": "2.0.3 Latest Release",
"title": "2.0.4 Latest Release",
"href": "/docs/latest"
},
"v1-release": {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"timestamp": false
}
},
"latest": "v2.0.3 Latest",
"latest": "v2.0.4 Latest",
"v1": "v1.1.1"
}
13 changes: 12 additions & 1 deletion docs/src/pages/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This is a list of all the available releases.
>
<div className="flex flex-row items-center gap-2">
<ExternalLinkIcon className="w-6 h-6" />
<Text className="text-lg font-bold">Latest v2.0.3</Text>
<Text className="text-lg font-bold">Latest v2.0.4</Text>
</div>
<Text className="text-sm font-light text-left ml-4">
This is the latest ***stable*** release.
Expand Down Expand Up @@ -110,6 +110,17 @@ This is a list of all the available releases.
</div>
<StatusBadge variant="dev">dev</StatusBadge>
</Link>
<Link
target="_blank"
href="/github/v2.0.4"
className="flex flex-row w-full justify-between px-4 py-2 rounded-md items-center text-sm font-light hover:bg-neutral-100/40 dark:hover:bg-neutral-800/20 transition-all"
>
<div className="flex flex-col justify-between">
<h1 className="font-normal text-lg">Release v2.0.4</h1>
<p>7 July 2024</p>
</div>
<StatusBadge variant="stable">stable</StatusBadge>
</Link>
<Link
target="_blank"
href="/github/v2.0.3"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/docs/latest/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { Cards, Card } from "nextra/components";

This is `thread`, a Python library which extends Python's built-in `threading` library.

## Thread v2.0.3
## Thread v2.0.4

You are viewing the documentation for the `v2.0.3` release.<br />
You are viewing the documentation for the `v2.0.4` release.<br />
This is the most recent stable release of `thread`.

## Quick Start
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Thread v2.0.3
title: Thread v2.0.4
---

import Link from "next/link";
Expand Down Expand Up @@ -71,7 +71,7 @@ export function Feature({
<span className="bg-clip-text text-transparent bg-gradient-to-r from-pink-500 to-violet-500">
<span>Thread</span>
</span>
<span>&nbsp;- v2.0.3</span>
<span>&nbsp;- v2.0.4</span>
</h1>
<div className="text-center">
<PackageManager />
Expand Down
4 changes: 2 additions & 2 deletions docs/theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Head = () => {
const { route } = useRouter();

const pageTitle =
route === "/" || !title ? "Thread v2.0.3" : `${title} | Thread v2.0.3`;
route === "/" || !title ? "Thread v2.0.4" : `${title} | Thread v2.0.4`;
const socialImage = "https://thread.ngjx.org/socialcard-white.jpg";

return (
Expand Down Expand Up @@ -125,7 +125,7 @@ const config: DocsThemeConfig = {
const { asPath } = useRouter();
if (asPath !== "/") {
return {
titleTemplate: "%s | Thread v2.0.3",
titleTemplate: "%s | Thread v2.0.4",
};
}
},
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "thread"
version = "2.0.3"
version = "2.0.4"
description = "Threading module extension"
authors = ["Alex <contact@ngjx.org>"]
license = "BSD-3-Clause"
Expand Down Expand Up @@ -30,7 +30,7 @@ classifiers = [

[tool.poetry.urls]
Homepage = "https://thread.ngjx.org"
Documentation = "https://thread.ngjx.org/docs/v2.0.3"
Documentation = "https://thread.ngjx.org/docs/v2.0.4"
Source = "https://github.com/python-thread/thread"
Download = "https://pypi.org/project/thread/#files"
"Release Notes" = "https://github.com/python-thread/thread/releases"
Expand Down
2 changes: 1 addition & 1 deletion src/thread/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
## Thread Library
Documentation at https://thread.ngjx.org/docs/2.0.3
Documentation at https://thread.ngjx.org/docs/2.0.4


---
Expand Down
10 changes: 5 additions & 5 deletions src/thread/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def wrapper(
*args: _Target_P.args,
**kwargs: _Target_P.kwargs,
) -> List[_Target_T]:
computed: List[Data_Out] = []
computed: List[_Target_T] = []

i = 0
for data_entry in data_chunk:
Expand All @@ -547,7 +547,7 @@ def wrapper(
return wrapper

@property
def results(self) -> List[_Dataset_T]:
def results(self) -> List[_Target_T]:
"""
The return value of the threads if completed

Expand All @@ -560,7 +560,7 @@ def results(self) -> List[_Dataset_T]:
if len(self._threads) == 0:
raise exceptions.ThreadNotInitializedError()

results: List[Data_Out] = []
results: List[_Target_T] = []
for entry in self._threads:
results += entry.thread.result
return results
Expand All @@ -577,15 +577,15 @@ def is_alive(self) -> bool:
raise exceptions.ThreadNotInitializedError()
return any(entry.thread.is_alive() for entry in self._threads)

def get_return_values(self) -> List[_Dataset_T]:
def get_return_values(self) -> List[_Target_T]:
"""
Halts the current thread execution until the thread completes

Returns
-------
:returns Any: The return value of the target function
"""
results: List[Data_Out] = []
results: List[_Target_T] = []
for entry in self._threads:
entry.thread.join()
results += entry.thread.result
Expand Down