Skip to content

Commit

Permalink
Changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ffl096 committed Oct 21, 2024
1 parent bec8957 commit 5ca62e4
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 69 deletions.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ Below is a minimal example of using TopoModelX to load a simplicial complex data

```bash
import numpy as np
import toponetx as tnx
import torch
from topomodelx.datasets.graph import karate_club
from topomodelx.nn.simplicial.san import SAN
from topomodelx.utils.sparse import from_sparse

# Step 1: Load the Karate Club dataset
dataset = karate_club(complex_type="simplicial")
dataset = tnx.karate_club(complex_type="simplicial")

# Step 2: Prepare Laplacians and node/edge features
laplacian_down = from_sparse(dataset.down_laplacian_matrix(rank=1))
Expand Down Expand Up @@ -79,16 +79,13 @@ y_hat_edge = model(x, laplacian_up=laplacian_up, laplacian_down=laplacian_down)

## 🤖 Installing TopoModelX

`TopoModelX` is available on PyPI and can be installed using `pip`.


### Install with pip

To install `TopoModelX` and its dependencies, run the following command:
`TopoModelX` is available on PyPI and can be installed using `pip`.
Run the following command:

```bash
pip install topomodelx
```

Then install torch, torch-scatter, torch-sparse with or without CUDA depending on your needs.

```bash
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ dev = ["TopoModelX[test, lint]"]
all = ["TopoModelX[dev, doc]"]

[project.urls]
homepage = "https://github.com/pyt-team/TopoModelX"
repository = "https://github.com/pyt-team/TopoModelX"
documentation = "https://pyt-team.github.io/TopoModelX"
issues = "https://github.com/pyt-team/TopoModelX/issues"
documentation = "https://pyt-team.github.io/TopoModelX"
source = "https://github.com/pyt-team/TopoModelX"
issues = "https://github.com/pyt-team/TopoModelX/issues"

[tool.ruff]
target-version = "py310"
Expand All @@ -95,7 +94,7 @@ select = [
"PERF", # performance rules
"RUF", # miscellaneous rules
]
ignore = ["E501", "SIM115"] # line too long
ignore = ["E501"] # line too long

[tool.ruff.lint.pydocstyle]
convention = "numpy"
Expand Down
28 changes: 14 additions & 14 deletions test/tutorials/test_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@

def _exec_tutorial(path):
"""Execute a tutorial notebook."""
file_name = tempfile.NamedTemporaryFile(suffix=".ipynb").name
args = [
"jupyter",
"nbconvert",
"--to",
"notebook",
"--execute",
"--ExecutePreprocessor.timeout=1000",
"--ExecutePreprocessor.kernel_name=python3",
"--output",
file_name,
path,
]
subprocess.check_call(args)
with tempfile.NamedTemporaryFile(suffix=".ipynb") as tmp_file:
args = [
"jupyter",
"nbconvert",
"--to",
"notebook",
"--execute",
"--ExecutePreprocessor.timeout=1000",
"--ExecutePreprocessor.kernel_name=python3",
"--output",
tmp_file.name,
path,
]
subprocess.check_call(args)


paths = sorted(glob.glob("tutorials/cell/*.ipynb"))
Expand Down
28 changes: 14 additions & 14 deletions test/tutorials/test_combinatorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@

def _exec_tutorial(path):
"""Execute a tutorial notebook."""
file_name = tempfile.NamedTemporaryFile(suffix=".ipynb").name
args = [
"jupyter",
"nbconvert",
"--to",
"notebook",
"--execute",
"--ExecutePreprocessor.timeout=1000",
"--ExecutePreprocessor.kernel_name=python3",
"--output",
file_name,
path,
]
subprocess.check_call(args)
with tempfile.NamedTemporaryFile(suffix=".ipynb") as tmp_file:
args = [
"jupyter",
"nbconvert",
"--to",
"notebook",
"--execute",
"--ExecutePreprocessor.timeout=1000",
"--ExecutePreprocessor.kernel_name=python3",
"--output",
tmp_file.name,
path,
]
subprocess.check_call(args)


paths = sorted(glob.glob("tutorials/combinatorial/*.ipynb"))
Expand Down
28 changes: 14 additions & 14 deletions test/tutorials/test_hypergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@

def _exec_tutorial(path):
"""Execute a tutorial notebook."""
file_name = tempfile.NamedTemporaryFile(suffix=".ipynb").name
args = [
"jupyter",
"nbconvert",
"--to",
"notebook",
"--execute",
"--ExecutePreprocessor.timeout=1500",
"--ExecutePreprocessor.kernel_name=python3",
"--output",
file_name,
path,
]
subprocess.check_call(args)
with tempfile.NamedTemporaryFile(suffix=".ipynb") as tmp_file:
args = [
"jupyter",
"nbconvert",
"--to",
"notebook",
"--execute",
"--ExecutePreprocessor.timeout=1500",
"--ExecutePreprocessor.kernel_name=python3",
"--output",
tmp_file.name,
path,
]
subprocess.check_call(args)


paths = sorted(glob.glob("tutorials/hypergraph/*.ipynb"))
Expand Down
28 changes: 14 additions & 14 deletions test/tutorials/test_simplicial.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@

def _exec_tutorial(path):
"""Execute a tutorial notebook."""
file_name = tempfile.NamedTemporaryFile(suffix=".ipynb").name
args = [
"jupyter",
"nbconvert",
"--to",
"notebook",
"--execute",
"--ExecutePreprocessor.timeout=1000",
"--ExecutePreprocessor.kernel_name=python3",
"--output",
file_name,
path,
]
subprocess.check_call(args)
with tempfile.NamedTemporaryFile(suffix=".ipynb") as tmp_file:
args = [
"jupyter",
"nbconvert",
"--to",
"notebook",
"--execute",
"--ExecutePreprocessor.timeout=1000",
"--ExecutePreprocessor.kernel_name=python3",
"--output",
tmp_file.name,
path,
]
subprocess.check_call(args)


paths = sorted(glob.glob("tutorials/simplicial/*.ipynb"))
Expand Down

0 comments on commit 5ca62e4

Please sign in to comment.