tldm 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. tldm-1.0.0/.gitattributes +11 -0
  2. tldm-1.0.0/.github/workflows/check.yml +17 -0
  3. tldm-1.0.0/.github/workflows/publish.yml +20 -0
  4. tldm-1.0.0/.github/workflows/test.yml +33 -0
  5. tldm-1.0.0/.gitignore +26 -0
  6. tldm-1.0.0/.vscode/settings.json +9 -0
  7. tldm-1.0.0/CODE_OF_CONDUCT.md +128 -0
  8. tldm-1.0.0/CONTRIBUTING.md +136 -0
  9. tldm-1.0.0/LICENCE +382 -0
  10. tldm-1.0.0/Makefile +65 -0
  11. tldm-1.0.0/PKG-INFO +1246 -0
  12. tldm-1.0.0/README.md +806 -0
  13. tldm-1.0.0/pyproject.toml +165 -0
  14. tldm-1.0.0/src/tldm/__init__.py +11 -0
  15. tldm-1.0.0/src/tldm/_monitor.py +115 -0
  16. tldm-1.0.0/src/tldm/aliases.py +86 -0
  17. tldm-1.0.0/src/tldm/extensions/__init__.py +1 -0
  18. tldm-1.0.0/src/tldm/extensions/asyncio.py +100 -0
  19. tldm-1.0.0/src/tldm/extensions/concurrent.py +125 -0
  20. tldm-1.0.0/src/tldm/extensions/pandas.py +179 -0
  21. tldm-1.0.0/src/tldm/extensions/rich.py +312 -0
  22. tldm-1.0.0/src/tldm/notebook.py +348 -0
  23. tldm-1.0.0/src/tldm/py.typed +0 -0
  24. tldm-1.0.0/src/tldm/std.py +1089 -0
  25. tldm-1.0.0/src/tldm/utils.py +832 -0
  26. tldm-1.0.0/tests/__init__.py +0 -0
  27. tldm-1.0.0/tests/conftest.py +58 -0
  28. tldm-1.0.0/tests/test_asyncio.py +119 -0
  29. tldm-1.0.0/tests/test_benchmark.py +189 -0
  30. tldm-1.0.0/tests/test_concurrent.py +60 -0
  31. tldm-1.0.0/tests/test_itertools.py +74 -0
  32. tldm-1.0.0/tests/test_notebook.py +7 -0
  33. tldm-1.0.0/tests/test_pandas.py +195 -0
  34. tldm-1.0.0/tests/test_perf.py +344 -0
  35. tldm-1.0.0/tests/test_synchronisation.py +232 -0
  36. tldm-1.0.0/tests/test_tldm.py +2090 -0
  37. tldm-1.0.0/tests/test_utils.py +210 -0
  38. tldm-1.0.0/uv.lock +1410 -0
