Packed-Compressed-Sparse-Row icon indicating copy to clipboard operation
Packed-Compressed-Sparse-Row copied to clipboard

🔨 Introducing Python functionality for PCSR

Open nithinmanoj10 opened this issue 2 years ago • 4 comments

Exposing the PCSR API using PyBind11 so that users can use PCSR in Python

nithinmanoj10 avatar Jul 02 '23 05:07 nithinmanoj10

Using the pcsr.Node object in Python

Using the rich.inspect module to view the contents of an object.

import pcsr
from rich import inspect

n = pcsr.Node(2,3,4)
inspect(n)

image

nithinmanoj10 avatar Jul 02 '23 05:07 nithinmanoj10

Running test.py

Run test.py as follows

python3 test.py

Output image

nithinmanoj10 avatar Jul 02 '23 07:07 nithinmanoj10

Why this new feature

Hey @wheatman 👋🏽

I've made some updates to your PCSR project that will significantly enhance its accessibility for Python users. By leveraging the power of PyBind11, this integration simplifies the usage of PCSR within Python environments and Python developers can effortlessly tap into PCSR's functionalities.

To ensure a smooth onboarding experience, I have created a comprehensive README file. This README provides detailed instructions on how to compile and import the PCSR package, enabling users to quickly and effortlessly dive into utilizing its features.

I'm looking forward to your feedback and the opportunity to collaborate further by adding the following features into the PCSR python implementation

  • Publishing the PCSR Python module on PyPI so that developers need not compile the C++ code to get the .so file that is then imported into the python program. Instead, they can directly install and use it from PyPI using a pip install and import command
  • Creating the PCSR graph from a given edge list
  • Function to delete an edge

Best regards Nithin Manoj

nithinmanoj10 avatar Jul 06 '23 09:07 nithinmanoj10

Hey @wheatman 👋🏽,

I hope you're doing well! I wanted to bring your attention to the pull request I submitted recently regarding the Python functionality for the PCSR project. I understand that pull requests can sometimes get lost in the shuffle, so I wanted to kindly remind you about this contribution.

Regards Nithin Manoj

nithinmanoj10 avatar Jul 22 '23 11:07 nithinmanoj10