Skip to content

Conversation

ThisuraGallage
Copy link
Contributor

@ThisuraGallage ThisuraGallage commented Jan 21, 2025

This PR introduces a new method, in_edge_indices, to the rustworkx.PyDiGraph class. The method returns the indices of incoming edges for a specified node.
#1360

  • I ran rustfmt locally
  • I have added the tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

I'll add the documentation once the function signature is finalized.

@ThisuraGallage ThisuraGallage changed the title Add in edge indices function [WIP]Add in edge indices function Jan 21, 2025
@coveralls
Copy link

coveralls commented Jan 23, 2025

Pull Request Test Coverage Report for Build 12926634311

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 40 of 40 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.009%) to 95.82%

Totals Coverage Status
Change from base Build 12817417491: 0.009%
Covered Lines: 18383
Relevant Lines: 19185

💛 - Coveralls

Copy link
Collaborator

@IvanIsCoding IvanIsCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current implementation looks good to me. I left some minor nitpick comments but they are not blocking.

What is going to be more work is adding even more methods...

  • PyGraph should have the same methods even if the implementation is just calling incident_edges for consistency
  • PyDiGraph and PyGraph could use a out_edge_indices

So that is 3 more methods which were in the original request but are useful to maintain some coherence accross the API

@IvanIsCoding IvanIsCoding added this to the 0.17.0 milestone Jan 23, 2025
@ThisuraGallage ThisuraGallage marked this pull request as ready for review January 23, 2025 11:02
@ThisuraGallage ThisuraGallage changed the title [WIP]Add in edge indices function Add in and out edge indices functions Jan 23, 2025
Copy link
Collaborator

@IvanIsCoding IvanIsCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I will run this through @mtreinish before adding four similar methods for a second opinion

@IvanIsCoding IvanIsCoding added this pull request to the merge queue Feb 13, 2025
Merged via the queue into Qiskit:main with commit a9460dc Feb 13, 2025
31 checks passed
@IvanIsCoding
Copy link
Collaborator

Also, Matthew kindly reminded me:

Congratulations on snatching commit 1000 🥳 🥳

SILIZ4 pushed a commit to SILIZ4/rustworkx that referenced this pull request Jul 4, 2025
* Add method to retrieve incoming edge indices for a node

* Add type annotations in stub file

* Add tests for in_edge_indices

* Add method to get outgoing edge indices for a node

* Add in_edge_indices and out_edge_indices methods in PyGraph

* update stub file

* Add tests for out_edge_indices and  in_edge_indices

* Add release notes for in_edge_indices and out_edge_indices functions

* Change releasenote name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants