Repository: pyg-team/pytorch_geometric
Pull request #6777 (2023-02-23 14:01:36)

Replace `-` with `_` in package names in installation instructions

codecov[bot]: # [Codecov](https://codecov.io/gh/pyg-team/pytorch_geometric/pull/6777?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyg-team) Report
> Merging [#6777](https://codecov.io/gh/pyg-team/pytorch_geometric/pull/6777?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyg-team) (20b6b4f) into [master](https://codecov.io/gh/pyg-team/pytorch_geometric/commit/514b704e94b8528d0fde561abef2b90f601d7b4a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyg-team) (514b704) will **not change** coverage.
> The diff coverage is `n/a`.

> :exclamation: Current head 20b6b4f differs from pull request most recent head 47c32e6. Consider uploading reports for the commit 47c32e6 to get more accurate results

```diff
@@           Coverage Diff           @@
##           master    #6777   +/-   ##
=======================================
  Coverage   89.38%   89.38%           
=======================================
  Files         425      425           
  Lines       23061    23061           
=======================================
  Hits        20613    20613           
  Misses       2448     2448           
```


| [Impacted Files](https://codecov.io/gh/pyg-team/pytorch_geometric/pull/6777?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyg-team) | Coverage Δ | |
|---|---|---|
| [torch\_geometric/utils/scatter.py](https://codecov.io/gh/pyg-team/pytorch_geometric/pull/6777?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyg-team#diff-dG9yY2hfZ2VvbWV0cmljL3V0aWxzL3NjYXR0ZXIucHk=) | `72.72% <ø> (ø)` | |
| [torch\_geometric/utils/segment.py](https://codecov.io/gh/pyg-team/pytorch_geometric/pull/6777?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyg-team#diff-dG9yY2hfZ2VvbWV0cmljL3V0aWxzL3NlZ21lbnQucHk=) | `100.00% <ø> (ø)` | |

:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyg-team)


Patch:
diff --git a/README.md b/README.md
index 0cdf619b3..21b325271 100644
--- a/README.md
+++ b/README.md
@@ -171,7 +171,7 @@ For a quick start, check out our [examples](https://github.com/pyg-team/pytorch_
 PyG provides a multi-layer framework that enables users to build Graph Neural Network solutions on both low and high levels.
 It comprises of the following components:
 
-* The PyG **engine** utilizes the powerful PyTorch deep learning framework, as well as additions of efficient CUDA libraries for operating on sparse data, *e.g.*, [`pyg-lib`](https://github.com/pyg-team/pyg-lib), [`torch-scatter`](https://github.com/rusty1s/pytorch_scatter), [`torch-sparse`](https://github.com/rusty1s/pytorch_sparse) and [`torch-cluster`](https://github.com/rusty1s/pytorch_cluster).
+* The PyG **engine** utilizes the powerful PyTorch deep learning framework, as well as additions of efficient CUDA libraries for operating on sparse data, *e.g.*, [`pyg-lib`](https://github.com/pyg-team/pyg-lib), [`torch_scatter`](https://github.com/rusty1s/pytorch_scatter), [`torch_sparse`](https://github.com/rusty1s/pytorch_sparse) and [`torch-cluster`](https://github.com/rusty1s/pytorch_cluster).
 * The PyG **storage** handles data processing, transformation and loading pipelines. It is capable of handling and processing large-scale graph datasets, and provides effective solutions for heterogeneous graphs. It further provides a variety of sampling solutions, which enable training of GNNs on large-scale graphs.
 * The PyG **operators** bundle essential functionalities for implementing Graph Neural Networks. PyG supports important GNN building blocks that can be combined and applied to various parts of a GNN model, ensuring rich flexibility of GNN design.
 * Finally, PyG provides an abundant set of GNN **models**, and examples that showcase GNN models on standard graph benchmarks. Thanks to its flexibility, users can easily build and modify custom GNN models to fit their specific needs.
@@ -374,8 +374,8 @@ We alternatively provide pip wheels for all major OS/PyTorch/CUDA combinations,
 To install the binaries for PyTorch 1.13.0, simply run
 
 ```
-pip install pyg-lib torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.13.0+${CUDA}.html
-pip install torch-geometric
+pip install pyg_lib torch_scatter torch_sparse -f https://data.pyg.org/whl/torch-1.13.0+${CUDA}.html
+pip install torch_geometric
 ```
 
 where `${CUDA}` should be replaced by either `cpu`, `cu116`, or `cu117` depending on your PyTorch installation.
@@ -389,7 +389,7 @@ where `${CUDA}` should be replaced by either `cpu`, `cu116`, or `cu117` dependin
 For additional but optional functionality, run
 
 ```
-pip install torch-cluster torch-spline-conv -f https://data.pyg.org/whl/torch-1.13.0+${CUDA}.html
+pip install torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-1.13.0+${CUDA}.html
 ```
 
 #### PyTorch 1.12
@@ -397,8 +397,8 @@ pip install torch-cluster torch-spline-conv -f https://data.pyg.org/whl/torch-1.
 To install the binaries for PyTorch 1.12.0, simply run
 
 ```
-pip install pyg-lib torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html
-pip install torch-geometric
+pip install pyg_lib torch_scatter torch_sparse -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html
+pip install torch_geometric
 ```
 
 where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu116` depending on your PyTorch installation.
@@ -412,7 +412,7 @@ where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu116`
 For additional but optional functionality, run
 
 ```
-pip install torch-cluster torch-spline-conv -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html
+pip install torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html
 ```
 
 **Note:** Binaries of older versions are also provided for PyTorch 1.4.0, PyTorch 1.5.0, PyTorch 1.6.0, PyTorch 1.7.0/1.7.1, PyTorch 1.8.0/1.8.1, PyTorch 1.9.0, PyTorch 1.10.0/1.10.1/1.10.2, and PyTorch 1.11.0 (following the same procedure).
@@ -421,7 +421,7 @@ You can look up the latest supported version number [here](https://data.pyg.org/
 
 ### Nightly and Master
 
-In case you want to experiment with the latest PyG features which are not fully released yet, ensure that `pyg-lib`, `torch-scatter` and `torch-sparse` are installed by [following the steps mentioned above](#pip-wheels), and install either the **nightly version** of PyG via
+In case you want to experiment with the latest PyG features which are not fully released yet, ensure that `pyg_lib`, `torch_scatter` and `torch_sparse` are installed by [following the steps mentioned above](#pip-wheels), and install either the **nightly version** of PyG via
 
 ```
 pip install pyg-nightly
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 94812bdab..262729455 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -153,10 +153,10 @@ RUN CPATH=/usr/local/cuda/include:$CPATH \
 
 RUN pip install scipy
 
-RUN pip install --no-index torch-scatter -f https://data.pyg.org/whl/torch-1.4.0+cu101.html \
- && pip install --no-index torch-sparse -f https://data.pyg.org/whl/torch-1.4.0+cu101.html \
- && pip install --no-index torch-cluster -f https://data.pyg.org/whl/torch-1.4.0+cu101.html \
- && pip install --no-index torch-spline-conv -f https://data.pyg.org/whl/torch-1.4.0+cu101.html \
+RUN pip install --no-index torch_scatter -f https://data.pyg.org/whl/torch-1.4.0+cu101.html \
+ && pip install --no-index torch_sparse -f https://data.pyg.org/whl/torch-1.4.0+cu101.html \
+ && pip install --no-index torch_cluster -f https://data.pyg.org/whl/torch-1.4.0+cu101.html \
+ && pip install --no-index torch_spline_conv -f https://data.pyg.org/whl/torch-1.4.0+cu101.html \
  && pip install torch-geometric
 
 # Set the default command to python3.
diff --git a/docs/source/advanced/sparse_tensor.rst b/docs/source/advanced/sparse_tensor.rst
index abb703be1..d12612bb0 100644
--- a/docs/source/advanced/sparse_tensor.rst
+++ b/docs/source/advanced/sparse_tensor.rst
@@ -65,7 +65,7 @@ where :math:`\mathbf{A}` denotes a sparse adjacency matrix of shape :obj:`[num_n
 This formulation allows to leverage dedicated and fast sparse-matrix multiplication implementations.
 
 In :pyg:`null` **PyG >= 1.6.0**, we officially introduce better support for sparse-matrix multiplication GNNs, resulting in a **lower memory footprint** and a **faster execution time**.
-As a result, we introduce the :class:`SparseTensor` class (from the :obj:`torch-sparse` package), which implements fast forward and backward passes for sparse-matrix multiplication based on the `"Design Principles for Sparse Matrix Multiplication on the GPU" <https://arxiv.org/abs/1803.08601>`_ paper.
+As a result, we introduce the :class:`SparseTensor` class (from the :obj:`torch_sparse` package), which implements fast forward and backward passes for sparse-matrix multiplication based on the `"Design Principles for Sparse Matrix Multiplication on the GPU" <https://arxiv.org/abs/1803.08601>`_ paper.
 
 Using the :class:`SparseTensor` class is straightforward and similar to the way :obj:`scipy` treats sparse matrices:
 
diff --git a/docs/source/get_started/introduction.rst b/docs/source/get_started/introduction.rst
index 7ec351153..d8235fb44 100644
--- a/docs/source/get_started/introduction.rst
+++ b/docs/source/get_started/introduction.rst
@@ -291,7 +291,7 @@ You can use it to, *e.g.*, average node features in the node dimension for each
         >>> torch.Size([32, 21])
 
 You can learn more about the internal batching procedure of :pyg:`PyG`, *e.g.*, how to modify its behavior, `here <../advanced/batching.html>`__.
-For documentation of scatter operations, we refer the interested reader to the :obj:`torch-scatter` `documentation <https://pytorch-scatter.readthedocs.io>`_.
+For documentation of scatter operations, we refer the interested reader to the :obj:`torch_scatter` `documentation <https://pytorch-scatter.readthedocs.io>`_.
 
 Data Transforms
 ---------------
diff --git a/docs/source/install/installation.rst b/docs/source/install/installation.rst
index 9b0d5dd41..fd2aa263c 100644
--- a/docs/source/install/installation.rst
+++ b/docs/source/install/installation.rst
@@ -57,7 +57,7 @@ We provide pip wheels for these packages for all major OS/PyTorch/CUDA combinati
 
    .. code-block:: none
 
-      pip install pyg-lib torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html
+      pip install pyg_lib torch_scatter torch_sparse -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html
       pip install torch-geometric
 
    where :obj:`${TORCH}` and :obj:`${CUDA}` should be replaced by the specific :pytorch:`PyTorch` and CUDA versions, respectively:
@@ -69,14 +69,14 @@ We provide pip wheels for these packages for all major OS/PyTorch/CUDA combinati
 
    .. code-block:: none
 
-      pip install pyg-lib torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.13.0+cu116.html
+      pip install pyg_lib torch_scatter torch_sparse -f https://data.pyg.org/whl/torch-1.13.0+cu116.html
       pip install torch-geometric
 
    For :pytorch:`PyTorch` 1.12.* and CUDA 11.3, type:
 
    .. code-block:: none
 
-     pip install pyg-lib torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.12.0+cu113.html
+     pip install pyg_lib torch_scatter torch_sparse -f https://data.pyg.org/whl/torch-1.12.0+cu113.html
      pip install torch-geometric
 
 #. Install additional packages *(optional)*:
@@ -85,7 +85,7 @@ We provide pip wheels for these packages for all major OS/PyTorch/CUDA combinati
 
    .. code-block:: none
 
-      pip install torch-cluster torch-spline-conv -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html
+      pip install torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html
 
    following the same procedure as mentioned above.
 
@@ -153,16 +153,13 @@ In case a specific version is not supported by `our wheels <https://data.pyg.org
    .. code-block:: none
 
       pip install git+https://github.com/pyg-team/pyg-lib.git
-      pip install torch-scatter
-      pip install torch-sparse
-      pip install torch-geometric
+      pip install torch_scatter torch_sparse torch_geometric
 
 #. Install additional packages *(optional)*:
 
    .. code-block:: none
 
-      pip install torch-cluster
-      pip install torch-spline-conv
+      pip install torch_cluster torch_spline_conv
 
 In rare cases, CUDA or Python path problems can prevent a successful installation.
 :obj:`pip` may even signal a successful installation, but execution simply crashes with :obj:`Segmentation fault (core dumped)`.
diff --git a/docs/source/install/quick-start.html b/docs/source/install/quick-start.html
index 6ad84c76b..29a0963ea 100644
--- a/docs/source/install/quick-start.html
+++ b/docs/source/install/quick-start.html
@@ -138,11 +138,11 @@
     }
 
     else if (os == "windows") {
-      $("#command pre").text(`pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/${$("#command").attr("torch")}+${$("#command").attr("cuda")}.html`);
+      $("#command pre").text(`pip install torch_scatter torch_sparse torch_cluster torch_spline_conv torch_geometric -f https://data.pyg.org/whl/${$("#command").attr("torch")}+${$("#command").attr("cuda")}.html`);
     }
 
     else {
-      $("#command pre").text(`pip install pyg-lib torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/${$("#command").attr("torch")}+${$("#command").attr("cuda")}.html`);
+      $("#command pre").text(`pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv torch_geometric -f https://data.pyg.org/whl/${$("#command").attr("torch")}+${$("#command").attr("cuda")}.html`);
     }
   }
 
diff --git a/torch_geometric/nn/conv/utils/cheatsheet.py b/torch_geometric/nn/conv/utils/cheatsheet.py
index 233f607b1..03f2d0e37 100644
--- a/torch_geometric/nn/conv/utils/cheatsheet.py
+++ b/torch_geometric/nn/conv/utils/cheatsheet.py
@@ -66,4 +66,5 @@ def processes_hypergraphs(cls: str) -> bool:
 def processes_point_clouds(cls: str) -> bool:
     cls = importlib.import_module('torch_geometric.nn.conv').__dict__[cls]
     signature = inspect.signature(cls.forward)
-    return 'edge_index' not in str(signature)
+    return (('edge_index' not in str(signature)
+             and 'csc' not in str(signature)) or 'pos' in str(signature))
diff --git a/torch_geometric/utils/scatter.py b/torch_geometric/utils/scatter.py
index d964b6069..a75f1fe36 100644
--- a/torch_geometric/utils/scatter.py
+++ b/torch_geometric/utils/scatter.py
@@ -26,7 +26,8 @@ if has_pytorch112:  # pragma: no cover
         specified in the :obj:`index` tensor along a given dimension
         :obj:`dim`. See the `documentation
         <https://pytorch-scatter.readthedocs.io/en/latest/functions/
-        scatter.html>`__ of :obj:`torch-scatter` for more information.
+        scatter.html>`__ of the :obj:`torch_scatter` package for more
+        information.
 
         Args:
             src (torch.Tensor): The source tensor.
@@ -128,7 +129,8 @@ else:
         specified in the :obj:`index` tensor along a given dimension
         :obj:`dim`. See the `documentation
         <https://pytorch-scatter.readthedocs.io/en/latest/functions/
-        scatter.html>`_ of :obj:`torch-scatter` for more information.
+        scatter.html>`_ of the :obj:`torch_scatter` package for more
+        information.
 
         Args:
             src (torch.Tensor): The source tensor.
diff --git a/torch_geometric/utils/segment.py b/torch_geometric/utils/segment.py
index 841497539..1794b9972 100644
--- a/torch_geometric/utils/segment.py
+++ b/torch_geometric/utils/segment.py
@@ -8,7 +8,8 @@ def segment(src: Tensor, ptr: Tensor, reduce: str = 'sum') -> Tensor:
     r"""Reduces all values in the first dimension of the :obj:`src` tensor
     within the ranges specified in the :obj:`ptr`. See the `documentation
     <https://pytorch-scatter.readthedocs.io/en/latest/functions/
-    segment_csr.html>`__ of :obj:`torch-scatter` for more information.
+    segment_csr.html>`__ of the :obj:`torch_scatter` package for more
+    information.
 
     Args:
         src (torch.Tensor): The source tensor.


Test patch:
diff --git a/test/nn/conv/utils/test_gnn_cheatsheet.py b/test/nn/conv/utils/test_gnn_cheatsheet.py
new file mode 100644
index 000000000..2f078448c
--- /dev/null
+++ b/test/nn/conv/utils/test_gnn_cheatsheet.py
@@ -0,0 +1,37 @@
+from torch_geometric.nn.conv import utils
+
+
+def test_gnn_cheatsheet():
+    assert utils.paper_title('GCNConv') == ('Semi-supervised Classification '
+                                            'with Graph Convolutional '
+                                            'Networks')
+    assert utils.paper_link('GCNConv') == 'https://arxiv.org/abs/1609.02907'
+
+    assert utils.supports_sparse_tensor('GCNConv')
+    assert not utils.supports_sparse_tensor('ChebConv')
+
+    assert utils.supports_edge_weights('GraphConv')
+    assert not utils.supports_edge_weights('SAGEConv')
+
+    assert utils.supports_edge_features('GATConv')
+    assert not utils.supports_edge_features('SimpleConv')
+
+    assert utils.supports_bipartite_graphs('SAGEConv')
+    assert not utils.supports_bipartite_graphs('GCNConv')
+
+    assert utils.supports_static_graphs('GCNConv')
+    assert not utils.supports_static_graphs('GATConv')
+
+    assert utils.supports_lazy_initialization('SAGEConv')
+    assert not utils.supports_lazy_initialization('GatedGraphConv')
+
+    assert utils.processes_heterogeneous_graphs('RGCNConv')
+    assert utils.processes_heterogeneous_graphs('HeteroConv')
+    assert not utils.processes_heterogeneous_graphs('GCNConv')
+
+    assert utils.processes_hypergraphs('HypergraphConv')
+    assert not utils.processes_hypergraphs('SAGEConv')
+
+    assert utils.processes_point_clouds('DynamicEdgeConv')
+    assert utils.processes_point_clouds('XConv')
+    assert not utils.processes_point_clouds('CuGraphSAGEConv')