Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docs #34

Merged
merged 7 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:
- '.github/workflows/tests.yml'
- 'l2gv2/**.py'
- 'tests/**.py'
- 'requirements.txt'
- 'pyproject.toml'
pull_request:
paths:
- '.github/workflows/tests.yml'
- 'l2gv2/**.py'
- 'tests/**.py'
- 'requirements.txt'
- 'pyproject.toml'
jobs:
ci:
runs-on: ubuntu-22.04
Expand All @@ -25,7 +25,7 @@ jobs:
python-version: "3.10"
- name: Install dependencies
run: |
python3 -m pip install '.[tests]' --find-links https://data.pyg.org/whl/torch-2.4.1%2Bcpu.html
python3 -m pip install '.[dev]' --find-links https://data.pyg.org/whl/torch-2.4.1%2Bcpu.html
- name: Test with pytest
run: |
python3 -m pytest
python3 -m pytest --ignore tests/test_local2global.py
7 changes: 2 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ build:
python: "3.12"
jobs:
pre_build:
- 'sphinx-apidoc -o docs/source/reference -H "Code Reference" l2gv2'
- "pip install '.[docs]' --find-links https://data.pyg.org/whl/torch-2.4.1%2Bcpu.html"
- "sphinx-apidoc -o docs/source/reference -H 'Code Reference' l2gv2 '*/execute.py'" # ignores execute.py script

sphinx:
configuration: docs/source/conf.py

python:
install:
- requirements: docs/requirements.txt
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ Setup the virtual environment
for the appropriate repository links, or visit https://data.pyg.org/whl to see
all possible torch/GPU supported versions.

3. To build docs and for tests install the corresponding optional dependency sets
3. To build docs

```shell
pip install '.[tests]'
pip install '.[docs]'
```

Expand Down
23 changes: 0 additions & 23 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,6 @@
templates_path = ["_templates"]
exclude_patterns = []

autodoc_mock_imports = [
"optuna",
"autograd",
"pymanopt",
"tqdm",
"torch",
"numba",
"numpy",
"pandas",
"sklearn",
"scipy",
"community",
"torch_geometric",
"torch_scatter",
"local2global",
"raphtory",
"networkx",
"matplotlib",
"nfts",
"polars",
]


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ l2gv2 documentation
====================

.. toctree::
:maxdepth: 5
:maxdepth: 3

intro
reference/modules
3 changes: 1 addition & 2 deletions docs/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ Setup the virtual environment
https://data.pyg.org/whl/ to see all possible torch/GPU supported versions.


3. To build docs and for tests install the corresponding optional dependency sets
3. To build docs

.. code-block:: bash

pip install '.[tests]'
pip install '.[docs]'

4. To install the development dependencies
Expand Down
7 changes: 5 additions & 2 deletions l2gv2/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""This module contains the functions to compute the
embeddings of a list of patches using VGAE and Node2Vec."""

import numpy as np
from typing import Tuple
import numpy.typing as npt

from tqdm import tqdm
import torch
import torch.nn.functional as F
Expand Down Expand Up @@ -346,7 +348,8 @@ def node2vec_patch_embeddings(

def chunk_embedding(
chunk_size: int, patches: list[Patch], dim=2
) -> tuple[np.ArrayLike, WeightedAlignmentProblem]:
) -> Tuple[npt.ArrayLike, WeightedAlignmentProblem]:

"""TODO: docstring for `chunk_embedding`

Note: this only works for Autonomous System dataset.
Expand Down
4 changes: 3 additions & 1 deletion l2gv2/network/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
import numba
from numba.experimental import jitclass

from .network import NPGraph, TGraph
from .npgraph import NPGraph
from .tgraph import TGraph

from .graph import Graph


Expand Down
6 changes: 4 additions & 2 deletions l2gv2/patch/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

import copy
import numpy as np
from lazy import (
import numpy.typing as npt
from l2gv2.patch.lazy import (
BaseLazyCoordinates,
LazyMeanAggregatorCoordinates,
LazyFileCoordinates,
Expand All @@ -37,7 +38,8 @@ class Patch:
coordinates: np.ArrayLike
"""patch embedding coordinates"""

def __init__(self, nodes: iter, coordinates: np.ArrayLike | None = None):

def __init__(self, nodes: iter, coordinates: npt.ArrayLike | None = None):
"""Initialise a patch from a list of nodes and corresponding coordinates

Args:
Expand Down
Loading