Documentation for v0.1 version (#199)

* Adding Equations, solving typos
* improve _code.rst
* the team rst and restuctore index.rst
* fixing errors

---------

Co-authored-by: Dario Coscia <dariocoscia@dhcp-015.eduroam.sissa.it>
This commit is contained in:
Dario Coscia
2023-11-08 14:39:00 +01:00
committed by Nicola Demo
parent 3f9305d475
commit 8b7b61b3bd
144 changed files with 2741 additions and 1766 deletions

View File

@@ -15,9 +15,9 @@ def test_merge_tensors():
tensor3 = LabelTensor(torch.ones((30, 3)), ['g', 'h', 'i'])
merged_tensor = merge_tensors((tensor1, tensor2, tensor3))
assert tuple(merged_tensor.labels) == (
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i')
assert merged_tensor.shape == (20*20*30, 9)
assert tuple(merged_tensor.labels) == ('a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i')
assert merged_tensor.shape == (20 * 20 * 30, 9)
assert torch.all(merged_tensor.extract(('d', 'e', 'f')) == 0)
assert torch.all(merged_tensor.extract(('g', 'h', 'i')) == 1)
@@ -25,7 +25,7 @@ def test_merge_tensors():
def test_check_consistency_correct():
ellipsoid1 = EllipsoidDomain({'x': [1, 2], 'y': [-2, 1]})
example_input_pts = LabelTensor(torch.tensor([[0, 0, 0]]), ['x', 'y', 'z'])
check_consistency(example_input_pts, torch.Tensor)
check_consistency(CartesianDomain, Location, subclass=True)
check_consistency(ellipsoid1, Location)
@@ -34,7 +34,7 @@ def test_check_consistency_correct():
def test_check_consistency_incorrect():
ellipsoid1 = EllipsoidDomain({'x': [1, 2], 'y': [-2, 1]})
example_input_pts = LabelTensor(torch.tensor([[0, 0, 0]]), ['x', 'y', 'z'])
with pytest.raises(ValueError):
check_consistency(example_input_pts, Location)
with pytest.raises(ValueError):