Skip to content

Commit

Permalink
Rename edge_tensors() to get_edge_tensors().
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Hale committed Jul 22, 2024
1 parent 858d299 commit ca1419b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="sgw_tools",
version="3.0",
version="3.0.1",
author="Mark Hale",
license="MIT",
description="Spectral graph wavelet tools",
Expand Down
2 changes: 1 addition & 1 deletion sgw_torch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from . import layers

def edge_tensors(G):
def get_edge_tensors(G):
edge_list = G.get_edge_list()
edge_index = np.array([
np.concatenate((edge_list[0], edge_list[1])),
Expand Down
4 changes: 2 additions & 2 deletions tests/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class TestCase(unittest.TestCase):
def test_get_laplacian(self):
G = sgw.BigGraph.create_from(gsp.graphs.Sensor(50, seed=32), lap_type="adjacency")
edge_index, edge_weight = sgw_torch.edge_tensors(G)
edge_index, edge_weight = sgw_torch.get_edge_tensors(G)
L_index, L_weight = sgw_torch.get_laplacian(edge_index, edge_weight, lap_type="adjacency", num_nodes=G.N)
torch_L = torch_utils.to_scipy_sparse_matrix(L_index, L_weight)
np.testing.assert_allclose(G.L.toarray(), torch_L.toarray())
Expand All @@ -30,7 +30,7 @@ def test_ChebLayer(self):
layer = sgw_torch.layers.ChebLayer(1, 1, K+1, lap_type="normalized", bias=False)
for c, p in zip(coeffs, layer.parameters()):
p.data = torch.tensor([[c]])
edge_index, edge_weight = sgw_torch.edge_tensors(G)
edge_index, edge_weight = sgw_torch.get_edge_tensors(G)
y = layer(torch.from_numpy(s), edge_index, edge_weight)

np.testing.assert_allclose(expected, y.detach().numpy().squeeze())

0 comments on commit ca1419b

Please sign in to comment.