dgl
dgl copied to clipboard
[Refactor?] Clean up and document the utility function usages
🚀 Feature
(This is not really a "feature" request, but more like a code organization and refactor request) Clean up, organize, and document all the internal utility functions DGL uses, so that people can find the appropriate utility function to do their job easily.
Motivation
The issue is mainly for the dgl.utils namespace, where we have some issues that hampers readability and maintainability. I'm listing some but not all of them.
Indexclass is largely deprecated, as it is no longer used indgl.heterographanddgl.heterograph_index. It still appears in some places likedgl.partition,dgl.traversaletc. which are mostly old code.CtxCachedObjectis completely deprecated as it is only used indgl._deprecatenamespace.- There are
build_relabel_map,build_relabel_dict,make_invmap, andrelabelwhich are all related to "relabeling non-contiguous ID arrays to contiguous ID arrays", and it's hard to identify their differences. In particular,relabelandbuild_relabel_maphave very similar code. - The
dgl.utils.internalmodule is too bloated. There are 34 functions and 7 classes all having completely different purposes (set operations, relabeling, setting frames, recursion, etc.). We should at least group the functions and classes by their functionality, and preferably split them into smaller modules.
Is there any tool to find those dead codes?
lgtm might work
https://lgtm.com/projects/g/dmlc/dgl/
This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you
This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you
This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you