Skip to content

Commit

Permalink
[Doc] API doc string refactor for graphstorm.dataloading (#934)
Browse files Browse the repository at this point in the history
*Issue #, if available:*

*Description of changes:*
This PR refactors the API doc string and the API reference rst pages for
graphstorm.dataloading module.

The rendered readthedoc pages are: 
1. API reference index page:
https://james4graphstorm.readthedocs.io/en/james_apidoc_dataloading/api/references/index.html
2. graphstorm.dataset and graphstorm.dataloading index page:
https://james4graphstorm.readthedocs.io/en/james_apidoc_dataloading/api/references/graphstorm.dataloading.html
All rst pages of classes under graphstorm.dataloading module are
updated.

Back compatibility breaking changes:
1. Rename the `pos_graph_feat_fields` with `pos_graph_edge_feat_fields`
to make its meaning clearer.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Ubuntu <[email protected]>
Co-authored-by: Oxfordblue7 <[email protected]>
Co-authored-by: xiang song(charlie.song) <[email protected]>
  • Loading branch information
4 people authored Jul 30, 2024
1 parent 9e9ea2a commit f4d5785
Show file tree
Hide file tree
Showing 8 changed files with 515 additions and 432 deletions.
4 changes: 3 additions & 1 deletion docs/source/_templates/dataloadertemplate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@

.. autoclass:: {{ name }}
:show-inheritance:
:special-members: __iter__, __next__
:members:
:member-order: bysource
:special-members: __iter__, __next__, __len__
3 changes: 2 additions & 1 deletion docs/source/_templates/datasettemplate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@

.. autoclass:: {{ name }}
:show-inheritance:
:members: prepare_data, get_node_feats, get_edge_feats, get_labels, get_node_feat_size
:members:
:member-order: bysource
46 changes: 28 additions & 18 deletions docs/source/api/references/graphstorm.dataloading.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
.. _apidataloading:

graphstorm.dataloading
==========================
graphstorm.dataloading.dataset
===============================

GraphStorm dataloading module includes a set of graph DataSets and DataLoaders for different
graph machine learning tasks.

If users would like to customize DataLoaders, please extend those classes in the
:ref:`Base DataLoaders <basedataloaders>` section and customize their abstract methods.
GraphStorm dataset provides one unified dataset class, i.e., ``GSgnnData``, for all graph
machine learning tasks. Users can build a ``GSgnnData`` object by giving the path of
the JSON file created by the :ref:`GraphStorm Graph Construction<graph_construction>`
operations. The ``GSgnnData`` will load the related graph artifacts specified in the JSON
file. It provides a set of APIs for users to extract information of the graph data for
model training and inference.

.. currentmodule:: graphstorm.dataloading

.. _basedataloaders:
.. autosummary::
:toctree: ../generated/
:nosignatures:
:template: datasettemplate.rst

GSgnnData

graphstorm.dataloading.dataloading
===================================

GraphStorm dataloading module includes a set of different DataLoaders for
different graph machine learning tasks.

If users would like to customize DataLoaders, please extend those dataloader base
classes in the **Base DataLoaders** section and customize their abstract functions.

.. currentmodule:: graphstorm.dataloading

Base DataLoaders
-------------------
Expand All @@ -25,16 +42,6 @@ Base DataLoaders
GSgnnEdgeDataLoaderBase
GSgnnLinkPredictionDataLoaderBase

DataSets
------------

.. autosummary::
:toctree: ../generated/
:nosignatures:
:template: datasettemplate.rst

GSgnnData

DataLoaders
------------

Expand All @@ -44,5 +51,8 @@ DataLoaders
:template: dataloadertemplate.rst

GSgnnNodeDataLoader
GSgnnNodeSemiSupDataLoader
GSgnnEdgeDataLoader
GSgnnLinkPredictionDataLoader
GSgnnLinkPredictionTestDataLoader
GSgnnLinkPredictionPredefinedTestDataLoader
2 changes: 2 additions & 0 deletions docs/source/graph-construction/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _graph_construction:

==================
Graph Construction
==================
Expand Down
Loading

0 comments on commit f4d5785

Please sign in to comment.