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

Initial PropertyGraph implementation and tests #1999

Merged

Conversation

rlratzel
Copy link
Contributor

@rlratzel rlratzel commented Jan 3, 2022

Initial implementation of the PropertyGraph graph class and corresponding unit tests.

pG = cugraph.experimental.PropertyGraph()

# Add properties
pG.add_vertex_data(...)
pG.add_edge_data(...)

# Select specific vertices and edges based on conditions
selection = pG.select_vertices("(user_location==47906) | (user_location==78750)")
selection += pG.select_edges("_TYPE_=='referrals'")

# Extract a subgraph using selection
G = pG.extract_subgraph(selection=selection,
                        create_using=DiGraph_inst,
                        edge_weight_property="review_rating")

# run some algo on G, get algo_results

# annotate results with properties
algo_results_with_properties = pG.annotate_dataframe(algo_results, G, edge_vertex_id_columns=("from", "to"))

# Add algo results back to the PropertyGraph for further analysis
pG.add_edge_data(algo_results, type_name="referral_data", vertex_id_columns=("from", "to"))

closes #1876

@rlratzel rlratzel requested a review from BradReesWork January 3, 2022 05:03
@rlratzel rlratzel added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jan 3, 2022
…rames, updated tests to parameterize dDataFrame type for both cuDF and Pandas, removed unnecessary PropertyColumn class, added more error checking and tests for correct input types, updated comments.
@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2022

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.02@4032f34). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##             branch-22.02    #1999   +/-   ##
===============================================
  Coverage                ?   72.50%           
===============================================
  Files                   ?      146           
  Lines                   ?     9470           
  Branches                ?        0           
===============================================
  Hits                    ?     6866           
  Misses                  ?     2604           
  Partials                ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4032f34...a4d8779. Read the comment docs.

@rlratzel
Copy link
Contributor Author

rerun tests

…ated edges before creating Graphs, allow for queries that don't have verts, more progress on annotate_dataframe(), added additional data to datasets to test multiple vert props and duplicated edges, refactored extract_subgraph() to allow for outside dataframes to generate graphs.
…is now passing, still need to update annotate_dataframe() to remove extra columns from other edge types, check args, add other tests.
@BradReesWork BradReesWork added this to the 22.02 milestone Jan 11, 2022
@rlratzel rlratzel marked this pull request as ready for review January 13, 2022 04:27
@rlratzel rlratzel requested review from a team as code owners January 13, 2022 04:27
@rlratzel rlratzel self-assigned this Jan 13, 2022
@rlratzel rlratzel marked this pull request as draft January 13, 2022 22:11
@rlratzel rlratzel marked this pull request as ready for review January 19, 2022 12:26
Copy link
Contributor

@acostadon acostadon left a comment

Choose a reason for hiding this comment

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

Added a simple test for a completely empty graph but not sure it is worth adding during burn down. Can commit and push if wanted.

@BradReesWork
Copy link
Member

@gpucibot merge

@rapids-bot rapids-bot bot merged commit afeebee into rapidsai:branch-22.02 Jan 25, 2022
@rlratzel rlratzel deleted the branch-22.02-initialpropgraph branch June 17, 2022 00:31
@jakirkham jakirkham mentioned this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EPIC] Property Graph research and prototype
4 participants