The graphgps data loader no longer overshadows all other dataloaders. #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If users want to use graphGPS as a library in their projects the graphgps master dataloader should not overshadow all other dataloaders. Otherwise they can not create new custom graphgym datasets when building on top of the graphgps library.
The
create_dataset
function first checks whether any custom dataset loader function returns a dataset. A custom data loader function is ignored if it returnes None. See graphgym implementation here. Currently thecustom_master_loader
of graphGPS throws a ValueError if the format is not recognised, but this prohibits any user from registering their own data loader function with graphgym. Further it is not necessary to call the default pyg loaders if no customisation is applied, as thecreate_dataset
will fallback to them if no custom routine returns a dataset.This modification still allows the OGB dataset loader to be overwritten because any custom loader is called first (see again the official implementation in graphgym).
After the modification a user can install the graphgps library normaly and add new dataloaders functions, while any graphGPS datasets are still available (if your code has
import graphgps
somewhere and you have thegraphgps
library installed. In my opinion this is how the creators of graphgym intended this to work.