PASS+: A Pattern-Aware Stratified Sorting algorithm for accelerated sorting of numerical data.
Project description
Explanation of Files and Folders:
pass_plus_package/ (Root Directory): The main project folder.
pass_plus_sort/ (Package Directory): This is the actual Python package. The original name pass is a reserved keyword in Python and cannot be used for an importable package.
__init__.py: This file is crucial. It tells Python that the pass_plus_sort directory should be treated as a package. It can also be used to define what gets imported when someone does from pass_plus_sort import *. For example, you might put from .core import PASSPlusSort here.
core.py: Your main PASSPlusSort class and the high-level orchestration of the algorithm.
modules.py: All the individual phases and their classes (StatProfiler, ReservoirSampler, PatternDetector, AdaptiveBucketizer, LocalizedSortingStrategy, ParallelSorter, RollingWindowFixer).
specialized_sorts.py: Contains BitBucketSorter and FormulaSorts classes.
utils.py: All your general helper functions and traditional sorting algorithms (quick_sort, merge_sort, heap_sort, radix_sort, tim_sort).
main.py (Optional): If you want to make your package executable directly (e.g., python -m pass_plus_sort), put the run_comprehensive_test_pass_plus() call or a command-line interface logic here.
tests/: Contains all your unit tests. Using a testing framework like pytest is highly recommended.
benchmark/: Separates your benchmarking code from the core algorithm, but allows it to import the core.
setup.py: The most important file for package distribution. It describes your project and how to install it using setuptools.
README.md: A markdown file explaining what your project is, how to install it, how to use it, and its features.
LICENSE: Specifies the licensing terms for your code.
pass_plus_package/ ├── pass_plus_sort/ │ ├── init.py │ ├── core.py # Contains PASSPlusSort class and main algorithm logic │ ├── modules.py # Contains StatProfiler, ReservoirSampler, PatternDetector, etc. │ ├── specialized_sorts.py # Contains BitBucketSorter, FormulaSorts │ ├── utils.py # Contains helper functions like quick_sort, merge_sort, etc. │ └── main.py # Optional: for running the package directly ├── tests/ │ ├── test_pass_plus.py # Unit tests for your algorithms ├── benchmark/ │ ├── init.py │ └── run_benchmark.py # Contains the SortingBenchmark class and data generation ├── setup.py # Installation script ├── README.md # Project description └── LICENSE # License file (e.g., MIT, Apache 2.0)
Running Benchmarks/Tests:
Make sure pandas, matplotlib, seaborn are installed (e.g., pip install -e ".[benchmark]" to install optional benchmark dependencies).
From the pass_plus_package root, you can run your benchmark:
python benchmark/run_benchmark.py
Or, if you put the run_comprehensive_test_pass_plus() call in pass_plus_sort/main.py:
python -m pass_plus_sort
For tests, if using pytest:
pip install pytest
pytest tests/
- Distribution (Optional, for PyPI) If you want to share your package publicly on PyPI (the Python Package Index), you would typically:
Install build and twine:
Bash
pip install build twine Build your package:
Bash
python -m build This creates dist/ folder with .whl (wheel) and .tar.gz (source distribution) files.
Upload to TestPyPI (for testing):
Bash
twine upload --repository testpypi dist/* Upload to PyPI (for public release):
Bash
twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pass_plus_sort-0.1.0.tar.gz.
File metadata
- Download URL: pass_plus_sort-0.1.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50a77132ea468bf5423b7ccd55771977e8b0e95062c55f33bf7eab2067c081d5
|
|
| MD5 |
d2c2ee5ef3a1aae6b185b047f4fb82e8
|
|
| BLAKE2b-256 |
0c0af3fe56e296404654f6a1f1f25dcb89fcae6a9dcb43839d8bfb2d9c7f30ae
|
File details
Details for the file pass_plus_sort-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pass_plus_sort-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a33e83f8be3fb9d89f4c65e9b711145f41fdf7023b237e1aab4ceab27f7418d
|
|
| MD5 |
db62d66670b0d5727183d56102f245b4
|
|
| BLAKE2b-256 |
0393e11acd377b4bbb9f9ce9b9aadf32a02ab0a5101207b75ff6047be69177dd
|