Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEA]: Add API Calls to Get Edge Types and Edge Counts for cuGraph.Graph #2899

Closed
2 tasks done
alexbarghi-nv opened this issue Nov 9, 2022 · 1 comment
Closed
2 tasks done
Assignees
Labels
feature request New feature or request non-breaking Non-breaking change
Milestone

Comments

@alexbarghi-nv
Copy link
Member

alexbarghi-nv commented Nov 9, 2022

Is this a new feature, an improvement, or a change to existing functionality?

New Feature

How would you describe the priority of this feature request

High

Please provide a clear description of problem this feature solves

cuGraph now supports edge types, but using them requires a lot of repeated code. This code should be consolidated in a new API call that matches the equivalent property graph call (G.vertex_types) and another new API call (G.get_num_edges()).

This was originally going to be part of #2832 but requires additional tests.

Describe your ideal solution

@property
def vertex_types(self):
           if self.edgeTypeCol in self.edgelist.edgelist_df.columns:
                return (
                    self.edgelist.edgelist_df[G.edgeTypeCol]
                    .unique()
                    .astype("str")
                    .values_host
                )
            else:
                return [""]

def get_num_edges(self, edge_type=None):
                mask = self.edgelist.edgelist_df[self.edgeTypeCol] == edge_type
                return self.edgelist.edgelist_df[mask].count()

Describe any alternatives you have considered

No response

Additional context

No response

Code of Conduct

  • I agree to follow cuGraph's Code of Conduct
  • I have searched the open feature requests and have found no duplicates for this feature request
@alexbarghi-nv alexbarghi-nv added feature request New feature or request non-breaking Non-breaking change labels Nov 9, 2022
@alexbarghi-nv alexbarghi-nv added this to the 22.12 milestone Nov 9, 2022
@alexbarghi-nv alexbarghi-nv self-assigned this Nov 9, 2022
@alexbarghi-nv alexbarghi-nv changed the title [FEA]: Add API Call to Get Edge Types for cuGraph.Graph [FEA]: Add API Calls to Get Edge Types and Edge Counts for cuGraph.Graph Nov 9, 2022
@alexbarghi-nv alexbarghi-nv modified the milestones: 22.12, 23.02 Nov 17, 2022
@alexbarghi-nv alexbarghi-nv modified the milestones: 23.02, 23.04 Jan 17, 2023
@alexbarghi-nv
Copy link
Member Author

no longer desired behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request non-breaking Non-breaking change
Projects
None yet
Development

No branches or pull requests

1 participant