diff --git a/README.md b/README.md index 288f9049..6d345033 100644 --- a/README.md +++ b/README.md @@ -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)) @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 6da54f15..ed006944 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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" diff --git a/test/tutorials/test_cell.py b/test/tutorials/test_cell.py index 1eebde07..0bea2f4b 100644 --- a/test/tutorials/test_cell.py +++ b/test/tutorials/test_cell.py @@ -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")) diff --git a/test/tutorials/test_combinatorial.py b/test/tutorials/test_combinatorial.py index 3190da47..d89ee074 100644 --- a/test/tutorials/test_combinatorial.py +++ b/test/tutorials/test_combinatorial.py @@ -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")) diff --git a/test/tutorials/test_hypergraph.py b/test/tutorials/test_hypergraph.py index ecce2b48..e544d6b5 100644 --- a/test/tutorials/test_hypergraph.py +++ b/test/tutorials/test_hypergraph.py @@ -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")) diff --git a/test/tutorials/test_simplicial.py b/test/tutorials/test_simplicial.py index 5fd05ed8..8bb2aba6 100644 --- a/test/tutorials/test_simplicial.py +++ b/test/tutorials/test_simplicial.py @@ -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"))