pkstruct 0.1.0__tar.gz → 0.1.2__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.
- pkstruct-0.1.2/.github/ISSUE_TEMPLATE/bug_report.md +46 -0
- pkstruct-0.1.2/.github/ISSUE_TEMPLATE/config.yml +8 -0
- pkstruct-0.1.2/.github/ISSUE_TEMPLATE/feature_request.md +37 -0
- pkstruct-0.1.2/.github/pull_request_template.md +29 -0
- pkstruct-0.1.2/.gitignore +218 -0
- pkstruct-0.1.2/CHANGELOG.md +60 -0
- pkstruct-0.1.2/CODE_OF_CONDUCT.md +113 -0
- pkstruct-0.1.2/CONTRIBUTING.md +133 -0
- pkstruct-0.1.2/MAINTAINERS.md +62 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/MANIFEST.in +2 -0
- pkstruct-0.1.2/PKG-INFO +788 -0
- pkstruct-0.1.2/README.md +727 -0
- pkstruct-0.1.2/pyproject.toml +126 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/__init__.py +90 -20
- pkstruct-0.1.2/src/pkstruct/_display.py +12 -0
- pkstruct-0.1.2/src/pkstruct/_help.py +116 -0
- pkstruct-0.1.2/src/pkstruct/_linear_shortcuts.py +28 -0
- pkstruct-0.1.2/src/pkstruct/_str.py +34 -0
- pkstruct-0.1.2/src/pkstruct/_tree_shortcuts.py +105 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/__init__.py +1 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/connectivity.py +2 -11
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/directed.py +12 -1
- pkstruct-0.1.2/src/pkstruct/graphs/graph.py +484 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/mst.py +1 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/scc.py +1 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/shortest_path.py +1 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/tests/test_graph.py +15 -16
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/tests/test_graph_advanced.py +16 -18
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/topo_sort.py +2 -2
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/traversal.py +0 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/visualization.py +0 -3
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/weighted.py +10 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/__init__.py +1 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/deques/linked_deque.py +48 -3
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/linked_lists/_base.py +86 -12
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/linked_lists/circular_linked_list.py +11 -3
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/linked_lists/doubly_linked_list.py +8 -2
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/linked_lists/singly_linked_list.py +99 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/queues/circular_queue.py +48 -4
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/queues/linked_queue.py +71 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/queues/priority_queue.py +71 -6
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/stacks/array_stack.py +102 -3
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/stacks/linked_stack.py +38 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/__init__.py +1 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/avl.py +26 -12
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/bplus.py +67 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/bst.py +142 -107
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/btree.py +75 -1
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/exceptions.py +4 -2
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/fenwick_tree.py +85 -6
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/interval_tree.py +68 -2
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/red_black.py +148 -118
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/segment_tree.py +88 -5
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/tests/test_bst.py +14 -15
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/tree_helpers.py +38 -10
- pkstruct-0.1.2/src/pkstruct/trees/visualization/__init__.py +0 -0
- pkstruct-0.1.0/.gitignore +0 -0
- pkstruct-0.1.0/CHANGELOG.md +0 -23
- pkstruct-0.1.0/PKG-INFO +0 -482
- pkstruct-0.1.0/README.md +0 -428
- pkstruct-0.1.0/pkstruct_test_env/Scripts/py.test.exe +0 -0
- pkstruct-0.1.0/pkstruct_test_env/Scripts/pygmentize.exe +0 -0
- pkstruct-0.1.0/pkstruct_test_env/Scripts/pytest.exe +0 -0
- pkstruct-0.1.0/pkstruct_test_env/Scripts/python.exe +0 -0
- pkstruct-0.1.0/pkstruct_test_env/Scripts/pythonw.exe +0 -0
- pkstruct-0.1.0/pkstruct_test_env/pyvenv.cfg +0 -3
- pkstruct-0.1.0/pyproject.toml +0 -73
- pkstruct-0.1.0/requirements-dev.txt +0 -9
- pkstruct-0.1.0/src/pkstruct/graphs/graph.py +0 -262
- pkstruct-0.1.0/testing_final.py +0 -1148
- {pkstruct-0.1.0 → pkstruct-0.1.2}/LICENSE +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/SECURITY.md +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/exceptions.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/graphs/tests/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/deques/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/deques/deque.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/exceptions.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/linked_lists/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/linked_lists/nodes.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/queues/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/queues/queue.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/stacks/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/stacks/stack.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/tests/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/tests/test_edge_cases.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/tests/test_linked_list.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/tests/test_visualization.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/utils/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/utils/benchmark.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/utils/debug_tools.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/utils/helpers.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/utils/iterators.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/visualization/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/visualization/ascii_visualizer.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/linear/visualization/linked_list_visualizer.py +0 -0
- /pkstruct-0.1.0/src/pkstruct/trees/visualization/__init__.py → /pkstruct-0.1.2/src/pkstruct/py.typed +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/shared/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/shared/benchmarking/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/shared/debugging/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/shared/exceptions/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/shared/serializers/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/shared/threading/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/shared/validators/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/shared/visualization/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/balancing.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/node.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/tests/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/tests/test_avl.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/tests/test_bplus.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/tests/test_btree.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/tests/test_fenwick_tree.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/tests/test_interval_tree.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/tests/test_red_black.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/tests/test_segment_tree.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/traversal.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/utils/__init__.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/utils/complexity_helpers.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/visualization/ascii_renderer.py +0 -0
- {pkstruct-0.1.0 → pkstruct-0.1.2}/src/pkstruct/trees/visualization/tree_printer.py +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Create a report to help us improve pkstruct
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Description
|
|
10
|
+
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
## Reproduction
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
# Minimal, runnable code that reproduces the issue
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Expected Behavior
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
# What you expected to happen
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Actual Behavior
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
# What actually happened (include full error output)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Environment
|
|
32
|
+
|
|
33
|
+
- Python version:
|
|
34
|
+
- OS:
|
|
35
|
+
- pkstruct version (pip show pkstruct):
|
|
36
|
+
- Installed via: (pip / pipx / from source)
|
|
37
|
+
|
|
38
|
+
## Additional Context
|
|
39
|
+
|
|
40
|
+
Add any other context, screenshots, or ASCII visualizations here.
|
|
41
|
+
|
|
42
|
+
## Checklist
|
|
43
|
+
|
|
44
|
+
- [ ] I searched existing issues before filing this report
|
|
45
|
+
- [ ] I am running the latest pkstruct version
|
|
46
|
+
- [ ] This is a pkstruct bug, not a usage question
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
blank_issues_enabled: true
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: Questions & Discussions
|
|
4
|
+
url: https://github.com/prnvvv/pkstruct/discussions
|
|
5
|
+
about: Ask usage questions and discuss ideas here
|
|
6
|
+
- name: Security Issues
|
|
7
|
+
url: https://github.com/prnvvv/pkstruct/security/policy
|
|
8
|
+
about: Report security vulnerabilities here (do not open a public issue)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature Request
|
|
3
|
+
about: Suggest an idea for pkstruct
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Problem
|
|
10
|
+
|
|
11
|
+
A clear description of what problem this feature would solve.
|
|
12
|
+
Ex: I'm always frustrated when [...]
|
|
13
|
+
|
|
14
|
+
## Proposed Solution
|
|
15
|
+
|
|
16
|
+
A clear description of what you want to happen, including API design if applicable.
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
# Optional: sketch of the API you envision
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Alternatives
|
|
23
|
+
|
|
24
|
+
Any alternative solutions or workarounds you've considered.
|
|
25
|
+
|
|
26
|
+
## Scope
|
|
27
|
+
|
|
28
|
+
- [ ] New data structure
|
|
29
|
+
- [ ] New algorithm / method
|
|
30
|
+
- [ ] Performance improvement
|
|
31
|
+
- [ ] Documentation
|
|
32
|
+
- [ ] Testing
|
|
33
|
+
- [ ] Other (describe below)
|
|
34
|
+
|
|
35
|
+
## Additional Context
|
|
36
|
+
|
|
37
|
+
Any other context, references, or examples.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
Please include a summary of the changes and which issue is fixed.
|
|
4
|
+
|
|
5
|
+
Fixes #(issue)
|
|
6
|
+
|
|
7
|
+
## Type of Change
|
|
8
|
+
|
|
9
|
+
- [ ] Bug fix (non-breaking change)
|
|
10
|
+
- [ ] New feature (non-breaking change)
|
|
11
|
+
- [ ] Breaking change (fix or feature that changes existing API)
|
|
12
|
+
- [ ] Documentation update
|
|
13
|
+
- [ ] Performance improvement
|
|
14
|
+
- [ ] Test addition/improvement
|
|
15
|
+
- [ ] CI/infrastructure change
|
|
16
|
+
|
|
17
|
+
## Checklist
|
|
18
|
+
|
|
19
|
+
- [ ] Code follows project style (ruff passes)
|
|
20
|
+
- [ ] Type hints added/updated (mypy passes)
|
|
21
|
+
- [ ] Tests added/updated for new code
|
|
22
|
+
- [ ] All existing tests pass (`python -m pytest`)
|
|
23
|
+
- [ ] CHANGELOG.md updated for user-facing changes
|
|
24
|
+
- [ ] Documentation updated if API changed
|
|
25
|
+
- [ ] I have read the CONTRIBUTING.md guide
|
|
26
|
+
|
|
27
|
+
## Additional Notes
|
|
28
|
+
|
|
29
|
+
Any additional context, benchmark results, or design decisions.
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# ==========================================
|
|
2
|
+
# Python
|
|
3
|
+
# ==========================================
|
|
4
|
+
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.pyc
|
|
7
|
+
*.pyo
|
|
8
|
+
*.py[cod]
|
|
9
|
+
*$py.class
|
|
10
|
+
|
|
11
|
+
# Compiled extensions
|
|
12
|
+
*.so
|
|
13
|
+
*.pyd
|
|
14
|
+
*.dll
|
|
15
|
+
|
|
16
|
+
# Distribution / packaging
|
|
17
|
+
.Python
|
|
18
|
+
build/
|
|
19
|
+
dist/
|
|
20
|
+
downloads/
|
|
21
|
+
develop-eggs/
|
|
22
|
+
eggs/
|
|
23
|
+
.eggs/
|
|
24
|
+
lib/
|
|
25
|
+
lib64/
|
|
26
|
+
parts/
|
|
27
|
+
sdist/
|
|
28
|
+
var/
|
|
29
|
+
wheels/
|
|
30
|
+
share/python-wheels/
|
|
31
|
+
*.egg-info/
|
|
32
|
+
.installed.cfg
|
|
33
|
+
*.egg
|
|
34
|
+
*.whl
|
|
35
|
+
MANIFEST
|
|
36
|
+
*.manifest
|
|
37
|
+
*.spec
|
|
38
|
+
|
|
39
|
+
# PyPI / packaging tools
|
|
40
|
+
pip-wheel-metadata/
|
|
41
|
+
pip-log.txt
|
|
42
|
+
pip-delete-this-directory.txt
|
|
43
|
+
|
|
44
|
+
# ==========================================
|
|
45
|
+
# Virtual Environments
|
|
46
|
+
# ==========================================
|
|
47
|
+
|
|
48
|
+
venv/
|
|
49
|
+
env/
|
|
50
|
+
ENV/
|
|
51
|
+
.venv/
|
|
52
|
+
|
|
53
|
+
# ==========================================
|
|
54
|
+
# Testing / Coverage
|
|
55
|
+
# ==========================================
|
|
56
|
+
|
|
57
|
+
.pytest_cache/
|
|
58
|
+
.benchmarks/
|
|
59
|
+
.coverage
|
|
60
|
+
.coverage.*
|
|
61
|
+
coverage/
|
|
62
|
+
coverage.xml
|
|
63
|
+
htmlcov/
|
|
64
|
+
*.cover
|
|
65
|
+
*.py,cover
|
|
66
|
+
.tox/
|
|
67
|
+
.nox/
|
|
68
|
+
|
|
69
|
+
# Benchmark / profiling outputs
|
|
70
|
+
*.prof
|
|
71
|
+
|
|
72
|
+
# ==========================================
|
|
73
|
+
# Type Checking / Linting
|
|
74
|
+
# ==========================================
|
|
75
|
+
|
|
76
|
+
.mypy_cache/
|
|
77
|
+
.pyre/
|
|
78
|
+
.pytype/
|
|
79
|
+
.ruff_cache/
|
|
80
|
+
.dmypy.json
|
|
81
|
+
dmypy.json
|
|
82
|
+
|
|
83
|
+
# Property-based testing cache
|
|
84
|
+
.hypothesis/
|
|
85
|
+
|
|
86
|
+
# Merge conflict artifacts
|
|
87
|
+
*.orig
|
|
88
|
+
*.patch
|
|
89
|
+
|
|
90
|
+
# Node.js (for any JS tooling)
|
|
91
|
+
node_modules/
|
|
92
|
+
|
|
93
|
+
# pyenv
|
|
94
|
+
.python-version
|
|
95
|
+
|
|
96
|
+
# Jupyter
|
|
97
|
+
# ==========================================
|
|
98
|
+
|
|
99
|
+
.ipynb_checkpoints/
|
|
100
|
+
|
|
101
|
+
# ==========================================
|
|
102
|
+
# IDE / Editor
|
|
103
|
+
.vscode/
|
|
104
|
+
.idea/
|
|
105
|
+
*.swp
|
|
106
|
+
*.swo
|
|
107
|
+
*~
|
|
108
|
+
.project
|
|
109
|
+
.pydevproject
|
|
110
|
+
.settings/
|
|
111
|
+
*.code-workspace
|
|
112
|
+
|
|
113
|
+
# macOS
|
|
114
|
+
.DS_Store
|
|
115
|
+
|
|
116
|
+
# Windows
|
|
117
|
+
Thumbs.db
|
|
118
|
+
desktop.ini
|
|
119
|
+
|
|
120
|
+
# ==========================================
|
|
121
|
+
# Logs
|
|
122
|
+
# ==========================================
|
|
123
|
+
|
|
124
|
+
*.log
|
|
125
|
+
|
|
126
|
+
# ==========================================
|
|
127
|
+
# Environment Variables
|
|
128
|
+
# ==========================================
|
|
129
|
+
|
|
130
|
+
.env
|
|
131
|
+
.env.*
|
|
132
|
+
|
|
133
|
+
# ==========================================
|
|
134
|
+
# Documentation Builds
|
|
135
|
+
# ==========================================
|
|
136
|
+
|
|
137
|
+
docs/_build/
|
|
138
|
+
site/
|
|
139
|
+
|
|
140
|
+
# ==========================================
|
|
141
|
+
# MkDocs / Sphinx
|
|
142
|
+
# ==========================================
|
|
143
|
+
|
|
144
|
+
*.doctree
|
|
145
|
+
|
|
146
|
+
# ==========================================
|
|
147
|
+
# Temporary Files
|
|
148
|
+
# ==========================================
|
|
149
|
+
|
|
150
|
+
*.tmp
|
|
151
|
+
*.temp
|
|
152
|
+
*.bak
|
|
153
|
+
|
|
154
|
+
# ==========================================
|
|
155
|
+
# Package-specific
|
|
156
|
+
# ==========================================
|
|
157
|
+
|
|
158
|
+
# Generated benchmark results
|
|
159
|
+
benchmarks/results/
|
|
160
|
+
|
|
161
|
+
# Local experiment scripts
|
|
162
|
+
experiments/
|
|
163
|
+
|
|
164
|
+
# Local datasets
|
|
165
|
+
data/
|
|
166
|
+
|
|
167
|
+
# Local test environment (virtual env)
|
|
168
|
+
pkstruct_test_env/
|
|
169
|
+
|
|
170
|
+
# Manual visual test script
|
|
171
|
+
testing_final.py
|
|
172
|
+
|
|
173
|
+
# Scratch / experimentation
|
|
174
|
+
*.scratch
|
|
175
|
+
|
|
176
|
+
# Scratch / experimentation
|
|
177
|
+
eg.py
|
|
178
|
+
manual_test.py
|
|
179
|
+
dsa_testing.py
|
|
180
|
+
|
|
181
|
+
# pytest speedup files (generated by pytest-xdist)
|
|
182
|
+
*.pytest_cache/
|
|
183
|
+
|
|
184
|
+
# Cython debug
|
|
185
|
+
cython_debug/
|
|
186
|
+
|
|
187
|
+
# ==========================================
|
|
188
|
+
# Optional: Ignore generated lock files
|
|
189
|
+
# Uncomment if needed
|
|
190
|
+
|
|
191
|
+
# poetry.lock
|
|
192
|
+
# Pipfile.lock
|
|
193
|
+
|
|
194
|
+
# ==========================================
|
|
195
|
+
# OS-specific
|
|
196
|
+
# ==========================================
|
|
197
|
+
*.pyproj
|
|
198
|
+
*.sln
|
|
199
|
+
*.suo
|
|
200
|
+
*.user
|
|
201
|
+
*.userosscache
|
|
202
|
+
*.userprefs
|
|
203
|
+
.vs/
|
|
204
|
+
|
|
205
|
+
# ==========================================
|
|
206
|
+
# Package build artifacts
|
|
207
|
+
# ==========================================
|
|
208
|
+
*.tar.gz
|
|
209
|
+
PKSTRUCT-INFO
|
|
210
|
+
|
|
211
|
+
# ==========================================
|
|
212
|
+
# Development artifacts
|
|
213
|
+
# ==========================================
|
|
214
|
+
*.history
|
|
215
|
+
AGENTS.md
|
|
216
|
+
requirements-dev.txt
|
|
217
|
+
|
|
218
|
+
.gitlab-ci.yml
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to pkstruct will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.2] - 2026-06-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- CONTRIBUTING.md, CODE_OF_CONDUCT.md, MAINTAINERS.md with project governance
|
|
12
|
+
- Issue templates (bug report, feature request) and PR template
|
|
13
|
+
- `py.typed` marker already present for PEP 561 compliance
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- README restructured: added "Why pkstruct?" section, removed maintainer-only publishing docs
|
|
17
|
+
- pyproject.toml: updated author list with founders, expanded keywords, added classifiers
|
|
18
|
+
- Badge URLs fixed to match `prnvvv/pkstruct` repository
|
|
19
|
+
|
|
20
|
+
### Removed
|
|
21
|
+
- AGENTS.md and requirements-dev.txt removed from repository (gitignored)
|
|
22
|
+
- .github/ removed from .gitignore so templates are tracked
|
|
23
|
+
|
|
24
|
+
## [0.1.1] - 2026-06-02
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- `__bool__` to all tree types (BST, RedBlack, BTree, BPlus, Interval, Segment, Fenwick) and Graph
|
|
28
|
+
- `__iter__` to SegmentTree, FenwickTree
|
|
29
|
+
- `__contains__` to all 6 linear adapters (ArrayStack, LinkedStack, LinkedQueue, CircularQueue, PriorityQueue, LinkedDeque), SegmentTree, FenwickTree
|
|
30
|
+
- `copy()` to BTree, BPlusTree, IntervalTree, SegmentTree, FenwickTree
|
|
31
|
+
- `validate()`, `to_list()`, `from_list()` to Graph (inherited by DirectedGraph, WeightedGraph)
|
|
32
|
+
- `HelpMixin` to all 6 linear adapters
|
|
33
|
+
- Side validation in `LinkedDeque.append()`, `LinkedDeque.pop()`, `LinkedDeque.peek()`
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
- BST/AVL `serialize()` now encodes each node as a `[key, value]` pair to prevent data loss on round-trip
|
|
37
|
+
- BST/AVL `deserialize()` handles both new `[key, value]` and legacy bare-key formats
|
|
38
|
+
- BTree/BPlusTree use `InvalidOrderError` instead of `ValueError` in `__init__`
|
|
39
|
+
- `module_help()` raises `ValueError` for invalid targets instead of silently returning `""`
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
- BST/AVL serialization no longer silently drops values during round-trip
|
|
43
|
+
- README `str(sll)` example corrected from `"1 2 3"` to `"[1, 2, 3]"`
|
|
44
|
+
|
|
45
|
+
## [0.1.0] - 2026-06-01
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
- `pkstruct.linear` module with `SinglyLinkedList`, `DoublyLinkedList`, `CircularLinkedList`
|
|
49
|
+
- Full CRUD operations: `insert`, `delete`, `get`, `replace`, `extend`, `clear`
|
|
50
|
+
- Algorithmic operations: `sort`, `merge`, `partition`, `reverse`, `rotate`, `swap`
|
|
51
|
+
- Interview problems: `detect_cycle`, `intersection_node`, `palindrome`, `reorder`, `segregate_even_odd`
|
|
52
|
+
- Serialization: `from_list`, `from_json`, `to_list`, `copy`
|
|
53
|
+
- ASCII visualization with `visualize()` and `debug()` introspection
|
|
54
|
+
- Thread-safe operations via `RLock`
|
|
55
|
+
- Custom exception hierarchy via `pkstruct.linear.exceptions`
|
|
56
|
+
- Shared subsystem (`pkstruct.shared`) for validators, serializers, threading, benchmarking
|
|
57
|
+
- Full pytest suite with edge cases, randomization, and threading tests
|
|
58
|
+
- Benchmark suite comparing against `list` and `collections.deque`
|
|
59
|
+
- Type annotations, mypy strict compliance
|
|
60
|
+
- PyPI-ready packaging with `hatchling`
|
|
@@ -0,0 +1,113 @@
|
|
|
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:
|
|
18
|
+
|
|
19
|
+
* Demonstrating empathy and kindness toward other people
|
|
20
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
21
|
+
* Giving and gracefully accepting constructive feedback
|
|
22
|
+
* Accepting responsibility and apologizing to those affected by our mistakes
|
|
23
|
+
* Focusing on what is best for the overall community
|
|
24
|
+
|
|
25
|
+
Examples of unacceptable behavior:
|
|
26
|
+
|
|
27
|
+
* The use of sexualized language or imagery, and sexual attention or advances
|
|
28
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
29
|
+
* Public or private harassment
|
|
30
|
+
* Publishing others' private information without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate
|
|
32
|
+
|
|
33
|
+
## Enforcement Responsibilities
|
|
34
|
+
|
|
35
|
+
Community leaders are responsible for clarifying and enforcing our standards.
|
|
36
|
+
They have the right and responsibility to remove, edit, or reject comments,
|
|
37
|
+
commits, code, wiki edits, issues, and other contributions that are not
|
|
38
|
+
aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
39
|
+
decisions when appropriate.
|
|
40
|
+
|
|
41
|
+
## Scope
|
|
42
|
+
|
|
43
|
+
This Code of Conduct applies within all community spaces, and also applies
|
|
44
|
+
when an individual is representing the community in public spaces.
|
|
45
|
+
|
|
46
|
+
## Enforcement
|
|
47
|
+
|
|
48
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
49
|
+
reported to the community leaders responsible for enforcement at
|
|
50
|
+
**conduct@pkstruct.dev**. All complaints will be reviewed and investigated
|
|
51
|
+
promptly and fairly.
|
|
52
|
+
|
|
53
|
+
All community leaders are obligated to respect the privacy and security of
|
|
54
|
+
the reporter of any incident.
|
|
55
|
+
|
|
56
|
+
## Enforcement Guidelines
|
|
57
|
+
|
|
58
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
59
|
+
consequences for any action they deem in violation of this Code of Conduct:
|
|
60
|
+
|
|
61
|
+
### 1. Correction
|
|
62
|
+
|
|
63
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
64
|
+
unprofessional or unwelcome.
|
|
65
|
+
|
|
66
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
67
|
+
clarity around the nature of the violation and an explanation of why the
|
|
68
|
+
behavior was inappropriate. A public apology may be requested.
|
|
69
|
+
|
|
70
|
+
### 2. Warning
|
|
71
|
+
|
|
72
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
73
|
+
|
|
74
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
75
|
+
interaction with the people involved for a specified period of time. This
|
|
76
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
77
|
+
like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
78
|
+
|
|
79
|
+
### 3. Temporary Ban
|
|
80
|
+
|
|
81
|
+
**Community Impact**: A serious violation of community standards.
|
|
82
|
+
|
|
83
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
84
|
+
communication with the community for a specified period of time. No public or
|
|
85
|
+
private interaction with the people involved is allowed during this period.
|
|
86
|
+
Violating these terms may lead to a permanent ban.
|
|
87
|
+
|
|
88
|
+
### 4. Permanent Ban
|
|
89
|
+
|
|
90
|
+
**Community Impact**: Demonstrating a pattern of violation, sustained
|
|
91
|
+
harassment, or aggression toward individuals or classes of individuals.
|
|
92
|
+
|
|
93
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
94
|
+
the community.
|
|
95
|
+
|
|
96
|
+
## Attribution
|
|
97
|
+
|
|
98
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
99
|
+
version 2.1, available at
|
|
100
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
101
|
+
|
|
102
|
+
Community Impact Guidelines were inspired by
|
|
103
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
104
|
+
|
|
105
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
106
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
107
|
+
[https://www.contributor-covenant.org/translations][translations].
|
|
108
|
+
|
|
109
|
+
[homepage]: https://www.contributor-covenant.org
|
|
110
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
111
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
112
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
113
|
+
[translations]: https://www.contributor-covenant.org/translations
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Contributing to pkstruct
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to pkstruct! This document provides guidelines and instructions for contributing.
|
|
4
|
+
|
|
5
|
+
## Code of Conduct
|
|
6
|
+
|
|
7
|
+
By participating, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md). Please report unacceptable behavior.
|
|
8
|
+
|
|
9
|
+
## How to Contribute
|
|
10
|
+
|
|
11
|
+
### Reporting Bugs
|
|
12
|
+
|
|
13
|
+
1. Search [existing issues](https://github.com/prnvvv/pkstruct/issues) to avoid duplicates.
|
|
14
|
+
2. Use the **Bug Report** issue template.
|
|
15
|
+
3. Include:
|
|
16
|
+
- Python version and OS
|
|
17
|
+
- Minimal reproduction code
|
|
18
|
+
- Expected vs actual behavior
|
|
19
|
+
- Full error output if applicable
|
|
20
|
+
|
|
21
|
+
### Suggesting Features
|
|
22
|
+
|
|
23
|
+
1. Search [existing issues](https://github.com/prnvvv/pkstruct/issues) first.
|
|
24
|
+
2. Use the **Feature Request** issue template.
|
|
25
|
+
3. Explain the use case and why it belongs in pkstruct.
|
|
26
|
+
|
|
27
|
+
### Questions
|
|
28
|
+
|
|
29
|
+
Use the **Question** issue template or start a [Discussion](https://github.com/prnvvv/pkstruct/discussions).
|
|
30
|
+
|
|
31
|
+
## Development Setup
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git clone https://github.com/prnvvv/pkstruct.git
|
|
35
|
+
cd pkstruct
|
|
36
|
+
pip install -e ".[dev]"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Coding Standards
|
|
40
|
+
|
|
41
|
+
- **Python**: >= 3.10
|
|
42
|
+
- **Type hints**: Required for all public APIs. Run `mypy src/pkstruct` — no errors allowed.
|
|
43
|
+
- **Style**: Run `ruff check src/pkstruct` — no violations allowed.
|
|
44
|
+
- **Line length**: 100 characters.
|
|
45
|
+
- **Imports**: Use Ruff's import ordering (`I` rule set).
|
|
46
|
+
|
|
47
|
+
### Rules
|
|
48
|
+
|
|
49
|
+
- No `eval()` or `exec()`.
|
|
50
|
+
- All mutable state must be protected by `threading.RLock`.
|
|
51
|
+
- Public API methods must have type annotations and docstrings.
|
|
52
|
+
- Internal/private methods prefixed with `_`.
|
|
53
|
+
|
|
54
|
+
## Testing
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Run all tests
|
|
58
|
+
python -m pytest
|
|
59
|
+
|
|
60
|
+
# Run with coverage
|
|
61
|
+
python -m pytest --cov=src/pkstruct
|
|
62
|
+
|
|
63
|
+
# Run specific test file
|
|
64
|
+
python -m pytest src/pkstruct/linear/tests/test_linked_list.py
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- All new code must include tests.
|
|
68
|
+
- Tests should cover normal paths, edge cases, and error conditions.
|
|
69
|
+
- Test files go in the corresponding `tests/` directory.
|
|
70
|
+
|
|
71
|
+
## Pull Request Process
|
|
72
|
+
|
|
73
|
+
1. **Create an issue** first for bugs or feature requests (unless trivial).
|
|
74
|
+
2. **Fork the repository** and create a branch from `main`:
|
|
75
|
+
```
|
|
76
|
+
git checkout -b fix/issue-42-description
|
|
77
|
+
```
|
|
78
|
+
3. **Make your changes** following the coding standards.
|
|
79
|
+
4. **Run tests** locally to ensure nothing is broken.
|
|
80
|
+
5. **Run type checks** with `mypy src/pkstruct`.
|
|
81
|
+
6. **Run linter** with `ruff check src/pkstruct`.
|
|
82
|
+
7. **Commit** with a clear message:
|
|
83
|
+
```
|
|
84
|
+
feat: add range_update to SegmentTree
|
|
85
|
+
fix: handle empty list in SinglyLinkedList.sort
|
|
86
|
+
docs: update README examples
|
|
87
|
+
```
|
|
88
|
+
8. **Push** and open a Pull Request.
|
|
89
|
+
9. **Address review feedback** promptly.
|
|
90
|
+
|
|
91
|
+
## Pull Request Checklist
|
|
92
|
+
|
|
93
|
+
- [ ] Code follows style guidelines
|
|
94
|
+
- [ ] Type hints added/updated
|
|
95
|
+
- [ ] Tests added/updated
|
|
96
|
+
- [ ] All tests pass
|
|
97
|
+
- [ ] mypy passes with no errors
|
|
98
|
+
- [ ] ruff passes with no violations
|
|
99
|
+
- [ ] CHANGELOG.md updated (if user-facing change)
|
|
100
|
+
- [ ] Documentation updated (if API change)
|
|
101
|
+
|
|
102
|
+
## Review Expectations
|
|
103
|
+
|
|
104
|
+
- Maintainers review within 5 business days.
|
|
105
|
+
- Changes may be requested — this is normal.
|
|
106
|
+
- Two approving reviews required for significant changes.
|
|
107
|
+
|
|
108
|
+
## Project Structure
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
src/pkstruct/
|
|
112
|
+
├── __init__.py # Package root, registry, help()
|
|
113
|
+
├── linear/ # Linked lists, stacks, queues, deques
|
|
114
|
+
│ ├── linked_lists/
|
|
115
|
+
│ ├── stacks/
|
|
116
|
+
│ ├── queues/
|
|
117
|
+
│ ├── deques/
|
|
118
|
+
│ ├── tests/
|
|
119
|
+
│ ├── utils/
|
|
120
|
+
│ └── visualization/
|
|
121
|
+
├── trees/ # BST, AVL, Red-Black, B-Tree, Fenwick, Segment, Interval
|
|
122
|
+
│ ├── tests/
|
|
123
|
+
│ └── visualization/
|
|
124
|
+
├── graphs/ # Graph, DirectedGraph, algorithms
|
|
125
|
+
│ └── tests/
|
|
126
|
+
└── shared/ # Validators, serializers, threading, benchmarking
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Getting Help
|
|
130
|
+
|
|
131
|
+
- Open a [Discussion](https://github.com/prnvvv/pkstruct/discussions)
|
|
132
|
+
- Ask in issue comments
|
|
133
|
+
- Tag `@prnvvv` for maintainer attention
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Maintainer Guide
|
|
2
|
+
|
|
3
|
+
This document is for maintainers and release managers of pkstruct.
|
|
4
|
+
|
|
5
|
+
## Project Leadership
|
|
6
|
+
|
|
7
|
+
- **Founder & Maintainer**: [Prannavakhanth](https://github.com/prnvvv) — prannavakhanth12@gmail.com
|
|
8
|
+
- **Co-Founder & Maintainer**: [Priyanka Kaliraj](https://github.com/pri-23-k) — pri2303k@gmail.com
|
|
9
|
+
|
|
10
|
+
## Publishing a Release
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# 1. Clean any previous builds
|
|
14
|
+
rm -rf dist/
|
|
15
|
+
|
|
16
|
+
# 2. Build distribution packages
|
|
17
|
+
python -m build
|
|
18
|
+
|
|
19
|
+
# 3. Verify distribution
|
|
20
|
+
twine check dist/*
|
|
21
|
+
|
|
22
|
+
# 4. Upload to PyPI
|
|
23
|
+
twine upload dist/*
|
|
24
|
+
|
|
25
|
+
# 5. Tag the release
|
|
26
|
+
git tag v$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
|
27
|
+
git push origin --tags
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Before a Release
|
|
31
|
+
|
|
32
|
+
- [ ] All tests pass: `python -m pytest`
|
|
33
|
+
- [ ] Type check passes: `mypy src/pkstruct`
|
|
34
|
+
- [ ] Lint passes: `ruff check src/pkstruct`
|
|
35
|
+
- [ ] CHANGELOG.md is up to date
|
|
36
|
+
- [ ] Version is bumped in `pyproject.toml`
|
|
37
|
+
- [ ] README example code is verified against release
|
|
38
|
+
|
|
39
|
+
## Versioning
|
|
40
|
+
|
|
41
|
+
pkstruct follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html):
|
|
42
|
+
|
|
43
|
+
- **Patch** (`0.1.0` → `0.1.1`): Bug fixes, minor improvements, no breaking API changes.
|
|
44
|
+
- **Minor** (`0.1.0` → `0.2.0`): New features, deprecations, no breaking API changes (once stable).
|
|
45
|
+
- **Major** (`1.0.0`): Breaking API changes.
|
|
46
|
+
|
|
47
|
+
## Managing Issues
|
|
48
|
+
|
|
49
|
+
- Apply appropriate labels: `bug`, `enhancement`, `question`, `good first issue`.
|
|
50
|
+
- Respond to new issues within 48 hours.
|
|
51
|
+
- Close resolved issues with a comment linking to the PR.
|
|
52
|
+
|
|
53
|
+
## Managing Pull Requests
|
|
54
|
+
|
|
55
|
+
- Review within 5 business days.
|
|
56
|
+
- Ensure all CI checks pass before merging.
|
|
57
|
+
- Use **Squash and Merge** for feature branches.
|
|
58
|
+
- Update CHANGELOG.md when merging user-facing changes.
|
|
59
|
+
|
|
60
|
+
## Security Vulnerabilities
|
|
61
|
+
|
|
62
|
+
See [SECURITY.md](SECURITY.md) for the reporting process.
|