codezonediitj / pydatastructs

A python package for data structures and algorithms
https://pydatastructs.readthedocs.io/en/stable/
Other
200 stars 267 forks source link

Adding support for ``stack.ArrayStack`` in C++ backend #512

Closed nubol23 closed 2 years ago

nubol23 commented 2 years ago

Adds cpp backend for the stack implementation.

Based on Issue #511

Work in progress

czgdp1807 commented 2 years ago

In addition to https://github.com/codezonediitj/pydatastructs/pull/512#discussion_r939642998 I removed calls to Py_INCREF/Py_XDECREF as they sometimes give segmentation faults. Anyways, avoid the calls to these two unless extremely necessary, like if your code only works after adding them at specific places then feel free to add otherwise ignore.

czgdp1807 commented 2 years ago

Great progress @nubol23. I am glad that you are able to figure things out on your own in Python C-API. Let me know if you get stuck somewhere, we will fix the problem. :-)

nubol23 commented 2 years ago

Thank you very much @czgdp1807 :) I added the remaining changes for the ArrayStack

codecov[bot] commented 2 years ago

Codecov Report

Merging #512 (4385edf) into master (3abc026) will increase coverage by 0.005%. The diff coverage is 100.000%.

@@              Coverage Diff              @@
##            master      #512       +/-   ##
=============================================
+ Coverage   98.523%   98.528%   +0.005%     
=============================================
  Files           31        32        +1     
  Lines         3996      4010       +14     
=============================================
+ Hits          3937      3951       +14     
  Misses          59        59               
Impacted Files Coverage Δ
...astructs/miscellaneous_data_structures/__init__.py 100.000% <ø> (ø)
...ructs/miscellaneous_data_structures/_extensions.py 100.000% <100.000%> (ø)
...datastructs/miscellaneous_data_structures/stack.py 100.000% <100.000%> (ø)

Impacted file tree graph

czgdp1807 commented 2 years ago

Great job @nubol23. 🎉🎉