Skip to content

Commit

Permalink
Added runtime error in case radii of torus do not match
Browse files Browse the repository at this point in the history
  • Loading branch information
Clancy97 committed Dec 12, 2023
1 parent 82248dd commit 4bab952
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions torch_topological/data/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ def sample_from_torus(n, d=3, r=1.0, R=2.0, seed=None):
torch.tensor of shape `(n, d)`
Tensor of sampled coordinates.
"""
if r > R:
raise RuntimeError(
'Radius of the tube must be less than or equal to radius of the torus'
)


rng = np.random.default_rng(seed)
angles = []

Expand Down

0 comments on commit 4bab952

Please # to comment.