@@ -0,0 +1,11 @@
1
+ [attr]py-file eol=lf
2
+ *.py py-file
3
+
4
+ .git* export-ignore
5
+ .mailmap export-ignore
6
+ .meta/ export-ignore
7
+ images/ export-ignore
8
+ benchmarks/ export-ignore
9
+ asv.conf.json export-ignore
10
+
11
+ uv.lock linguist-generated=true
@@ -0,0 +1,17 @@
1
+ name: Check
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [main]
7
+ jobs:
8
+ lint:
9
+ name: Lint and Type Check
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v5
14
+ with:
15
+ enable-cache: true
16
+ - name: Run linting and type checking
17
+ run: make lint
@@ -0,0 +1,20 @@
1
+ # Automatically publishes version of the package on tagged release
2
+ name: publish
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: astral-sh/setup-uv@v5
13
+
14
+ - name: Build package
15
+ run: uv build
16
+
17
+ - name: Publish to PyPI
18
+ env:
19
+ PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
20
+ run: uv publish --token $PYPI_TOKEN
@@ -0,0 +1,33 @@
1
+ name: Test
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [main]
7
+ jobs:
8
+ test:
9
+ name: Python ${{ matrix.python-version }} - ${{ matrix.os }}
10
+ runs-on: ${{ matrix.os }}
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ os: [ubuntu-latest, macos-latest, windows-latest]
15
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: astral-sh/setup-uv@v5
19
+ with:
20
+ enable-cache: true
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ run: uv python install ${{ matrix.python-version }}
23
+ - name: Run tests with coverage
24
+ run: make pytest-cov
25
+ - name: Display coverage report
26
+ if: always()
27
+ run: uv run coverage report
28
+ - name: Upload coverage to Codecov
29
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
30
+ uses: codecov/codecov-action@v4
31
+ with:
32
+ file: ./coverage.xml
33
+ token: ${{ secrets.CODECOV_TOKEN }}
tldm-1.0.0/.gitignore ADDED
@@ -0,0 +1,26 @@
1
+ *.py[cod]
2
+ *.so
3
+ __pycache__/
4
+ .ipynb_checkpoints/
5
+
6
+ # Packages
7
+ /tqdm/_dist_ver.py
8
+ /*.egg*/
9
+ /build/
10
+ /dist/
11
+ /snapcraft.yaml
12
+ /tqdm_*.snap
13
+ /.dockerignore
14
+ /Dockerfile
15
+
16
+ # Unit test / coverage reports
17
+ /.tox/
18
+ /.coverage*
19
+ /coverage.xml
20
+ /.pytest_cache/
21
+ /.asv/
22
+
23
+ # Sumbodules
24
+ /wiki/
25
+ /docs/
26
+ /feedstock/
@@ -0,0 +1,9 @@
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "[python]": {
4
+ "editor.defaultFormatter": "charliermarsh.ruff"
5
+ },
6
+ "python-envs.defaultEnvManager": "ms-python.python:venv",
7
+ "python-envs.defaultPackageManager": "ms-python.python:pip",
8
+ "python-envs.pythonProjects": []
9
+ }
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ - Demonstrating empathy and kindness toward other people
21
+ - Being respectful of differing opinions, viewpoints, and experiences
22
+ - Giving and gracefully accepting constructive feedback
23
+ - Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ - Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ - The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ - Trolling, insulting or derogatory comments, and personal or political attacks
33
+ - Public or private harassment
34
+ - Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ - Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ caleb@calebevans.me.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
@@ -0,0 +1,136 @@
1
+ # Contributing to TL;DM
2
+
3
+ Thank you for your interest in contributing to TL;DM! This guide will help you get started with the development workflow.
4
+
5
+ ## Code of Conduct
6
+
7
+ When interacting with other users and maintainers, please be sure to abide by the [Code of Conduct](CODE_OF_CONDUCT.md).
8
+
9
+ ## Submitting an Issue
10
+
11
+ ### Bug Reports
12
+
13
+ If you are submitting a bug report, please answer the following questions:
14
+
15
+ 1. What version of TL;DM were you using?
16
+ 2. What were you doing?
17
+ 3. What did you expect to happen?
18
+ 4. What happened instead?
19
+
20
+ Please provide any code to reproduce the issue, if possible.
21
+
22
+ ### Feature Requests
23
+
24
+ If you are requesting a new feature or change in behavior, please describe what you are looking for, and what value it will add to your use case.
25
+
26
+ ## Modifying the Codebase
27
+
28
+ TL;DM is an open-source project, so you are welcome and encouraged to modify the codebase with new fixes and enhancements. Please observe the following guidelines when submitting pull requests:
29
+
30
+ ### Setting Up Your Environment
31
+
32
+ The dependencies for the project are managed with [uv](https://github.com/astral-sh/uv). For instructions on how to install `uv`, see the [uv documentation](https://docs.astral.sh/uv/getting-started/installation/).
33
+
34
+ To create a virtual environment and install all project dependencies, run:
35
+
36
+ ```bash
37
+ uv sync
38
+ ```
39
+
40
+ ### Code Quality Standards
41
+
42
+ 1. **Code Formatting and Linting**: All code must comply with the enabled ruff lint rules. If you have installed the development dependencies, the `ruff` package will be available with the config in `pyproject.toml`. Run the formatter with:
43
+
44
+ ```bash
45
+ make format
46
+ # or: uv run ruff format src/tldm tests
47
+ ```
48
+
49
+ 2. **Type Checking**: All new code must include type annotations and pass type checking with [mypy](https://mypy.readthedocs.io/en/stable/). Run type checking with:
50
+
51
+ ```bash
52
+ make mypy
53
+ # or: uv run mypy src/tldm/std.py src/tldm/utils.py src/tldm/aliases.py
54
+ ```
55
+
56
+ 3. **Testing**: Whether you are introducing a bug fix or a new feature, you must add tests to verify that your code additions function correctly. Run tests with:
57
+
58
+ ```bash
59
+ make pytest
60
+ # or: uv run pytest
61
+ ```
62
+
63
+ 4. **Code Coverage**: Please ensure your changes are covered by tests. Run tests with coverage:
64
+
65
+ ```bash
66
+ make pytest-cov
67
+ # or: uv run pytest --cov=tldm --cov-report=xml --cov-report=term --cov-report=html
68
+ ```
69
+
70
+ If the coverage report needs detailed review, you can open the HTML coverage report:
71
+
72
+ ```bash
73
+ open htmlcov/index.html # macOS/Linux
74
+ start htmlcov\index.html # Windows
75
+ ```
76
+
77
+ 5. **Documentation**: If you are adding a new feature or changing behavior, please update the documentation appropriately. This includes updating docstrings for all functions in the public interface, using the [NumPy style](https://numpydoc.readthedocs.io/en/latest/format.html).
78
+
79
+ ### Running All Checks
80
+
81
+ You can run all formatting, linting, and tests with a single command:
82
+
83
+ ```bash
84
+ make all
85
+ ```
86
+
87
+ This will:
88
+
89
+ 1. Format code with ruff
90
+ 2. Run linting checks
91
+ 3. Run mypy type checking
92
+ 4. Run pytest with coverage
93
+
94
+ ### Available Make Commands
95
+
96
+ The project includes a Makefile with convenient shortcuts. Run `make help` to see all available commands:
97
+
98
+ - `make format` - Format code with ruff
99
+ - `make lint` - Run ruff linting and mypy type checking
100
+ - `make mypy` - Run mypy type checking only
101
+ - `make pytest` - Run pytest without coverage
102
+ - `make pytest-cov` - Run pytest with coverage reports
103
+ - `make all` - Run formatting, linting, and tests with coverage
104
+ - `make clean` - Clean up build artifacts and cache files
105
+
106
+ ## Pull Request Workflow
107
+
108
+ Contributions to the project are made using the "Fork & Pull" model:
109
+
110
+ 1. Fork the [`tldm`](https://github.com/eliotwrobson/tldm) repository
111
+ 2. Clone your fork locally: `git clone https://github.com/your_account/tldm.git`
112
+ 3. Create a new branch for your changes: `git checkout -b my-feature-branch`
113
+ 4. Make your changes on the local copy
114
+ 5. Ensure all tests pass and code is formatted: `make all`
115
+ 6. Commit your changes: `git commit -m "Description of changes"`
116
+ 7. Push to your GitHub fork: `git push origin my-feature-branch`
117
+ 8. Create a Pull Request from your GitHub fork (go to your fork's webpage and click "Pull Request")
118
+
119
+ ### Before Submitting a Pull Request
120
+
121
+ Please ensure:
122
+
123
+ - All tests pass locally
124
+ - Code is properly formatted (run `make format`)
125
+ - Type checking passes (run `make mypy`)
126
+ - Your changes include appropriate tests
127
+ - Documentation is updated if needed
128
+
129
+ ## Questions or Issues?
130
+
131
+ If you have questions or run into issues while contributing, feel free to:
132
+
133
+ - Open an issue on [GitHub](https://github.com/eliotwrobson/tldm/issues)
134
+ - Check existing issues and pull requests for similar discussions
135
+
136
+ Thank you for contributing to TL;DM!