PyDataStructs project aims to be a Python package for various data structures and algorithms (including their parallel implementations).
We are also working on providing C++ backend via Python C-API for high performance use cases.
Single package for all your data structures and algorithms
Consistent and Clean Interface - The APIs we have provided are consistent with each other, clean, and easy to use. We make sure of that before adding any new data structure or algorithm.
Well Tested - We thoroughly test our code before making any new addition to PyDataStructs. 99 percent lines of our code have already been tested by us.
If you are using Anaconda/Mamba, you can setup your development environment by executing the following commands,
conda env create --file environment.yml
conda activate pyds-env
You can install the library by running the following command,
python scripts/build/install.py
For development purposes i.e., if you intend to be a contributor,
python scripts/build/develop.py
Make sure you change your working directory to pydatastructs
before executing any of the above commands. Also, your python version should be at least 3.8
.
For testing your patch locally follow the steps given below,
python3 -m pytest --doctest-modules --cov=./ --cov-report=html
. Look for, htmlcov/index.html
and open it in your browser, which will show the coverage report. Try to ensure that the coverage is not decreasing by more than 1% for your patch.For a good visualisation of the different data structures and algorithms, refer the following websites:
You can use the examples given in the following book as tests for your code:
Make sure you have activated the conda environment: pyds-env
and your working directory is ../pydatastructs
.
In the terminal, run: python -c "from pydatastructs.utils.testing_util import test; test()"
.
This will run all the test files, except benchmark tests. This should be used if benchmark tests are computationally too heavy to be run on your local machine.
As we know Python is an interpreted language and hence executing programs in it is slower as compared to C++.
We still decided to use Python because the software development can happen at a much faster pace and it is much easier to test various software designs and APIs as coding them out takes no time in Python.
However, keeping the need of the users in mind, we are also working on providing a C++ backend, which will happen quickly as we would be required to just translate the tested code rather than writing it from scratch.
Follow the steps given below,
git clone https://github.com/codezonediitj/pydatastructs/
../pydatastructs
.git remote add origin_user https://github.com/<your-github-username>/pydatastructs/
git checkout -b <your-new-branch-for-working>
.git add .
.git commit -m "your-commit-message"
.git push origin_user <your-current-branch>
.That's it, 10 easy steps for your first contribution. For future contributions just follow steps 5 to 10. Make sure that before starting work, always checkout to master and pull the recent changes using the remote origin
and then start following steps 5 to 10.
See you soon with your first PR.
It is recommended to go through the following links before you start working.
We recommend you to join our discord channel for discussing anything related to the project.
Please follow the rules and guidelines given below,
beginner
or easy
.Please take over
, meaning that anyone willing to continue that PR can start working on it.Could Close
, meaning that the PR is not necessary at the moment.The following parameters are to be followed to pass the code quality tests for your Pull Requests,
.py
file should end with exactly one new line.True
, False
, and None
should be done by
reference (using is
, is not
) and not by value(==
, !=
).Keep contributing!!
Thanks to these wonderful people ✨✨: