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

Add to_dgl and from_dgl conversions #7053

Merged
merged 21 commits into from
Mar 29, 2023

Conversation

hbenedek
Copy link
Contributor

Issue #6979

Description

I add two functions from_dgl(dgl.Graph) -> data: Union[Data, HeteroData]and
to_dgl(Union[Data, HeteroData]) -> dgl.Graph in utils/convert.py. Both function in both direction performs the same three operations, setting the node and edge attributes and copies the edges of the underlying graph(s).

@rusty1s rusty1s changed the title add dgl_to and dgl_from Add to_dgl and from_dgl conversions Mar 28, 2023
@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Merging #7053 (7d4d9b5) into master (9ab1b05) will decrease coverage by 0.20%.
The diff coverage is 5.45%.

❗ Current head 7d4d9b5 differs from pull request most recent head 8cc3b0f. Consider uploading reports for the commit 8cc3b0f to get more accurate results

@@            Coverage Diff             @@
##           master    #7053      +/-   ##
==========================================
- Coverage   91.47%   91.27%   -0.20%     
==========================================
  Files         436      436              
  Lines       23836    23891      +55     
==========================================
+ Hits        21803    21806       +3     
- Misses       2033     2085      +52     
Impacted Files Coverage Δ
torch_geometric/utils/convert.py 55.85% <3.70%> (-16.77%) ⬇️
torch_geometric/utils/__init__.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@EdisonLeeeee EdisonLeeeee left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Please also includes some test cases for these two functions.

torch_geometric/utils/convert.py Outdated Show resolved Hide resolved
torch_geometric/utils/convert.py Outdated Show resolved Hide resolved
torch_geometric/utils/convert.py Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
torch_geometric/utils/convert.py Show resolved Hide resolved
torch_geometric/utils/convert.py Show resolved Hide resolved
@hbenedek
Copy link
Contributor Author

@EdisonLeeeee I added the tests, but for some reason, codecov complains about not seeing them. I ran pytest --cov and the coverage of torch_geometric/utils/convert.py is only 9%. Am I doing something wrong, or just the external libraries causing this issue?

@rusty1s
Copy link
Member

rusty1s commented Mar 29, 2023

@hbenedek Don't worry about it. It's good that we have a test but it's not called by CI due to missing dependency.

@rusty1s rusty1s enabled auto-merge (squash) March 29, 2023 13:53
@rusty1s rusty1s merged commit 98a4d72 into pyg-team:master Mar 29, 2023
@hbenedek
Copy link
Contributor Author

Thank you very much @rusty1s and @EdisonLeeeee, this was a lot of fun to work on :)

@rusty1s
Copy link
Member

rusty1s commented Mar 29, 2023

Great PR, thanks for doing that :)

@EdisonLeeeee
Copy link
Contributor

@hbenedek thank you, too :D

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

Successfully merging this pull request may close these issues.

3 participants