Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed small_scitiff.tiff
Binary file not shown.
Binary file removed small_tiff.tiff
Binary file not shown.
2 changes: 1 addition & 1 deletion src/easyimaging/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.0.0'
__version__ = '0.0.1'
Binary file modified tests/small_scitiff.tiff
Binary file not shown.
Binary file modified tests/small_tiff.tiff
Binary file not shown.
20 changes: 11 additions & 9 deletions tests/unit_tests/measurement/test_measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ def test_init_missing_single_physical_coordinate(self, valid_data_array, coordin
with pytest.raises(ValueError, match="data array must have both 'x' and 'y' coordinates or neither."):
Measurement(data_array=invalid_data_array)

@pytest.mark.parametrize('path', ['small_scitiff.tiff', Path('small_scitiff.tiff')], ids=['str_path', 'Path_object'])
@pytest.mark.parametrize(
'path', ['tests/small_scitiff.tiff', Path('tests/small_scitiff.tiff')], ids=['str_path', 'Path_object']
)
def test_from_scitiff_valid(self, path):
# When Then
measurement = Measurement.from_scitiff(filename=path, unique_name='test_measurement', display_name='Test Measurement')
Expand Down Expand Up @@ -275,14 +277,14 @@ def test_from_scitiff_non_existent_file(self):

def test_from_scitiff_not_a_scitiff(self):
# When
path = 'small_tiff.tiff' # This is a regular TIFF, not a SciTIFF
path = 'tests/small_tiff.tiff' # This is a regular TIFF, not a SciTIFF
# Then Expect
with pytest.raises(RuntimeError, match=f"Tiff file '{path}' not a proper SciTIFF file:"):
Measurement.from_scitiff(
filename=path,
)

@pytest.mark.parametrize('path', ['small_tiff.tiff', Path('small_tiff.tiff')], ids=['str_path', 'Path_object'])
@pytest.mark.parametrize('path', ['tests/small_tiff.tiff', Path('tests/small_tiff.tiff')], ids=['str_path', 'Path_object'])
def test_from_tiff_stack_valid_paths(self, path):
# When Then
measurement = Measurement.from_tiff_stack(
Expand All @@ -309,7 +311,7 @@ def test_from_tiff_stack_valid_paths(self, path):
def test_from_tiff_stack_valid_time_of_flights(self, coord, expected):
# When Then
measurement = Measurement.from_tiff_stack(
filename='small_tiff.tiff',
filename='tests/small_tiff.tiff',
time_of_flights=coord,
)
# Expect
Expand All @@ -329,7 +331,7 @@ def test_from_tiff_stack_valid_time_of_flights(self, coord, expected):
def test_from_tiff_stack_valid_x_positions(self, coord, expected):
# When Then
measurement = Measurement.from_tiff_stack(
filename='small_tiff.tiff',
filename='tests/small_tiff.tiff',
time_of_flights=sc.arange('t', 0, 240, 1, unit='s'),
x_positions=coord,
y_positions=sc.arange('y', 0, 1020, 20, unit='cm'),
Expand All @@ -352,7 +354,7 @@ def test_from_tiff_stack_valid_x_positions(self, coord, expected):
def test_from_tiff_stack_valid_y_positions(self, coord, expected):
# When Then
measurement = Measurement.from_tiff_stack(
filename='small_tiff.tiff',
filename='tests/small_tiff.tiff',
time_of_flights=sc.arange('t', 0, 240, 1, unit='s'),
y_positions=coord,
x_positions=sc.arange('x', 0, 510, 10, unit='cm'),
Expand Down Expand Up @@ -397,7 +399,7 @@ def test_from_tiff_stack_invalid_time_of_flights(self, coord, error, expected_me
# When Then Expect
with pytest.raises(error, match=expected_message):
Measurement.from_tiff_stack(
filename='small_tiff.tiff',
filename='tests/small_tiff.tiff',
time_of_flights=coord,
)

Expand All @@ -422,7 +424,7 @@ def test_from_tiff_stack_invalid_x_positions(self, coord, error, expected_messag
# When Then Expect
with pytest.raises(error, match=expected_message):
Measurement.from_tiff_stack(
filename='small_tiff.tiff',
filename='tests/small_tiff.tiff',
time_of_flights=sc.arange('t', 0, 240, 1, unit='s'),
x_positions=coord,
)
Expand All @@ -448,7 +450,7 @@ def test_from_tiff_stack_invalid_y_positions(self, coord, error, expected_messag
# When Then Expect
with pytest.raises(error, match=expected_message):
Measurement.from_tiff_stack(
filename='small_tiff.tiff',
filename='tests/small_tiff.tiff',
time_of_flights=sc.arange('t', 0, 240, 1, unit='s'),
y_positions=coord,
)
Expand Down
Loading