Skip to content

v0.1.3 #19

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 27 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a939371
- Removed unused import
caffeine-addictt Dec 9, 2023
8f059f5
+ Bug fix progress never reaches 1.0
caffeine-addictt Dec 10, 2023
586dae8
+ Added option to disable graceful shutdown
caffeine-addictt Dec 10, 2023
dfe48e4
+ Export Settings
caffeine-addictt Dec 10, 2023
660115e
+ Change directory
caffeine-addictt Dec 10, 2023
8847b6a
+ Disabling graceful shutdown functionality
caffeine-addictt Dec 10, 2023
30ee6af
+ Change import path
caffeine-addictt Dec 10, 2023
3b9b514
+ Change naming shutdown=>exit
caffeine-addictt Dec 10, 2023
6a35545
+ Added graceful-exit option
caffeine-addictt Dec 10, 2023
9ab0224
+ Added process comamnd settings
caffeine-addictt Dec 10, 2023
6f98f04
+ Added color to help message
caffeine-addictt Dec 10, 2023
857de96
+ Error handling in graceful shutdown
caffeine-addictt Dec 10, 2023
c6adbc9
+ Documentation update
caffeine-addictt Dec 10, 2023
1b2cbbc
+ New kwargs processing method and prettier help message
caffeine-addictt Dec 10, 2023
c429074
+ New kwargs processing method
caffeine-addictt Dec 10, 2023
86ae0c5
Coverage
caffeine-addictt Dec 10, 2023
2214c3c
+ README update
caffeine-addictt Dec 10, 2023
fd6f80c
- Remove ruff-detected redudancy
caffeine-addictt Dec 10, 2023
a81d244
+ Added ruff ignore clause
caffeine-addictt Dec 10, 2023
3761773
+ Increased progress precision
caffeine-addictt Dec 10, 2023
b52675e
+ Made progress bar indicator prettier
caffeine-addictt Dec 10, 2023
2b9a6bb
+ Bug fix test worker
caffeine-addictt Dec 10, 2023
d4a8b7b
- Remove requirements.txt
caffeine-addictt Dec 10, 2023
a70c3f9
+ Update lock file
caffeine-addictt Dec 10, 2023
7dddc0f
+ Hot fix
caffeine-addictt Dec 10, 2023
7ea6922
+ Update version number
caffeine-addictt Dec 10, 2023
e437d49
+ Bump development status
caffeine-addictt Dec 10, 2023
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
Binary file modified .coverage
Binary file not shown.
7 changes: 5 additions & 2 deletions .github/workflows/test-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U coverage pytest pytest-cov
python -m pip install -U coverage pytest pytest-cov poetry
python -m poetry install
python -m poetry self add poetry-plugin-export
python -m poetry export -f requirements.txt --output requirements.txt
python -m pip install -r requirements.txt

- name: Lint with Ruff
run: |
python -m pip install -U ruff
ruff -v --per-file-ignores="__init__.py:F401" .
ruff --per-file-ignores="__init__.py:F401" --per-file-ignores="__init__.py:E402" .
continue-on-error: true

- name: Test with pytest
Expand Down
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@


