Files
aare/python/tests/test_ROI.py
mazzol_aandErik Fröjdh 86db375948
Build on RHEL9 / build (push) Successful in 2m40s
Build on RHEL8 / build (push) Successful in 3m15s
Run tests using data on local RHEL8 / build (push) Successful in 4m15s
Build on local RHEL8 / build (push) Successful in 2m56s
python repr for Eta, Cluster (#367)
- python string repr for Cluster and Eta
- Context manager for RawMasterFile 
- slice operator for ROI

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
2026-09-10 12:18:27 +02:00

21 lines
518 B
Python

import pytest
import numpy as np
from aare import ROI
def test_roi_slice():
"""test the ROI slice method"""
roi = ROI(0, 4, 2, 4)
array = np.array([[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12],
[13, 14, 15, 16]])
sliced_array = array[roi.slice()]
assert sliced_array.shape == (2, 4)
assert np.array_equal(sliced_array, np.array([[9, 10, 11, 12],
[13, 14, 15, 16]]))