This pull request contains three changes -- one major and two minor changes.
The major change modifies how edge and node features are converted from pyg.data.Data objects into torch.Tensors before saving. If we assume that all node/edge features (features in the following) are numeric, a conversion to float32 will always work. Further, my proposed change assumes that the features can be either 1D (vector of edge lengths) or 2D (node position, vdiff vector between source and target nodes). Based on this, I propose a universal function that reshapes any 1D vector into a 2D column vector, which allows the concatenation of any number of features in a loop.
Using the new function, we also make the saving of len as edge feature explicit by including it in the default edge_features list.
The hide_ticks argument for nx.draw seems to be deprecated because it caused an error with my networkx v 3.2
Type of change
[x] 🐛 Bug fix (non-breaking change that fixes an issue)
[x] ✨ New feature (non-breaking change that adds functionality)
[ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] 📖 Documentation (Addition or improvements to documentation)
Checklist before requesting a review
[x] My branch is up-to-date with the target branch - if not update your fork with the changes from the target branch (use pull with --rebase option if possible).
[x] I have performed a self-review of my code
[x] For any new/modified functions/classes I have added docstrings that clearly describe its purpose, expected inputs and returned values
[x] I have placed in-line comments to clarify the intent of any hard-to-understand passages of my code
[x] I have updated the documentation to cover introduced code changes
[ ] I have added tests that prove my fix is effective or that my feature works
[x] I have given the PR a name that clearly describes the change, written in imperative form (context).
[ ] I have requested a reviewer and an assignee (assignee is responsible for merging)
Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
[x] the code is readable
[x] the code is well tested
[x] the code is documented (including return types and parameters)
[x] the code is easy to maintain
Author checklist after completed review
[x] I have added a line to the CHANGELOG describing this change, in a section
reflecting type of change (add section where missing):
added: when you have added new functionality
changed: when default behaviour of the code has been changed
fixes: when your contribution fixes a bug
Checklist for assignee
[x] PR is up to date with the base branch
[x] the tests pass
[x] author has added an entry to the changelog (and designated the change as added, changed or fixed)
Once the PR is ready to be merged, squash commits and merge the PR.
Describe your changes
This pull request contains three changes -- one major and two minor changes.
The major change modifies how edge and node features are converted from
pyg.data.Data
objects intotorch.Tensor
s before saving. If we assume that all node/edge features (features in the following) are numeric, a conversion to float32 will always work. Further, my proposed change assumes that the features can be either 1D (vector of edge lengths) or 2D (node position, vdiff vector between source and target nodes). Based on this, I propose a universal function that reshapes any 1D vector into a 2D column vector, which allows the concatenation of any number of features in a loop.Using the new function, we also make the saving of
len
as edge feature explicit by including it in the defaultedge_features
list.Two minor bugs are fixed:
hide_ticks
argument fornx.draw
seems to be deprecated because it caused an error with my networkx v 3.2Type of change
Checklist before requesting a review
pull
with--rebase
option if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
Checklist for assignee