<!-- PROJECT SHIELDS -->
<!--
*** I'm using markdown "reference style" links for readability.
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
*** See the bottom of this document for the declaration of the reference variables
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
-->
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![BSD-3-Clause License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
<div align="center">

<a href="[contributors-url]">[![Contributors][contributors-shield]][contributors-url]</a>
<a href="[forks-url]">[![Forks][forks-shield]][forks-url]</a>
<a href="[stars-url]">[![Stargazers][stars-shield]][stars-url]</a>
<a href="[issues-url]">[![Issues][issues-shield]][issues-url]</a>
<a href="[license-url]">[![BSD-3-Clause License][license-shield]][license-url]</a>
<a href="[linkedin-url]">[![LinkedIn][linkedin-shield]][linkedin-url]</a>

</div>

<!-- PROJECT LOGO -->
<br />
Expand Down Expand Up @@ -94,11 +91,11 @@ Our docs are [here!](/docs/getting-started.md)
<!-- ROADMAP -->
## Roadmap

- [x] Bug fixes
- [x] Set Thread class to inherit from threading.Thread
- [x] Add kill method
- [x] Docs Update
- [ ] v0.1.2 Release
- [x] v0.1.3 Release
- [ ] Bug fixes
- [ ] New features
- [ ] Testing
- [ ] Next release...

See the [open issues](https://github.com/caffeine-addictt/thread/issues) for a full list of proposed features (and known issues).

Expand Down Expand Up @@ -138,6 +135,8 @@ Distributed under the BSD-3-Clause License. See `LICENSE.txt` for more informati

Alex - junxiangng63@gmail.com

Project Board: https://github.com/users/caffeine-addictt/projects/5

Project Link: [https://github.com/caffeine-addictt/thread](https://github.com/caffeine-addictt/thread)

<p align="right">(<a href="#readme-top">back to top</a>)</p>
Expand Down
39 changes: 32 additions & 7 deletions docs/command-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@ I will lay out how to use the comamnd line!
<details>
<summary>Jump to</summary>
<ul>
<li><a href='#importing-the-class'> Import the class</a></li>
<li><a href='#initializing-a-thread'> Initialize a thread </a></li>
<li><a href='#parameters'> Parameters </a></li>
<li><a href='#attributes'> Attributes </a></li>
<li><a href='#methods'> Class Methods </a></li>
<li><a href='#behviours'> Behaviours </a></li>
<li><a href='#getting-started'> Getting Started </a></li>
<li><a href='#log-levels'> Log Levels </a></li>
<li><a href='#commands'> Commands </a></li>
<details>
<summary>List</summary>
<ul>
<li><a href='#documentation-thread-docs'> thread docs </a></li>
<li><a href='#help-thread-help'> thread help </a></li>
<li><a href='#report-thread-report'> thread report </a></li>
<li><a href='#configuration-thread-config'> thread config </a></li>
<li><a href='#parallel-processing-thread-process'> thread process ... </a></li>
</ul>
</details>
</ul>

</details>


Expand Down Expand Up @@ -58,6 +66,9 @@ List of commands

### Documentation (thread docs)

```sh
$ thread docs
```
Ran with no arguments and options, this command will attempt to open your brower to this MD file!
<br />
If unable, will instead print out the link.
Expand All @@ -67,6 +78,9 @@ If unable, will instead print out the link.

### Help (thread help)

```sh
$ thread help
```
Ran with no arguments and options, this command will attempt to open your brower to the issue tracker!
<br />
If unable, will instead print out the link.
Expand All @@ -76,6 +90,9 @@ If unable, will instead print out the link.

### Report (thread report)

```sh
$ thread report
```
Ran with no arguments and options, this command will attempt to open your brower to this MD file!
<br />
If unable, will instead print out the link.
Expand All @@ -85,6 +102,9 @@ If unable, will instead print out the link.

### Configuration (thread config ...)

```sh
$ thread config
```
Comming soon.


Expand All @@ -93,7 +113,11 @@ Comming soon.

### Parallel Processing (thread process ...)

```sh
$ thread process
```
Invokes the [parallel processing class](parallel-processing.md#importing-the-class)<br />
<br />

> **Help Command Output**

Expand All @@ -107,14 +131,15 @@ $ thread process 'lambda x: x**2' '[ i for i in range(1000) ]'
$ thread process home.Downloads.clean_data:clean ./dataset.csv -t 20
=> The same as:
from home.Downloads.clean_data import clean
dataset = open('dataset.csv', 'r')
dataset = open('./dataset.csv', 'r')

newProcess = ParallelProcess(
target = clean,
dataset = dataset,
max_threads = 20
)
newProcess.start()
dataset.close()

prints or writes to file the result
```
Expand Down
43 changes: 43 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Thread Configuration Documentation

I will lay out the configuration options!

<br />
<details>
<summary>Jump to</summary>
<ul>
<li><a href='#importing-the-class'> Import the class </a></li>
<li><a href='#graceful-exiting'> Graceful Exit </a></li>
</ul>
</details>


Don't have the thread library? [See here](./getting-started.md) for installing thread

---

## Importing the class

```py
from thread import Thread
```

<br />


## Graceful Exiting

```py
from thread import Settings

# Enable/Disable graceful exiting
Settings.set_graceful_exit(True)
Settings.set_graceful_exit(False)
```

<br />


Now you know the configuration options available!

[See here](./parallel-processing.md) for how to using the `thread.ParallelProcessing` class!
Binary file modified docs/images/process_help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/threading.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ I will lay out how to use the `thread.Thread` class!
<details>
<summary>Jump to</summary>
<ul>
<li><a href='#importing-the-class'> Import the class</a></li>
<li><a href='#importing-the-class'> Import the class </a></li>
<li><a href='#initializing-a-thread'> Initialize a thread </a></li>
<li><a href='#parameters'> Parameters </a></li>
<li><a href='#attributes'> Attributes </a></li>
Expand Down
56 changes: 28 additions & 28 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 = "0.1.2"
version = "0.1.3"
description = "Threading module extension"
authors = ["Alex <taboez4life@gmail.com>"]
license = "BSD-3-Clause"
Expand All @@ -12,7 +12,7 @@ repository = "https://github.com/caffeine-addictt/thread"
documentation = "https://github.com/caffeine-addictt/thread/blob/main/docs/getting-started.md"
keywords = ["threading", "extension", "multiprocessing"]
classifiers = [
"Development Status :: 1 - Planning",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License"
]
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

4 changes: 3 additions & 1 deletion src/thread/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@

from . import (
exceptions
)
)

from .utils import Settings
10 changes: 7 additions & 3 deletions src/thread/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
Import and config CLI commands
"""

__version__ = '0.1.2'
from ..config import logging, ColorLogger
__version__ = '0.1.3'
from ..utils.logging_config import logging, ColorLogger
logging.setLoggerClass(ColorLogger)


# Import #
from .base import cli_base as app
from .process import process as process_cli

app.command(name = 'process')(process_cli)
app.command(
name = 'process',
no_args_is_help = True,
context_settings = {'allow_extra_args': True}
)(process_cli)
Loading