Skip to content

Commit c2e1c5a

Browse files
committed
means
1 parent e5717a9 commit c2e1c5a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

autoarray/structures/triangles/coordinate_array.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,7 @@ def for_limits_and_scale(
243243
x_offset=x_mean,
244244
y_offset=y_mean,
245245
)
246+
247+
@property
248+
def means(self):
249+
return np.mean(self.triangles, axis=1)

test_autoarray/structures/triangles/test_coordinate_implementation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,7 @@ def test_for_limits_and_scale():
297297
],
298298
]
299299
)
300+
301+
302+
def test_means(one_triangle):
303+
assert np.all(one_triangle.means == [[0.0, -0.14433756729740643]])

0 commit comments

Comments
 (0)